gpt4 book ai didi

css -
中心对齐在 IE 浏览器中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 19:52:42 24 4
gpt4 key购买 nike

除一个浏览器外,它适用于所有浏览器。我希望这个 div 位于页面的中心

<div style="padding-left: 800px;">
<a class="works-top" href="/page/1"></a>
<a class="free-top" href="/page/2"></a>
<a class="faq-top" href="/page/3"></a> </div>

这就是我在 css 中定义它的方式

a.free-top {
display:block;
cursor:pointer;
background:url(../img/free.png) no-repeat left top;
width:100px;
height:20px;
text-indent:-5000px;
margin-left:0px;
margin-top:0px;
margin-bottom:4px;
float:left;
}

最佳答案

代替padding-left:800px;

<div style="padding-left: 800px;">

使用 margin:0 auto;和宽度:1000px;

请记住,margin:0 auto; 只有在指定宽度时才有效。

关于css - <div> 中心对齐在 IE 浏览器中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15359108/

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