背景图片位置,"/>
CSS的背景——颜色,图片,背景图片位置,
1 颜色——代码展示
<style>
div {
width: 200px;
height: 200px;
background-color: pink;
}
</style>
</head>
<body>
<div></div>
</body>
2
<style>
div {
width: 300px;
height: 300px;
background-image: url(7.jpg);
}
</style>
</head>
<body>
<div></div>
</body>
代码展示
<title></title>
<style>
div {
width: 300px;
height: 300px;
background-image: url(7.jpg);
background-repeat: no-repeat;
/* 沿着x轴平铺 */
background-repeat: repeat-x;
}
</style>
</head>
<body>
<div></div>
</body>
<style>
div {
width: 600px;
height: 300px;
background-image: url(9.jpg);
background-repeat: no-repeat;
background-color: red;
/* 沿着x轴平铺 */
/* background-repeat: repeat-x; */
background-position: right center;
}
</style>
</head>
<body>
<div></div>
</body>
更多推荐
CSS的背景——颜色,图片,背景图片位置,
发布评论