jlisec01 — 2010-06-01T14:48:04-04:00 — #1
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.
ryanreese — 2010-06-01T18:27:13-04:00 — #2
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
ryanreese — 2010-06-01T15:38:47-04:00 — #3
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
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 ?
ryanreese — 2010-06-01T15:09:17-04:00 — #4
Just set them to float:left and they will be side by side :). Floating gets elements lined up next to each other.
jlisec01 — 2010-06-01T15:12:03-04:00 — #5
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?
jlisec01 — 2010-06-01T16:54:38-04:00 — #6
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?