+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: CSS Layout Help

  1. #1
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    CSS Layout Help

    How do i get this layout? I've got everything besides the little area on the left which I've circled in red.

    I've attached a file with the layout i want.


    This is my current CSS:



    body {
    margin:0;
    }


    #wrap {
    width:780px;
    margin:auto;
    float:left
    }

    #header {
    width:780px;
    height:150px;
    background:#00CCFF;
    }
    #menu {
    float:left;
    width:180px;
    background: #333;
    }
    #content {
    float:right;
    width:600px;
    }
    Attached Thumbnails Attached Thumbnails CSS Layout Help-idea-1-.jpg  

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: CSS Layout Help

    Please post minimal HTML source for the CSS to style. It's hard to develop CSS without that information.
    Last edited by misson; 08-11-2009 at 01:22 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    Re: CSS Layout Help

    <div id="wrap">
    <div id="header"><img src="heading.jpg" width="781" height="153" /></div>
    <div id="menu">
    <p>Home</p>
    <p>About</p>
    </div>
    <div id="content">
    <p>bla</p>
    </div>
    </div>

  4. #4
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: CSS Layout Help

    you could create a new div with it's own class/id and give it an absolute position of top:0px and left: 0px
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: CSS Layout Help

    The HTML structure doesn't seem to reflect all the elements in the paper prototype. In your prototype, is "Heading" an image or text? Is the circled region (the image of people) part of "heading.jpg" or something else?

    Specifying pixel dimensions (all the "width" and "height" CSS properties and HTML attributes) leads to more work down the line. Most of it is unnecessary; you can code it so the elements size themselves automatically based on content and window size.

    Oh, and don't forget to put [html], [php] or [code] tags (as appropriate) around posted source to preserve formatting, separate code from commentary and colorize the code (which can help find typos).
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  6. #6
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: CSS Layout Help

    Firstly, you might want to consider using a wider "wrap". Very few users still use an 800x600 resolution and the lowest, most common denominator is 1024x768 res.

    Assuming you want completely seperate divs rather than one header image as misson states, there are two ways you can do your layout..

    First is the simplest and probably safest.. within your header div, just add (nest) two more divs (say id's headleft and headright), the first being float-left and the same width as your menu and the second being an "auto" width (which will fill to the outside of the wrap). This first option will be easy to change in the future if you want to return to a wide header div. You might also want to reconsider your div structure for "content"... as follows...

    Code:
    <div id="wrap">
    <div id="header"> <div id="headerleft"> <img src="whatever.jpg"/> </div><!--end headerleft> <div id="headerright"> Heading image/text </div><!--end headerright--> </div><!--end header--> <div id="contentwrap"> <div id="menu"> menu links </div><!--end menu--> <div id="maincontent"> lots of text and stuff </div><!--end maincontent--> </div><!--end content--> <div id="footer">bottom stuff</div><!--end footer--><!--yes this is extra-->
    </div><!--end wrap-->
    The second, would be to start with two column div's within the wrap, and then nest horizontal cells within each column.

    Either way, all space below your menu is gonna be empty - which is why quite a few developers use a top menu bar.

    Errr.. not sure why you need float-left on your wrap?

  7. #7
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    Re: CSS Layout Help

    freecrm, I did what you said and it turns out the way i want it but the only problem now is that the content section goes under everything and is not located next to the menu.

    My CSS:

    body {
    margin:0;
    }


    #wrap {
    width:780px;
    height:auto;
    float:left;
    }

    #header {
    width:780px;
    height:150px;
    }

    #headleft
    {
    float:left;
    width:180px;
    }

    #headright
    {
    float:right;
    width:auto;
    }

    #menu {
    float:left;
    width:180px;
    background: #333;
    }
    #content {
    float:right;
    width:500px;
    }



    HTML:
    <div id="wrap">

    <div id="header">

    <div id="headleft"><img src="heading.jpg" width="180" height="153" /></div>

    <div id="headright">
    <img src="heading.jpg" width="600" height="153" />
    </div>

    </div>





    <div id="menu">
    <p>Home</p>
    <p>About</p>
    <p>Classes</p>
    <p>Location</p>
    <p>Contact</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    </div>

    <div id="content">
    <p>bla</p>
    <p>bla</p>
    <p>bla</p>
    <p>bla</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>

    </div>

    </div>



    Also i placed Float-left on the wrap because if i dont the wrap doesnt go right to the left hand side. THere is a gap. Didnt know how else to do it...

  8. #8
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: CSS Layout Help

    This is why I suggested revising your content section. lol.

    You should keep in your mind that the page should be split into major divs first.

    i.e. - wrap first

    then sub-divs header, content, footer.

    Then all other divs can fit within these. If you have a menu and maincontent, you should ideally have another container around it. Its not strictly necessary, but very helpful. If you check out my first post, you'll see the differnce between contentwrap and maincontent.

  9. #9
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    Re: CSS Layout Help

    Thanks a lot freecrm. It looks just how i wanted it!
    Last edited by focus; 08-18-2009 at 07:07 AM.

  10. #10
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    Re: CSS Layout Help

    Unfortunately i ran into another problem. I'm just wondering why does this happen?
    I want the Menu to go all the way down to the bottom....


    Code:

    <div id="contentwrap">
    <div id="menu">
    <p>Home</p>
    <p>Session Times</p>
    <p>Fees</p>
    <p>Upcoming Events</p>
    <p>News</p>
    <p>Contact</p>
    </div>

    <div id="maincontent">
    <p>&nbsp; </p>
    </div> <!--end maincontent-->
    </div><!--end content-->
    Last edited by focus; 08-25-2009 at 01:29 AM.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Problem with two column CSS layout and tables
    By gottaloveit in forum Graphics & Webdesign
    Replies: 1
    Last Post: 04-24-2008, 04:19 PM
  2. [REQ] Web 2.0 Layout need
    By Brandon in forum The Marketplace
    Replies: 0
    Last Post: 06-19-2007, 02:37 PM
  3. Replies: 2
    Last Post: 12-16-2006, 08:59 PM
  4. {req} Layout + Members Login Area
    By SEŅOR in forum The Marketplace
    Replies: 8
    Last Post: 04-29-2006, 02:59 PM
  5. (req) Layout
    By SEŅOR in forum The Marketplace
    Replies: 34
    Last Post: 03-01-2006, 07:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers