CSS Sidebar

Discussion in 'CSS' started by madmax728, Apr 13, 2008.

  1. #1
    How do I make a CSS sidebar? It should be on the RHS.
     
    madmax728, Apr 13, 2008 IP
  2. MoT

    MoT Peon

    Messages:
    97
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If by RHS you mean Right Hand Side then..

    css code:
    #sidebar {
    float: right;
    }

    html code:
    <div id="sidebar">
    content content content
    </div>

    Its as simple as that.
     
    MoT, Apr 14, 2008 IP
  3. madmax728

    madmax728 Banned

    Messages:
    620
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hey, thanks but I don't want the simple one. See http://www.pratee.com/ So I have put the <div id=xxx>Sidebar Content</div> On top of content. What I want is a way in which I put the sidebar content and <div> below the content but it should appear in the same position
     
    madmax728, Apr 14, 2008 IP
  4. MoT

    MoT Peon

    Messages:
    97
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    for #mainContent add
    float: left;
    put that div before sidebar and it will still work, your layout already has a br tag with clear: both; so you only need to change the #mainContent :)
     
    MoT, Apr 14, 2008 IP
  5. nexenator

    nexenator Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This should work for you:

    css code:
    #content {
    float: left;
    width:70%;
    }
    #sidebar {
    float: right;
    width:29%;
    }

    html code:
    <div id="content">
    content content content
    </div>
    <div id="sidebar">
    sidebar sidebar sidebar
    </div>

    Just edit the width parts in the css to match your site. You can use px instead of % as well...
     
    nexenator, Apr 14, 2008 IP
  6. madmax728

    madmax728 Banned

    Messages:
    620
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you MOT, nexenator
     
    madmax728, Apr 14, 2008 IP