首页 > 其他 > 详细

属性:background

时间:2020-06-28 23:18:32      阅读:71      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>

/*!*外边界是0*! margin*/
*{
margin: 0;
}

#id1{
height: 1200px;
width: 1600px;
color: yellow;
font-size: 100px;

/*字体居中text-align:center*/
text-align: center;

        行高
line-height: 100px;

background-color: #c6e2fd;

        背景图
background-image: url("2.jpg");
/*background-repeat: repeat-y;*/

        不重复
background-repeat: no-repeat;
background-size: 300px 300px;
    
        图片位置
/*background-position: center;*/
background-position:top center;

/*background-size: auto;*/

        可写在一行
/*background: url("2.jpg") no-repeat 100px 100px yellow;*/
}

p{
color: #fac237;
background: #b18621;
text-align: center;
line-height: 200px;
letter-spacing: 50px;
word-spacing: 30px;
}

</style>
</head>
<body>

<div id="id1">LOL</div>

<p>p1 p2</p>

</body>
</html>

属性:background

原文:https://www.cnblogs.com/zxy01/p/13205243.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!