CSS样式

1、前景图与背景图
div{
border: 2px solid red; //设置背景图边框
width:1500px;
height:1500px;
background-color: black; //设置背景图的颜色
background-image: url("../images/guang.png"); //插入前景图
background-size:1500px 1500px; //改变前景图的尺寸大小
background-repeat: no-repeat; //设置前景图为单个不重复
background: url("../images/guang.png") no-repeat; //简写前景图设置
}
2、CSS文本
CSS文本属性包括color(颜色),direction(字体位置),line-height(设置行高,垂直居中可调),text-align(水平方向的移动,可调水平居中),text-decoration(下划线,上划线,中间划线),text-indent(缩进元素中文本的首行,可用于图片覆盖技术),text-transform(控制元素中的字母)
例:p{
color: rgb(208,34,87);
direction: rtl;
line-height: 100px;
text-align: center;
text-decoration: underline;
text-indent: -300px;
text-transform: lowercase;
}
结果会出现相应的格式
3、css字体
CSS 字体属性定义文本的字体系列、大小、加粗、风格(如斜体)和变形(如小型大写字母)。
例:p{
font-size:30px;
font-style:italic;
font-weight:bolder;
}
结果会出现相应的格式
4、css列表
CSS 列表属性容许你放置、改变列表项标志,或者将图像做为列表项标志。
例:li{
list-style-image:url(“图片路径”);
list-style-posion:inside;css

相关文章
相关标签/搜索