字体属性

CSS字体属性定义字体,加粗,大小,文字样式
color
规定文本的颜色
div{ color:red;}
div{ color:#ff0000;}
div{ color:rgb(255,0,0);}
div{ color:rgba(255,0,0,.5);}
font-size
设置文本的大小
能否管理文字的大小,在网页设计中是非常重要的。但是,你不能通过调整字体大小使段落看上去像标题,或者使标题看上去像段落。
h1 {font-size:40px;}
h2 {font-size:30px;}
p {font-size:14px;}
温馨提示
chrome浏览器接受最小字体是12px


背景属性一



background-image属性
设置元素的背景图像
元素的背景是元素的总大小,包括填充和边界(不包括外边距)。默认情况下background-image属性放置在元素的左上角,如果图像不够大的话会在垂直和水平方向平铺图像,如果图像大小超过元素大小从图像的左上角显示元素大小的那部分
<div class="box"></div>
.box{
width: 600px;
height: 600px;
background-image: url("https://www.itbaizhan.com/wiki/images/img1.jpg");
}

背景属性二


.box{
width: 600px;
height: 600px;
background-image: url("https://www.itbaizhan.com/wiki/images/img1.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
}

.box{
width: 600px;
height: 600px;
background-color: #fcc;
background-image: url("https://www.itbaizhan.com/wiki/images/img1.jpg");
background-repeat: no-repeat;
background-position: center;
}


被折叠的 条评论
为什么被折叠?



