1.text-decoration
text-decoration下划线值:
none : 无装饰
blink : 闪烁
underline : 下划线
line-through : 贯穿线
overline : 上划线
text-decoration:none 无装饰,通常对html下划线标签去掉下划线样式
text-decoration:underline 下划线样式
text-decoration:line-through 删除线样式-贯穿线样式
text-decoration:overline 上划线样式
2.id class选择器
id选择器:为标有特定 id 的 HTML 元素指定特定的样式
HTML元素以id属性来设置id选择器,CSS 中 id 选择器以 “#” 来定义
ID属性不要以数字开头,数字开头的ID在 Mozilla/Firefox 浏览器中不起作用。
#para1
{
text-align:center;
color:red;
}
class选择器:用于描述一组元素的样式,可以在多个元素中使用
class 选择器在HTML中以class属性表示, 在 CSS 中,类选择器以一个点 "." 号显示
class命名不要以数字开头,数字开头的ID在 Mozilla/Firefox 浏览器中不起作用。
// 所有拥有 center 类的 HTML 元素均为居中
.center {text-align:center;}
// 所有的 p 元素使用 class="center" 让该元素的文本居中
p.center {text-align:center;}
样式
内联样式>内部样式>外部样式>浏览器默认样式
选择器:
内联样式 > id 选择器 > 类选择器 = 伪类选择器 = 属性选择器 > 标签选择器 = 伪元素选择器
背景
background-color:red;背景颜色
background-image:url(’’);背景图片
background-repeat:repeat-x; no-repeat背景图像 - 水平或垂直平铺
background-position:right top;改变图像在背景中的位置
background-attachment:scroll;背景图像是否固定或者随着页面的其余部分滚动
background:#ffffff url(‘img_tree.png’) no-repeat right top;简写属性,作用是将背景属性设置在一个声明中。