what is the best way to construct the css floats and width size to my div layout?

This is a discussion on "what is the best way to construct the css floats and width size to my div layout?" within the Web Page Design section. This forum, and the thread "what is the best way to construct the css floats and width size to my div layout? 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 Nov 12th, 2007, 12:04
Junior Member
Join Date: Nov 2007
Location: london
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
what is the best way to construct the css floats and width size to my div layout?

Here is the layout of my Html div

HTML: Select all
<div id="wrapper"> // Main wrapper
    <div id="Content"> // Wrapper for the Header
        <div id="Logo">Logo Goes here</div>
        <div id="Header">Header goes</div>
    </div>
    <div id="NavigationContent"> //Wrapper for the Navigation
        <div id="Navigation">Navigation Goes here</div>
        <div id="SearchBar">Search Goes here</div> 
    </div>
    <div id="ContentWrapper"> // Wrapper for the Content
        <div id="MainContent">Main Content Goes HERE</div>
        <div id="RightContent">Right Content GOes HERE</div>
    </div>
    <div id="Footer">Footer Goes Here</div>
</div>
I want the overall site to be Fixed 950 pixel, with the site to be in the center. Could you please
advise me on the best way to code the css floats and the with size of my above divs.

Shall I have the main wrapper as 100% width and left and right margins to auto and then float the rest of the div to left or
is there any other best way.

Thanks for all the replies.

Ket
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 Nov 12th, 2007, 12:27
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is the best way to construct the css floats and width size to my div layout?

Give the main wrapper "margin: 0 auto" and "width: 950px".

Float the right content with "float: right" and "width: 200px" (change the width as you please).

Apply "clear: both" to the footer.

There are several variations, of course; it all depends on what exactly you wish to achieve.
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 Nov 12th, 2007, 13:11
Junior Member
Join Date: Nov 2007
Location: london
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is the best way to construct the css floats and width size to my div layout?

Thanks for your reply.. Just one more question, if I set the main wrapper to 950 px and the margins to auto. and within that say I have Content Wrapper that wraps the Main content and a Right Column Content, what floats I would apply to the Content Wrapper, Main Content and Right Column Content.

I will be floating the Main Content to "left" and Right Column Content to "Right" and the main content will 650 px and the right colume to be 300 px.

Do I float the content wrapper? and how can I make sure it only wraps the div Main Content and the div Right Column Content. I always seem to mess up my template as I go along, so just want to have a rough design guideline.

Thanks..
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 Nov 12th, 2007, 13:15
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is the best way to construct the css floats and width size to my div layout?

I would just set the width of one of your columns -- the narrower one -- and leave the other one to adjust automatically.

There's no need to float both columns (one left, one right). Just float the narrow one (which has an explicit width). Specifying a width for floats is a Good Idea.

Feel free to experiment, however!
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 Nov 12th, 2007, 13:53
Junior Member
Join Date: Nov 2007
Location: london
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is the best way to construct the css floats and width size to my div layout?

Thanks for your advise, I will be creating my base template in the evening, I will let you know if I have any problems.

Thank,
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

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
Floats... Bocaj Starting Out 1 May 28th, 2008 23:18
Fixed Width or Liquid Layout? mwdesign Web Page Design 3 May 10th, 2008 08:46
Floats don't effect the height of the their container????? chrissp26 Web Page Design 5 Sep 19th, 2007 15:38
Problem with positioning in css and floats etc Mavin Web Page Design 13 Nov 9th, 2006 13:15
js/css problem-using the width&height values obtained with js to structure my layout sanchopansa JavaScript Forum 0 Jul 21st, 2006 20:13


All times are GMT. The time now is 15:14.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42