我使用rgba(0,0,0,0.5)作为background-color属性,在除了macbook上的Safari 12.0.2之外的所有浏览器中都能正常工作。 我还使用https://www.lambdatest.com/测试浏览器兼容性,它在他们的safari浏览器上也可以很好地工作,仅仅在我朋友的macbook上不行。有什么想法是什么可能会导致这个问题吗?
我不能使用HEX代码然后再用不透明度规则,因为这也会影响到覆盖在此div上方的按钮。 在我的朋友的笔记本电脑上,仅使用rgba无法工作,但rgb或hex可以,但我需要使用rgba因为需要透明度。
兼容性表格显示rgba受Safari 2.0+支持,所以我看不出为什么它不会在Safari 12.0.2上工作。
有什么想法是什么可能会导致这个问题吗?
.initialPanel {
overflow: hidden;
width: 900px;
height: 130px;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center
}
.initialPanelWrap {
position: absolute;
width: 100%;
bottom: 35%;
display: flex;
justify-content: center
}
.HpButtonGreen {
height: 60px;
width: 360px;
background-color: #1e983e!important;
color: white;
border: none;
cursor: pointer;
}
.HpButtonGreen:hover {
background-color: #0F792B!important;
-webkit-transition: background-color 300ms linear;
-ms-transition: background-color 300ms linear;
transition: background-color 300ms linear;
}
<div class="initialPanelWrap">
<div class="initialPanel">
<div class="riadok">
<div class="butcol margin-right-30"><button class="HpButtonGreen" type="button"></button></div>
<div class="butcol"><button class="HpButtonGreen" type="button"></button></div>
</div>
</div>
</div>