【发布时间】:2021-04-20 06:05:50
【问题描述】:
嗨,我的背景图片连续显示 5 次,我是 html 新手,我用谷歌搜索了一下,但找不到合适的词,我的文件中有这段代码
<!DOCTYPE html>
<html>
<head>
<title>'Cyclone development'</title>
<link href="styles/main.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<hl>Cyclone development</hl> <img src="cyclone.jpeg" alt="Italian Trulli">
<p>Who are we ?<br></p>
<ans> We are a development team dedicated towards coding we make coding videos on youtube
for our users to learn and develop.
</ans>
</body>
</html>
这个在主css文件中
hl{
color: rgb(0, 0, 0);
padding: 10px 10px;
font-size: 80px;
background: url(macoswall.jpeg);
background-size: 120px 120px;
}
body{
background: #999;
font-family: arial;
}
p{
color:rgb(255, 0, 0);
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
font-style: italic, bold;
background-color: rgb(0, 60, 255);
background-size: 300px 100px;
}
ans{
color:rgb(255, 0, 0);
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
font-style: italic;
}
我的 hl 背景图像重复多次,同时显示为 this 我该如何解决?
【问题讨论】:
-
你试过
background-repeat: no-repeat;吗? -
只需阅读有关css background-repeat的文档
-
<hl>标签是什么? -
你的意思是背景图片重复5次还是不重复?