tags:

views:

48

answers:

1

Take a lok at this site: http://www.naaf.no/fersking

If you hover the mouse over the three article boxes, you will see that both text and image changes.

I've placed the text in a DIV which floats above anothe div (image) with opacity set to 60%. But can anyone explain to me why the first article is approx 5px lower than the two other boxes? The first article is aligned with the bottom - it should be 5px higher up.

Here is the CSS for the text box:

#articleImageList .introText {
  background-color:#000000;
  color:#FFFFFF;
  height:50px;
  margin:0 2px;
  opacity:0.6;
  overflow:hidden;
  padding:5px 20px;
  position:relative;
  top:-75px;
  z-index:0;
}
+3  A: 

Make all your images the same size. Resize /upload/Ferskingen/COLOURBOX1021676.jpg (the image in the first article box) so it´s 440x239px (like the other images, it´s 430x239 atm).

The image makes the div.articleImage higher then the other two hence makes your position: relative; bottom: -75px; not render the result you want (but it behaves right).

Or:

remove min-width in the #articleImageList img-selector in main.css line 439.

anddoutoi
Huh, I didn't know image hight would affect it. Now I know. Thanks! :)
Steven
Seems the UA tries to keep *aspect ratio* or *constrain proportions* (to use photoshop tongue) if you only set one of the properties.
anddoutoi
I'm using max-width in order to have the image scale height and keep aspect ratio. Because the image may vary in height / width.
Steven