gpt4 book ai didi

html - 在 div 中居中超链接

转载 作者:太空宇宙 更新时间:2023-11-04 15:32:41 25 4
gpt4 key购买 nike

我有这个 CSS:

#footerLinks {
text-align: center;
margin: auto;
}

#footerLinks a {
float: left;
color: #c2c2c2;
display: block;
font-size: 12px;
margin-right: 10px;
}

还有这个 html:

<div id="footerLinks">
<a href="">No Porn on App Store</a>
<a href="">Porn and Apple</a>
<a href="">iPhone Porn Wiki</a>
</div>

问题是超链接不会位于页面的中心。我尝试了 margin: autotext-align 并尝试使用 margins 没有任何效果,为什么?

最佳答案

从此类中删除 float:left;display:block;

#footerLinks a {                
color:#c2c2c2;
font-size: 12px;
margin-right: 10px;
}

Demo

关于html - 在 div 中居中超链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13176851/

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