无法使用 css 影响图像 - 需要使用负值向上移动。利润
这真是一件奇怪的事。我似乎根本无法通过 css 影响这一张图像。尝试添加专门针对图像的类,并编写 css 来仅影响图像,但是 zip.它不会让步。唯一让它动起来的是设置否定。实际图像上的边距,并且只向上移动了大约40px,并且不会再进一步移动(从那时起就将其关闭)。有问题的图像是此页面上的“想象”选项卡(wp-image-39): http://circore.com/haute/。我留下的 css 部分是:
img.wp-image-39
{
margin-top:-120px;
background:#ff0000;
}
.toptab
{
margin-top:-120px;
background:#ff0000;
}
我还尝试过影响内容区域中的所有图像以及其他一些东西。红色背景只是为了让我可以看看是否有效果。啊!非常感谢!
This is a really odd one. I cannot seem to affect this one image via css at all. Tried adding a class specifically for the image and also writing css to affect just the image, but zip. It won't budge. The only thing that made it move was setting the neg. margin on the actual image, and there it only moved up about 40px and wouldn't go any further (taken that off since then). The image in question is the "imagine" tab (wp-image-39) on this page:http://circore.com/haute/. The bits of css I've left are:
img.wp-image-39
{
margin-top:-120px;
background:#ff0000;
}
.toptab
{
margin-top:-120px;
background:#ff0000;
}
I've also tried affecting all images in the content area and a bunch of other things. The red background is just so I can see if something worked. Argh! Thanks so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
与其尝试在图像上添加样式,为什么不在包含的
div
上添加样式呢?.toptab { 顶部边距:-50px; }
这能满足您的需求吗?
Instead of trying to put styles on the image, why not put styles on the containing
div
?.toptab { margin-top: -50px; }
Would that suit your needs?
我会为图像设置
position:absolute
。然后,您将能够相对于其内联位置自由移动其边距。I would set
position: absolute
for the image. Then you will be able to move it freely with margins relative to its inline position.CSS 的最后 3 个类
位于 @media print { 内,实际上并未关闭。
在 #text-4 之前或任何您需要的地方放置一个右括号。
The last 3 classes of your CSS
are inside @media print { which is actually not closed.
Put a closing bracket before #text-4 or wherever you need.
内联 CSS 也适用于包裹 .希望这有帮助。
Inline CSS would work also on the div that wraps around the . Hope this helps.