今天爱分享给大家带来transform 中含有 position: fixed 失效的问题解决,希望能够帮助到大家。
话不多说,直接上代码!!!
原代码是这样的
.down-icon {
width: .27rem;
height: 0.27rem;
border-top: .02rem solid #6D3942;
border-left: .02rem solid #6D3942;
transform: rotate(45deg);
position: fixed;
left: 0;
bottom: 0.4rem;
left: 0;
right: 0;
margin: auto;
}
结果没有任何反应,其中的transform: rotate(45deg);并没有管用
解决办法:
将position: fixed;放在父元素内,添加一个子元素transform: rotate(45deg);放在子元素内
.down-icon {
width: .27rem;
height: 0.27rem;
position: fixed;
left: 0;
bottom: 0.4rem;
left: 0;
right: 0;
margin: auto;
i{
display: block;
width: 100%;
height: 100%;
border-top: .02rem solid #6D3942;
border-left: .02rem solid #6D3942;
transform: rotate(45deg);
}
}
此时效果可以实现
原文链接:https://itblood.website/460.html,转载请注明出处。

![傲慢的怪兽公主与名侦探使魔 v1.11 + DLC 官方中文步兵版[电脑/4.25G] [爆款SLG/中文/动态]](/wp-content/uploads/replace/2025/07/19/6131c9b65944dcc05b5de0a0d7ce6f69.webp)