<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
我的一位开发人员今天不在办公室,我想在没有他的情况下快速完成一些事情。我需要在第一个位于中心的主图片下方放置文本“单击以放大”。我所能做的就是让它左对齐或右对齐。任何输入将不胜感激。
我也试过使用“margin-left: auto; margin-right: auto;”但也没有运气。
http://coasttocoastfishmounts.com/fish-mounts/striped-bass
请参阅突出显示的文本以进行说明: http://i.stack.imgur.com/Pyr76.jpg
最佳答案
试试这个
.big-image-holder .click-to-enlarge{
position: absolute;
left: 50%;
bottom: 0;
-webkit-transform: translate(-50%, 0);
-moz-transform: translate(-50%, 0);
-ms-transform: translate(-50%, 0);
transform: translate(-50%, 0);
}
关于html - 居中对齐图像持有人中的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29924334/