简体   繁体   English

background-color属性在Safari上不起作用

[英]background-color property not working on Safari

Im workin on this site https://www.comercialoregon.cl and realized that when on Safari, some elements will not properly display, the main ones being those with the background-color property set to #11a004e0, instead they have a gray background. 我在该网站https://www.comercialoregon.cl上工作,并意识到在Safari上时某些元素将无法正确显示,主要是那些background-color属性设置为#11a004e0的元素,而它们具有灰色背景。 any ideas why this happening? 任何想法为什么会这样?

Here is the css for the div on the nav bar that SHOULD be green (works on chrome and mozilla). 这是导航栏上的div的CSS,应为绿色(适用于chrome和mozilla)。 Thanks 谢谢

.boton_nav {
  border-radius: 4px;
  background-color: #11a004e0;
  border: none;
  color: #FFFFFF;
  text-align: center;
  font-size: 15px;
  padding: 10px;
  width: 220px;
  margin-left: 2em;
  animation-name: boton_nav;
  animation-duration: 4s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  animation-delay: 3s;
}

This server could not prove that it is www.comercialoregon.cl; 该服务器无法证明它是www.comercialoregon.cl;。 its security certificate expired 428 days ago. 它的安全证书已在428天前过期。

There's your first problem, but it isn't directly related to the question. 这是您的第一个问题,但这与问题没有直接关系。 Just felt like reminding you that your visitors will first see that big scary invalid certificate screen and will likely leave. 只是想提醒您,您的访客将首先看到那个可怕的大无效证书屏幕,并且很可能会离开。


The issue is you are using the #rrggbbaa hexadecimal colour notation which is not yet widely supported. 问题是您使用的#rrggbbaa十六进制颜色表示法尚未得到广泛支持。 As of now, according to caniuse.com , only Firefox, Chrome and Safari support it. 根据caniuse.com的数据到目前为止 ,仅Firefox,Chrome和Safari支持它。 I know you mentioned it's not working on Safari, but perhaps you're on a version older than 10? 我知道您提到它无法在Safari上运行,但是也许您使用的版本早于10?

Regardless, support isn't good so I wouldn't recommend using it just yet. 无论如何,支持不是很好,所以我不建议您立即使用它。 Instead, use the rgba function. 而是使用rgba函数。 background-color: #11a004e0; would become background-color: rgba(17, 160, 4, 224); 会变成background-color: rgba(17, 160, 4, 224); as the colour values are represented in decimal rather than hexadecimal. 因为颜色值以十进制而不是十六进制表示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM