CSS Content Pages

Discussion in 'HTML & Website Design' started by kc3, Aug 20, 2009.

  1. #1
    So when I use CSS divs for my content, I extend it to be 100% in height however when the page content is longer than the div the page doesn't scroll down, how do I fix this? And how can I make a div as long as the content but also fill in the whole length of the page?
     
    kc3, Aug 20, 2009 IP
  2. kc3

    kc3 Peon

    Messages:
    857
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    No ideas? btw, I didn't notice there was a css sub-forum until now, can someone move it?
     
    kc3, Aug 21, 2009 IP
  3. TurkeyEater

    TurkeyEater Active Member

    Messages:
    264
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Its kind of hard to understand what you are talking about. Are you trying to make a part of your page have a scroll bar to cover your overflow content? Or are you trying to make your div container dynamic with the length of your content?
     
    TurkeyEater, Aug 21, 2009 IP
  4. kjb

    kjb Greenhorn

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    If you want your css content to scroll only when it reaches the max height then the CSS must have overflow:auto; in the css. However, if you mean you want the height of the div to adjust to the content text then remove the height attribute entirely.
     
    kjb, Aug 21, 2009 IP
  5. Tressley

    Tressley Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Going on what KJB said, but just clearing it up, you'll want your code to look something like this:

    This will give the DIV the full height of the window and make it so that the content is scrollable.
    
    div {
         height: 100%;
         overflow: auto;
    }
    
    Code (markup):
    If you want the DIV to not hide any of the content, remove the height attribute from the CSS and HTML code.
     
    Tressley, Aug 21, 2009 IP
  6. kc3

    kc3 Peon

    Messages:
    857
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hm... The page is still not scrollable though, and if I do that than the div itself is scrollable but for some reason won't scroll the entire content. *Even* if I remove the height attribute.

    Just to clarify any contents in the div just runs off, it shows it, my browser just doesn't scroll to it.
     
    kc3, Aug 22, 2009 IP
  7. DesignSamples

    DesignSamples Banned

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    that means you have a height attribute set at a fixed dimension...

    A container <div> apparently has

    so the overflow is overlapping therefore not scrollable.

    check your css - I bet it is a simple oversight... :)
     
    DesignSamples, Aug 22, 2009 IP
  8. kc3

    kc3 Peon

    Messages:
    857
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It is that way HOWEVER if I change it-it's still the same issue, I did notice it looks totally different in IE so I'm going to examine more.
     
    kc3, Aug 24, 2009 IP
  9. 1 FineLine

    1 FineLine Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    can you provide a link to the page where you're experiencing the problem?
     
    1 FineLine, Aug 24, 2009 IP
  10. kc3

    kc3 Peon

    Messages:
    857
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Fixed it, a few divs I was having issues with I just replaced with tables and everything looks and acts fine now, now idea but since it was having one problem in one browser and another in another browser I think it could have been very much browser related, hm... Either way, site looks fine now, and it's on my computer with Apache sooo it's not online at the moment
     
    kc3, Aug 24, 2009 IP