Background-repeat-x/y在Firefox/Safari中不起作用 [英] Background-repeat-x/y doesn't work in Firefox/Safari

查看:261
本文介绍了Background-repeat-x/y在Firefox/Safari中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的代码中演示了background-repeat-x/y由于某些原因在FireFox上不起作用.它只是剔除了那些样式(但不像它们是不正确的+在某些地方没有被覆盖). 当我尝试将这些样式组合成一个(background)时,它也会被删除.可以知道为什么会这样.没找到类似的东西.

I have code below demonstrates that background-repeat-x/y for some reason doesn't work on FireFox. It just strikes out those styles (but not like they're incorrect + they aren't overridden somewhere). When I try to combine these styles in one (background) it also strikes it out. Can get why this happens. Haven't found anything similar.

.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;

在文档中找不到.

这篇关于Background-repeat-x/y在Firefox/Safari中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆