我下面的代码表明background-repeat-x/y由于某种原因在 FireFox 上不起作用。它只是剔除了这些样式(但并不是说它们不正确+它们没有在某处被覆盖)。当我尝试将这些样式组合在一个 ( background) 中时,它也会将其排除在外。可以理解为什么会发生这种情况。没有找到类似的。
.myDiv {
height: 200px;
background-image: url(https://user-images.githubusercontent.com/37912316/38108463-2d5980dc-3395-11e8-948a-d7fd97647f86.png);
background-repeat-x: no-repeat;
background-repeat-y: repeat;
}Run Code Online (Sandbox Code Playgroud)
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="myDiv">
<p>Some text</p>
</div>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
使用background-repeat: repeat-y;来代替。
background-repeat-x: no-repeat;
background-repeat-y: repeat;
Run Code Online (Sandbox Code Playgroud)
在文档中找不到。
| 归档时间: |
|
| 查看次数: |
1908 次 |
| 最近记录: |