1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS and Height Issue

Discussion in 'CSS' started by TwisterMc, Jan 5, 2005.

  1. #1
    I have a CSS problem. :) Check this out and see how the menu on the right is taller than the content? Well I'd like the content to be as tall as the menu. Anyone know how to fix that? I already tried wrapping everything in a DIV tag with a white background and that didn't help any.
    SEMrush
    Any suggestions?
     
    TwisterMc, Jan 5, 2005 IP
    SEMrush
  2. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would wrap the content and the right nav bar in a div and float the nav div to the right. I am also assuming that the content and the nav are each separate divs...
     
    chachi, Jan 5, 2005 IP
  3. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #3
    one idea would be to:

    Wrap the header in it's own div. Absolutely position it.

    Wrap everything else in a content div. Position the content div exactly underneath the header, so when you set the position of the menu, it's topmost point will be underneath the header.

    Another idea: Put your footer inside the menu div. Assuming the menu is always bigger than the content, you'll be fine. That and use a negative margin on it, so it will extend to the left of the menu div.
     
    nevetS, Jan 5, 2005 IP
  4. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    64
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You've got a few empty paragraphs at the beginning of the menu - don't use empty <p>'s to format your HTML - use margins and padding.

    As for your question - your menu and the content divs are absolutely-positioned and are not part of the document flow. Unless you specify height explicitly, they will *always* be different height.

    Don't use absolute elements for something as simple as this - use a bunch of containing blocks, such as divs or tables.

    J.D.
     
    J.D., Jan 5, 2005 IP
  5. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    no tables. ;) I thought this would be harder than I hoped. I'd have to re-design it. Why can't CSS just support 100% hight that worked right. Now i'm thinking of making a background image that'll repeat Y That might work too.
     
    TwisterMc, Jan 5, 2005 IP
  6. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #6
    have a look at some of the css files at www.csszengarden.com. Basically, it's hundreds of css files for the same html page so you can see all the different things you can do and how to do it. There's no tutorials, so you have to weed through the css on your own.
     
    nevetS, Jan 5, 2005 IP
  7. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    64
    Best Answers:
    0
    Trophy Points:
    0
    #7
    That was - divs or tables. You can use divs as well, although they aren't as portable as tables. Just do one big div containing content and your menu div. There's no need to use absolutely positioned elements in this layout.

    BTW, with tables, it's a 5-minute job. Think if you really want to waste all this time for no apparent benefit.

    J.D.
     
    J.D., Jan 5, 2005 IP
  8. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I have a div around everything. I just need to re-work the menu then. Humm i'll look into it. When i find time. ;)
     
    TwisterMc, Jan 6, 2005 IP
  9. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Fixed my issue, or good enough for now. I had the answer the whole time and didn't realize it. ;)
     
    TwisterMc, Jan 10, 2005 IP