您的位置:首页 > Web前端 > HTML

HTML基础学习-15-background 背景相关属性设置

2017-06-11 21:19 671 查看
HTML基础学习-15-background 背景相关属性设置

<!DOCTYPE html>

<!--
background  背景色
bgsound
background-color: red;
background-color:rgb(25,255,0);
background-image:url(img/scenery.jpg);

background-repeat:        repeat背景重复 repeat-x x重复  repeat-y y重复  no-repeat 不重复
background-position:  right left  center  top  bottom
可以两个值,第一个表示水平  第二个表示垂直,两者之间不需要逗号

同样可以用数值表示    x坐标值  y坐标值  repeat为 no-repeat属性时候才生效
background{
背景颜色 url  显示背景是否重复  位置
}

-->

<head>
<title>背景相关属性设置</title>
<meta charset="utf-8">
<style type="text/css">
/*
body{
background-color:red;
background-image:url(img/scenery.jpg);
background-repeat:no-repeat;
background-position:center center;
background-position: 20px 20px;
}
body{
background:#ffff11 url(img/scenery.jpg) no-repeat 20px 20px;
}*/
div{
width:200px;
height:200px;
background:#ffff11 url(img/scenery.jpg) no-repeat 20px 20px;
}

</style>
</head>
<body>

<div>

</div>

</body>

</html>


跟随视频学习,手写记录自己学习过程中的点点滴滴,一起加油吧。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html rgb css