问题描述
Discuz! 6.1.0 风格模板说明(五)
发布: 2008-9-03 15:56 | 阅读: 1349次 | 满意: 16人 | 打印
十、css 一些常用属性介绍
Border:边框,包括边框的宽度、类型、颜色等。
例:border:1px solid #000; 边框宽度为1px、实线、黑色
border:2px dashed #000; 边框宽度为2px、虚线、黑色
border:3px dotted #000; 边框宽度为3px、点线、黑色
附:border-left 为左边框样式,border-right 为右边框样式,border-top 为上边框样式,border-bottom 为下边框样式,border-collapse 为边框是否重复,属性包括 collapse(不重复)、separate(独立)。
Background:背景,包括背景颜色、图片等等。
例:background:#000 url(images/bg.gif) left top no-repeat; 背景为黑色,背景图片为 bg.gif,背景图片位置在左上方,背景不重复。
附:background-image 为背景图片,background-color 为背景颜色,background-position 为背景图片位置,background-repeat 为背景图片是否平铺。
Color:字体颜色。
例:color:#000000; 字体颜色为黑色
color:black; 字体颜色为黑色
color:rgb(0,0,0); 字体颜色为黑色
Margin:外边距。
例:margin:10px; 外边距都为10px
margin:10px 20px 30px; 上外边距为10px,左右外边距都为20px,下外边距为30px
margin:10px 20px; 上下外边距为10px,左右外边距为20px
margin:10px 20px 30px 40px; 上外边距为10px,右外边距为20px,下外边距为30px,左外边距为40px
附:margin-left 为左外边距,margin-right 为右外边距,margin-top 为上外边距,margin-bottom 为下外边距。
Padding:内边距。具体用法与 margin 相同,只不过是内边距而已。
Font-size:字体大小。
例:font-size:12px; 字体大小为12px
Font-weight:字体粗细。
例:font-weight:bold; 加粗
font-weight:normal; 正常
font-weigt:lighter; 细体
font-weight:700; 粗细数值为700(从100-900,400为正常字体,700为bold)
Font-style:字体样式。
例:font-style:normal; 正常字体
font-style: italic; 斜体
text-decoration:是否带划线。
例:text-decoration:underline; 下划线
text-decoration:line-through; 中划线
text-decoration:overline; 上划线
text-decoration:none; 没有划线
text-indent:文字是否缩进。
例:text-indent:2em; 缩进两个字
text-indent:0; 不缩进
Line-height:行高。
例:line-height:normal; 默认行高
line-height:150%; 行高为150%
line-height:20px; 行高为20px
Text-align:文字对齐方式。
例:text-align:left; 文字左对齐
text-align:right; 文字右对齐
text-align:center; 文字居中
Float:浮动。
例:float:left; 浮动到左侧
float:right; 浮动到右侧
float:none; 不浮动
display:block; 块状显示。
display:none; 不显示。
Width:宽度。
Height:高度。
您可能还对以下内容感兴趣:
没找到您想要的答案吗?建议您到我们的讨论区发帖寻求大家和 Comsenz 工作人员的帮助。

