Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2010
    Location
    Earth
    Posts
    305
    Thanks
    27
    Thanked 2 Times in 2 Posts

    css border not working

    I have a 2 column layout that changes based on info user selects, it is dynamic.

    I have a border running down left side of the right column and it looks good when there is equal the amount of info in both column, however the problem is when there is less info in the right column then the line is to short.

    I've switched it around and still have the same issue becuase the length of each column is based on what a user selects.

    Can anyone give me some suggestions as to what to do to help this??

    here is the code

    Code:
      <style type="text/css">
    
    #container
    {
    width: 90%;
    margin: 10px auto;
    background-color: #fff;
    color: #333;
    border: 1px solid gray;
    line-height: 130%;
    }
    
    #top
    {
    padding: .5em;
    background-color: #ddd;
    border-bottom: 1px solid gray;
    }
    
    #top h1
    {
    padding: 0;
    margin: 0;
    }
    
    #leftnav
    {
    float: left;
    width: 160px;
    margin: 0;
    padding: 1em;
    }
    
    #content
    {
    margin-left: 200px;
    border-left: 1px solid gray;
    padding: 1em;
    max-width: 36em;
    }
    
    #footer
    {
    clear: both;
    margin: 0;
    padding: .5em;
    color: #333;
    background-color: #ddd;
    border-top: 1px solid gray;
    }
    
    #leftnav p { margin: 0 0 1em 0; }
    #content h2 { margin: 0 0 .5em 0; }
      </style>
    
    
    
    HTML CODE
    <div id="container">
    <div id="top">
    <h1>Header</h1>
    </div>
    <div id="leftnav">
    <p>
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut.
    </p>
    </div>
    <div id="content">
    <h2>Subheading</h2>
    
    
    </div>
    <div id="footer">
    Footer
    </div>
    </div>

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    Hello harkly,
    The easiest way to get a border down the middle that works no matter which column has more content would be the "faux columns" method of using a background image. Look at this example of faux columns.
    Google faux columns for a bunch more examples.

    Here's another way to do it.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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