Hi,
I am trying to make a floating element that contains an image link and text.
My problem is that the border of the image is not really wrapping around nicely.
So i use margin and padding with negative px to fix it, but obviously it's a dirty way. Could some one see what i do wrong?
here's html:
here's css(notice -4px, etc.):
here's the website:
any help appreciated.
I am trying to make a floating element that contains an image link and text.
My problem is that the border of the image is not really wrapping around nicely.
So i use margin and padding with negative px to fix it, but obviously it's a dirty way. Could some one see what i do wrong?
here's html:
Code:
<div class="item_float"> <a href="http://dabija.lt....."> <div class="thumb_style"> <img src="http://dabija.lt/wp-content/...." width="160" height="160" alt="Proginė puok?tė"/> </div> <div class="thumb_text">Proginės puok?tės</div> </a> </div>
Code:
.item_float { float: left; margin:10px; padding:0px; text-align:center; width:160px;} .thumb_style { width: 160px; margin:0px 0px -4px 0px; padding:0px 0px -4px 0px; border: 1px solid grey; } .thumb_text { background:grey; margin:0px -2px 0px 0px; padding:0px -2px 0px 0px; color:white; }
any help appreciated.
Comment