Div header problem

Hi there, I’m running into a problem, I don’t have the actual website up online but its pretty straight forward. I have a header that consists of 2 cropped images. They go left to right, then the navigation underneath. The problem that I’m running into is trying to have them both on the same line side by side, but it keeps fighting me. I’m trying to stay away from tables, so I’m using divs, I’m not really sure what I could do, maybe put them in a list or what would you think work best? thanks for any help.

Not quite sure I follow. You applied #header img to both of them? What does that mean? Do you mean you applied float:left to both? If so, then yes that’s fine (though if you have more images in the header in the future then you would need to edit it :slight_smile:

Depends on how your HTML is structured, if the two divs you just floated are contained with a parent, all the parent needs is overflow:hidden (and if you are supporting IE6, then a haslayout mechanism like zoom:1)

If no such parent exists, then yes a clear:both will be needed to make sure it doesn’t snag :slight_smile:

Edit-Both need to be floated (not technically but just float both), but I thought you siad these were <div>'s and not <span>'s ?

Just set them to float:left and they will be side by side :). Floating gets elements lined up next to each other.

thanks, then underneath for the navigation div, would i have to do something like clear: both, or no? also im wondering for the images, would i put them in span tag and set a class to float:left for both or just the one?

yea i have them contained in a div.

i got the #header div, which both are inside, then I applied #header img to both of them, would that be considered correct practice for css?