Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
背景色css在safari中不起作用_Css_Safari - Fatal编程技术网

背景色css在safari中不起作用

背景色css在safari中不起作用,css,safari,Css,Safari,如上图所示,safari的背景是银色的。但它在其他浏览器(chrome和firefox)上运行良好 这是密码 HTML: <a type="button" class="btn btn-danger">Pesan a Sekarang</a> 这是CSS background-color: #e5131d!important;border-color: #e5131d!important; 尝试使用背景:#e5131d。您可能会

如上图所示,safari的背景是银色的。但它在其他浏览器(chrome和firefox)上运行良好

这是密码

HTML:

<a type="button" class="btn btn-danger">Pesan a Sekarang</a>
这是CSS

background-color: #e5131d!important;border-color: #e5131d!important;
尝试使用背景:#e5131d。您可能会使用背景设置银色,这可能会覆盖背景颜色

您还可以使用父元素类before作为解决方法

.parent.btn危险{背景:#e5131d}

避开!重要信息


<a type="button" class="btn btn-danger" href="#">{!! __('landingpage.button.details') !!}</a>
问题是我使用了带有attr type按钮的标记元素

然后我变成这样

<a href="#"><button type="button" class="btn btn-danger">text</button></a>


它在safari上对我有效

请提供您的代码而不是代码的图像[link]将帮助您提供我们需要的帮助。特别是请提供相关的HTML和CSS,并将整个内容放在一个片段中,以便我们可以轻松地尝试。@Sfili_81我只是更新了代码
<a href="#"><button type="button" class="btn btn-danger">text</button></a>