CSS help - Adding content under a DIV?

Discussion in 'CSS' started by gorepitdotnet, Feb 15, 2009.

  1. #1
    My website: http://www.gorepit.net/

    Okay, I really want to add content under my menu div, but I am stuck!

    If this helps this is my style.css:

    .leftcontent { position: absolute;
    left:10px;
    top:150px;
    width:140px;
    background:#0d0d0d;
    float: left;
    border:1px solid #1a1a1a;
    }
    
    .centercontent {
        top:100px;
        background:#0d0d0d;
        margin-left:147px;
        margin-right:147px;
        border:1px solid #1a1a1a;
    }
    
    body .centercontent {
        margin-left:160px;
        margin-right:121px;
    }
    
    #banner {
        background:#000000 url();
        background-repeat:repeat;
        height:141px;
        border-top:0px solid #000000;
        border-right:0px solid #292d24;
        border-left:0px solid #292d24;
    }
    
    Code (markup):
    Okay, the leftcontent is my menu and the center content is just the content of my website.

    I would really like to add content underneath my menu, but what ever I do it just goes underneath my menu so you cannot see it, and its in the wrong place.

    I have tried using classes and then just using another <div class="leftcontent"> underneath, but it just overlaps the first div.

    If someone could help me out, it would be really great!!
     
    gorepitdotnet, Feb 15, 2009 IP
  2. ExtremeData

    ExtremeData Well-Known Member

    Messages:
    450
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    125
    #2
    If you have used <div class="leftcontent"> that's incorrect.
    The leftcontent I see is ID not a class.So use <div id="leftcontent">.I have not tested yet but I think it works.
    If you want you can try to add a new <div> or a new <p> into the leftcontent div (above the <br/> tag - line 83).
     
    ExtremeData, Feb 16, 2009 IP
  3. ranacseruet

    ranacseruet Peon

    Messages:
    302
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try positioning absolute & then left , right margin etc...
     
    ranacseruet, Feb 16, 2009 IP
  4. gorepitdotnet

    gorepitdotnet Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What do you mean by that? What am I positioning? :)
     
    gorepitdotnet, Feb 17, 2009 IP
  5. ExtremeData

    ExtremeData Well-Known Member

    Messages:
    450
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    125
    #5
    You have tried to <div id="leftcontent"> not <div class="leftcontent"> ?
     
    ExtremeData, Feb 17, 2009 IP
  6. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You've positioned your left column and floated it left? Why not just float it left there is no need to be positioning it's best to stay away from.

    Anyways if your going to keep this div positioned then you need to position your new DIV below it (e.g position: absolute; left: 10px; top:200px < change to height of left column). If you're going to float it then it will be floated underneath as part of the left column.
     
    wd_2k6, Feb 17, 2009 IP