gpt4 book ai didi

html - 在 HTML/CSS 中居中

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

我想我可能遇到了问题,不确定它是否是一个问题,因为我已经看了它太久了,我什至不知道它是否居中。

http://jamessuske.com/thornwood/gallery.php

我想做的是让整个画廊居中,对我来说它看起来有点靠右。如果有人能帮我解决这个问题,那就太好了。提前致谢。

CSS 代码

.contentTextGallery{
padding:20px 0 0 0;
width:866px;
font-size:16px;
float:left;
}

.gallery{
width:912px;
margin-top:6px;
}

.gallery ul{
list-style-type:none;
text-align:center;
}

.gallery li{
display: inline-block;
}

* html .gallery li { /* IE6 */
display: inline;
}

*:first-child + html .gallery li { /* IE7 */
display: inline;
}

.gallery ul a {
display:block;
text-decoration: none;
color:#FFF;
padding:5px 0 0 5px;
}

最佳答案

看起来您只需要删除 .gallery 中元素的左侧填充:

.gallery ul { padding-left: 0px; }

根据您使用的网络浏览器,列表通常有默认填充。

关于html - 在 HTML/CSS 中居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7921864/

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