CSS divs floating

  • 15 years ago

    Although I've been using CSS for styles for ages, it's only relatively recently that I've been using it for all the layout and positioning, I've finally taken the plunge and got rid of the tables...


    I'm having a spot of bother getting my divs to sit in the right place


    I'll try and explain it as concisely as possible, but forgive me if it gets a bit messy........



    I've got a couple of DIVs, one is a menu (going downwards on the left hand side) and the next is next to it, with the main page content. this is positioned relatively with its left side set to sit far enough out so that you can see the menu.


    inside this main page content DIV, on a the front page of the site, I have a DIV containing a large graphic, with another div to the right of it with some welcome explanatory text. to get these to line up like that I've put float: left; on the div with the graphic in.


    thing is, I also want two more DIVs, lined up similarly to the ones described above, underneath the ones described above.


    How can i get them to sit clear of the two above? I've tried putting clear: both; in a clearing div in between them, but that clears it to ALL divs, so it shoves it right down the page underneath where the menu finishes (the next place where it can be clear right to the edge of the browser window on both sides)



    basically i suppose, I want something like this inside my page content DIV:



    |                 |                       |
    |                 |                       |
    |                 |                       |
    |                 |                       |



    |                 |                       |
    |                 |                       |
    |                 |                       |
    |                 |                       |




    any help/links would be lovely

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves” - Alan Kay