HTML & CSS
New to the forum and relatively new to HTML and CSS, so signed up cause I'm having a bit of a problem with some DIVs moving around as the browser window is extended or made smaller. Can't post too much of the code as this is for a class assignment but should hopefully be enough to give you an idea of the problem.
These two elements appear next to each other, but the 'logoheader' div basically slides underneath the 'logo' div when the window is made smaller, and slides too far to the right of the 'logo' div when the window is extended to full size. Is there any way to fix these divs in one place or perhaps combine them into one div?
Hi ThorntonStuart. Welcome to the forums.
Normally, you'll want to place these floated elements inside a container that has a set width (or perhaps instead a max-width and min-width) and is perhaps centered on the screen. Otherwise, elements that are just floated and scattered all over the screen will move around all over the place depending on the width of the browser window etc.
Make sure to post your HTML too when asking layout questions, because CSS on its own is out of context.
Ahh okay. Yeah for this layout I didn't include a container for the entire layout, so can I create a container solely for these elements to keep them in the right position or are you referring to a container for the entire layout? I'll try out the max/min-widths first though, thanks!
You can do either ... and it's also quite normal to do both.
Ahh great, I'll give it a shot! Thanks!
This topic is now closed. New replies are no longer allowed.