下面的代码演示了 background-repeat-x/y 因为某些原因,在火狐上不起作用。它只是删除了那些样式(但不象它们是错误的+它们不会在某个地方被覆盖)。 当我尝试将这些样式组合在一起时( background )它也让人震惊。知道为什么会这样。没有发现类似的东西。
background-repeat-x/y
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; }
<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>
使用 background-repeat: repeat-y; 相反。
background-repeat: repeat-y;
background-repeat-x: no-repeat; background-repeat-y: repeat;
在文档中找不到。