如何在水平方向重复背景图像
实例解析:
background-repeat属性用于设置背景图像的平铺方式。可以设置以下值:
● repeat:默认值,背景图像将向垂直和水平方向重复。
● repeat-x:只有水平位置会重复背景图像。
● repeat-y:只有垂直位置会重复背景图像。
● no-repeat:设置背景图片不重复。
新建文件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<style>
body
{
background-image:url('https://img.php.cn/upload/article/000/000/015/5c6a80bba060c467.png');
background-repeat:repeat-x;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
预览
Clear
- 课程推荐
- 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~ 















