gpt4 book ai didi

html - 居中CSS block

转载 作者:行者123 更新时间:2023-11-28 14:18:17 26 4
gpt4 key购买 nike

此 CSS block 控制某些第 3 方图像的位置。它们是作为 javascript slider 动态生成的。我需要根据页面上其他位置的另一张图片将其居中。我知道引用图像的左右尺寸。我需要做的就是弄清楚如何将这个 block 集中在那个上面。有没有办法在 200 像素和 800 像素之间居中?

.pagination {
display: block;
margin:26px auto 0;
width:400px;
margin-left: auto;
margin-right: auto;
left: 130px;
position:relative;
text-align: center;
}

最佳答案

如果您知道宽度是 400px(根据您的代码段),您可以:

.pagination {
display: block;
margin: 26px auto 0;
width: 400px;
}

例子在 http://jsfiddle.net/Ne9jz/

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

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