前端基础css样式

  • style 在元素上作为属性
  • style在head标签里面
  • 引入外部的css文件

CSS选择器,找到特定的元素

标签选择器
类选择器
id选择器
通配符选择器*
在这里插入图片描述

字体样式

font-size
font-family
font-weight
font-style
font综合写法,font-size font-family不可省约
font: font-style font-weight font-size/line-height font-family

color
text-align: 文本对齐方式,让盒子里面的内容,不是让盒子
line-height: 行高
text-indent:首行缩进 2em; em是字体宽度
text-decoration:none

块元素
div p h1-h6

行内元素
a span

行内块元素
img input dt

行高等于盒子高度,文本就垂直居中了

背景图片

background-image: url(images/name/[email protected]);
background-repeat: no-repeat;
background-position: left top;
background-positon: 10px 20px;
background-attachment
background-size

css

层叠性:就近原则
继承性: text- font- line- color
优先级:谁的权重大谁生效


失去登陆状态边界值CSDN给我丢失了内容,wtf

发布了370 篇原创文章 · 获赞 81 · 访问量 30万+

猜你喜欢

转载自blog.csdn.net/lineuman/article/details/103706064