Results 1 to 2 of 2

Thread: Layout with Div

  1. #1
    Join Date
    Nov 2005
    Location
    Austin TX,US
    Posts
    71
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Layout with Div

    Hi I want to do the following layout with CSS - just started learning:

    Below is my code. Container is the biggest one holding everything. Content 1, 2, 3 don't line up the way I want them; instead they're pushed to the bottom of the page. Could you help me fix it?
    Thanks
    Code:
    #container { background-color:#ffffff; width:760px; border:1px solid; margin:0 auto; text-align:left; }
    #logo	   { background:url(img/top_gradient.jpg) top left no-repeat; background-color:#cfd6dc; font: 10px; color:#333333; 			
    			 text-align: right; height:51px; margin:10px 0 0 0;}
    #leftnav   { float:left; margin:0; background-color:#eeeeee; width:180px; height:705px; }
    
    #banner	   { float: left; margin:0 0 4px; height: 50px; text-align:right; }
    #content1  { float: left; margin:0 0 4px; height: 260px; text-align:right;}
    #content2  { float: left; margin:0 0 4px; height: 200px; text-align:right;}
    #content31 { float: left; margin:0 0 4px; height: 180px; width:260px; text-align:left;}
    #content32 { float: left; margin:0 0 4px 10px; height: 180px; width:260px; overflow: auto;}

  2. #2
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Mtran,

    You can use the following Css styles

    <style type="text/css">
    #container { background-color:#ffffff; width:1000px; border:1px solid; margin:0 auto; border:1px solid; text-align:left; }
    #logo { background:url(img/top_gradient.jpg) top left no-repeat; border:1px solid; background-color:#cfd6dc; font: 10px; color:#333333;
    text-align: right; height:51px; width:1000px; align:center; margin:10px 0 0 0;}
    #leftnav { float:left; margin:0; border:1px solid; background-color:#eeeeee; width:180px; height:705px; }
    #content1 { float: left; margin:0 0 4px; height: 235px; width:815px; text-align:right; border:1px solid;}
    #content2 { float: left; margin:0 0 4px; height: 235px; width:815px;text-align:right; border:1px solid;}
    #contentContainer { float: left; margin:0 0 4px; height: 230px; width:815px; text-align:left; }
    #content31 { float: left; margin:0 0 4px; height: 223px; width:430px; text-align:left; border:1px solid;}
    #content32 { float: left; margin:0 0 4px 10px; height: 223px; width:370px; overflow: auto; border:1px solid;}
    </style>

    You have to nest the div tags as given below.Content 31 and Content 32 must be placed in another div tag named as contentContainer here , so that they would be pushed to tbe bottom.

    <div id="container">
    <div id="logo">logo</div>
    <div id="leftnav">leftnav</div>
    <div id="content1">content1</div>
    <div id="content2">content2</div>
    <div id="contentContainer">
    <div id="content31">content31</div>
    <div id="content32">content32</div>
    </div>
    </div>

    Let me know if you have any doubts.

    Regards,
    Valli

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •