css - Background-repeat-x/y 在 Firefox/Safari 中不起作用
问题描述
我下面的代码演示了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;
}
<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-x: no-repeat;
background-repeat-y: repeat;
在文档中找不到。
推荐阅读
- java - Junit ant 任务未将断言错误报告为失败
- python - 如何从python中的for循环在csv文件中创建两列?
- reactjs - 在我的上下文提供程序中获取 useparams 是否有更好的方法?
- javascript - 使用 cypress 进行麦克风测试
- laravel - Laravel 6:如何在我的视图中使用 Group By?
- graphql - 共享访问控制模式 Amplify GraphQL
- flutter - 异步方法在 initState 中无法正常工作
- php - 如何为 WordPress 多个子域设置 if-else 条件?
- powershell - WixInstaller+ .NET framework4.7.2 安装后重启
- asp.net-mvc - 将 url 作为参数传入 MVC url