gpt4 book ai didi

css - 如何为 IE 重写此 css

转载 作者:行者123 更新时间:2023-11-28 13:24:28 24 4
gpt4 key购买 nike

我有这个 css 代码,它只在 Firefox 中被支持。

/* Green header */
.container {
background: linear-gradient(#5FA309, #3B8018);
position: relative;
display: inline-block;
padding: 0 20px 0 10px;
width: 270px;
line-height: 20px;
font-size: 12px;
font-family: sans-serif;
text-shadow: 0 1px 0 #264400;
font-weight: bold;
color: #fff;
}

.container:after {
content: '';
background: linear-gradient(top left, #5FA309, #3B8018);
background: -webkit-gradient(linear, left top, left bottom, from(#5FA309), to(#3B8018));
background: -moz-linear-gradient(top left, #5FA309, #3B8018);
position: absolute;
top: 3px; right: -7px;
width: 15px;
height: 15px;
transform: rotate(45deg);
}

如何让这段代码在 IE 上也受支持?我只想使用没有图像的 css。

最佳答案

请注意 -ms- 供应商前缀的使用以及供应商前缀的设置顺序:

.container{
background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5fa309), color-stop(1, #3b8018));
background:-webkit-linear-gradient(top, #5fa309 0%, #3b8018 100%);
background:-moz-linear-gradient(top, #5fa309 0%, #3b8018 100%);
background:-o-linear-gradient(top, #5fa309 0%, #3b8018 100%);
background:-ms-linear-gradient(top, #5fa309 0%, #3b8018 100%);
background:linear-gradient(top, #5fa309 0%, #3b8018 100%);
position:relative;
display:inline-block;
padding:0 20px 0 10px;
width:270px;
line-height:20px;
font-size:12px;
font-family:sans-serif;
text-shadow:0 1px 0 #264400;
font-weight:bold;
color:#fff
}
.container:after{
content:'';
background:-webkit-gradient(linear, left top, right bottom, color-stop(0, #5fa309), color-stop(1, #3b8018));
background:-webkit-linear-gradient(top left, #5fa309 0%, #3b8018 100%);
background:-moz-linear-gradient(top left, #5fa309 0%, #3b8018 100%);
background:-o-linear-gradient(top left, #5fa309 0%, #3b8018 100%);
background:-ms-linear-gradient(top left, #5fa309 0%, #3b8018 100%);
background:linear-gradient(top left, #5fa309 0%, #3b8018 100%);
position:absolute;
top:3px;
right:-7px;
width:15px;
height:15px;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-o-transform:rotate(45deg);
-ms-transform:rotate(45deg);
transform:rotate(45deg)
}

关于css - 如何为 IE 重写此 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14416017/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com