tricky floating problems for div alignment

This is a discussion on "tricky floating problems for div alignment" within the Web Page Design section. This forum, and the thread "tricky floating problems for div alignment are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Dec 2nd, 2006, 03:20
Up'n'Coming Member
Join Date: Aug 2006
Location: California
Age: 20
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
tricky floating problems for div alignment

I have a question concerning floating, and orginizing it. From what I understand floating can be used to allow div layers to sit side by side. I got the div layers to line up all side by side by putting in the html 1 after another and floating all of them left. The html is like this if I am unclear...

{div1} float: left;
{/div1}

{div2} float: left;
{/div2}

{div3} float: left;
{/div3}

Now I know that that isnt proper syntax of course. My cliant wants the divs to be easy to work with, and to be aligned in a specific way. We came up with this picture after some planning, and I have a few questions on how to pull it off.

http://i65.photobucket.com/albums/h2...y/DSCN1202.jpg

Thats the picture. Now he wants them to use both vertical and horizontal alignment. Now whenever I add in another div and try to align it below the other divs, I can never get it to work properly. Is there any clean way where I can pull this off?

If you need a link I guess that I can put one up, but if I dont need to, I would rather hold the page off the domain untill its compleated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 3rd, 2006, 19:19
Up'n'Coming Member
Join Date: Aug 2006
Location: California
Age: 20
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: tricky floating problems for div alignment

Hey, I learned something new searching all over the internet. I figured out what the clear: both; tag is all about (I was literally jumping for joy).

I still have a question though. Now I can get them to run horizontally, then vertically. Thats no problem. But lets say I wanted to make another row of my divs. Kind of like this...


DIV1 - DIV2 - DIV3

DIV4 - DIV5 - DIV6

DIV7 - DIV8 - DIV9


Currently with the clear:both, it only allows me to do the floating once... I float 1, 2 and 3, then I clear on 4. That works perfectly, but no matter what I try, either 5-9 begin to align beside 3, or they neatly stack right under 4...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 5th, 2006, 20:11
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: tricky floating problems for div alignment

I'm just using inline CSS for simplicity here, but you'll need something along these lines:

Code: Select all
<div id="wrapper" style="width: 700px;">
    <div id="left" style="float: left;">
        <div class="box">
            <p>Recent News</p>
        </div>
        <div class="box">
            <p>Events</p>
        </div>
        <div class="box">
            <p>Products</p>
        </div>
    </div>
    <div id="right" style="float: right;">
        <div class="box">
            <p>Content</p>
        </div>
        <div class="box">
            <p>Ads</p>
        </div>
    </div>
    <div class="clear" style="width: 100%; height: 1px; margin: 0 0 -1px 0; clear: both;">
</div>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 10th, 2006, 07:30
Up'n'Coming Member
Join Date: Aug 2006
Location: California
Age: 20
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: tricky floating problems for div alignment

Exactly! Thanks very much, I was struggeling a lot to get some sort of layout like that. With that in mind, I can do even more. Thank you so much! You helped me with my new years deadline!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 10th, 2006, 09:03
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: tricky floating problems for div alignment

No problem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
float

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating <hr>s to the left/IE problems... escaflowne11 Web Page Design 5 Oct 15th, 2006 21:34
Problems floating a list, as well as some other issues! blizeH Web Page Design 7 Oct 14th, 2006 20:13
CSS Newbie: Firefox alignment problems SuperGrover1981 Web Page Design 1 Aug 31st, 2006 10:28
alignment problems joojoo Web Page Design 7 Aug 15th, 2006 08:55
floating problems... gogogadgetearl Web Page Design 0 Jul 16th, 2005 04:25


All times are GMT. The time now is 10:39.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved