我试图通过使用负偏移量来消除将左浮动的 div 向左移动时造成的间隙。
有问题的网站:
图片类
.pic {
float: left;
width: 175px;
height: 750px;
margin-right: 22px;
position: relative;
left: -191px;
}
这就是我将图片向左移动的方式,我希望右侧的内容(衣服、头像和皮肤以及头部和脸部)左对齐;类似于配件的定位方式。
我想避免使用相同的过程将它们移到左侧。
最佳答案
您好,现在定义您的 id #avatar_products
position: relative;
和您的类(class)
.pic
position:absolute;左:-192px;
像这样
#avatar_products{position: relative;}
.pic{ position: absolute;left: -192px;}
结果是这样的
关于html - 相对位置向左移动导致内容保持在右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33936070/