CSS--样式汇总

前言

CSS内容说多不多,说少也不少,所以我只能将我自己了解到的总结到博客中,希望能给各位看官带来收获。

内容

文字样式

p{
    font-family:Arial, Helvetica, sans-serif;
}

表示如果用户端有Arial字体就使用,没有就使用Helvetica字体,没有Helvetica字体使用sans-serif字体

描述 表达式 参数
font 14px 幼圆
字体 font-family 幼圆/雅黑/console
大小 font-size 5px
颜色 color yellow/#red/#000000
粗细 font-weight bold/100
斜体 font-style
下划线 text-decoration
大小写 text-transform
对齐 text-align
浮点 float
间隔 padding-left/right
间距 padding 5px/5px 6px 1px 6px
外边距 margin 5px
行高 ling-height 1.5em

图片样式

图片中的样式大部分和文字样式一样,比如:图片对齐与文字对齐一模一样;

描述 表达式
边框 border
边框样式 border-style
边框颜色 border-color
边框宽度 border-width
边框左边 border-left
边框右边 border-right

页面样式

描述 表达式 参数
背景颜色 background-color yellow/#red/#000000
背景图片 background-image url(图片地址)
重复方向 background-repeat repeat-y/repeat-x/no-repeat
图片位置 background-position bottom right
固定位置 background-attachment fixed

表格和表单样式

描述 表达式 参数
表格 table
表格标题 caption
tr
第一行 th
内容 td
表格边框 border 1px/1px solid #000
边框重叠 border-collapse
宽度 widht 5px
高度 height 5px
背景颜色 background-color 000/yellow/red/transparent
下划线 border-bottom 1px solid #000
外边距 margin 0px
间距 padding 0px

超链接样式

描述 表达式 参数
背景图片 background
超链接正常状态下 a:link
访问过的超链接 a:visited
鼠标经过时的超链接 a:hover
下划线 text-decoration none/underline

总结

参数方面需要多多总结,在实际运用中参数的变式多种多样,所以需要多多练习练习。

end

谢谢您的阅读!

猜你喜欢

转载自blog.csdn.net/luojun13class/article/details/81252423