开发者

cannot effect image with css - need to move up with a neg. margin

This is a really odd one. I cannot seem to affect this one image via css at all. Tried addi开发者_如何学编程ng 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!


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?


I would set position: absolute for the image. Then you will be able to move it freely with margins relative to its inline position.


The last 3 classes of your CSS

#text-4
{
font-size:11px;
line-height: 15px;
color: #000000;
text-align: center;
}

img.wp-image-39
{
margin-top:-120px;
background:#ff0000;
}
.toptab
{
margin-top:-120px;
background:#ff0000;
}

are inside @media print { which is actually not closed.

Put a closing bracket before #text-4 or wherever you need.


<div style="margin-top:-120px;">

Inline CSS would work also on the div that wraps around the . Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜