所以我遇到了这个奇怪的错误,Chrome不会在我的div中使用“to_top”类显示伪元素,它在Chrome上完美运行但Firefox不会在广场外显示水平线,而是出现在里面并且扩大了容器div,这只是悲伤。有什么方法可以解决这个问题吗?
这是我的代码(对不起内联样式,但这里不是问题):
.to_top::before{content:""; position:absolute; width:100%; height:1px; border-top:1px solid red; left:0px; top:-5px;}
<div style="width:100%; height:auto; display:flex; flex-direction:column;">
<div style="width:100%; height:300px; display:flex; flex-direction:column; position:relative; align-items:center; background: linear-gradient(to bottom, rgba(36, 31, 28, 1.0), rgba(36, 31, 28, 0.9)); justify-content:center;">
<div class="to_top" style="width:50px; height:55px; outline:1px solid red; display:flex; position:absolute; right:50px; top:50px; overflow:visible;">
<!--<span style="width:50px; height:1px; border-top:1px solid red; position:absolute; left:0px; top:-5px;"></span>-->
<i class="fa fa-chevron-up" style="font-size:30px; color:red; margin:auto;"></i>
</div>
<div style="width:auto; height:auto; display:flex; margin:15px 0px;">
<a href="" style="width:50px; height:50px; border-radius:50%; background-color:#5D973A; display:flex; margin:0px 15px;"><i class="fa fa-tripadvisor" style="margin:auto; font-size:22px; color:#292421;"></i></a>
<a href="" style="width:50px; height:50px; border-radius:50%; background-color:#5D973A; display:flex; margin:0px 15px;"><i class="fa fa-yelp" style="margin:auto; font-size:22px; color:#292421;"></i></a>
<a href="" style="width:50px; height:50px; border-radius:50%; background-color:#5D973A; display:flex; margin:0px 15px;"><i class="fa fa-facebook" style="margin:auto; font-size:22px; color:#292421;"></i></a>
</div>
<div style="width:auto; height:auto; display:flex; margin:15px 0px;">
<a href="" style="font-size:20px; text-transform:uppercase; margin:0px 12px; color:rgba(255,255,255,0.9); font-weight:500;">MENU</a>
<a href="" style="font-size:20px; text-transform:uppercase; margin:0px 12px; color:rgba(255,255,255,0.9); font-weight:500;">LOCALIZACIÓN</a>
<a href="" style="font-size:20px; text-transform:uppercase; margin:0px 12px; color:rgba(255,255,255,0.9); font-weight:500;">HORARIO</a>
<a href="" style="font-size:20px; text-transform:uppercase; margin:0px 12px; color:rgba(255,255,255,0.9); font-weight:500;">CONTACTO</a>
<a href="" style="font-size:20px; text-transform:uppercase; margin:0px 12px; color:rgba(255,255,255,0.9); font-weight:500;">OPINIONES</a>
</div>
</div>
<div style="width:100%; height:125px; display:flex; flex-direction:column; background: linear-gradient(to bottom, rgba(91, 150, 56, 1.0), rgba(91, 150, 56, 0.9)); justify-content:center; align-items:center;">
<span style="font-size:16px; color:rgba(255,255,255,0.9); margin:10px 0px; text-transform:upercase;">COMIDA TRADICIONAL HECHA CON <i class="fa fa-heart" style="font-size:15px; color:rgba(255,255,255,0.9); margin:0px 3px;"></i> EN MÁLAGA</span>
<div style="display:flex; width:auto; height:20px; margin:10px 0px; align-items:center;">
<span style="font-size:13px; color:rgba(255,255,255,0.9); text-transform:uppercase;">Copyright © 2018 Nombre del Restaurante</span>
<span style="width:1px; height:20px; border-right:2px solid rgba(255,255,255,0.9); margin:0px 10px;"></span>
<span style="font-size:13px; color:rgba(255,255,255,0.9); text-transform:uppercase;">DISEÑO WEB POR GGB</span>
</div>
</div>
</div>
答案 0 :(得分:0)
为sqare使用border而不是outline。