Forum Moderators: not2easy

Message Too Old, No Replies

div content overflow control

What is the correct syntax?

         

Matthew1980

9:39 pm on Mar 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there people of the CSS forum,

<div style="overflow:auto;">

I know as this is incorrect syntax, I am hoping to achieve a div that I am using to show preview comments, and instead of the page getting longer, I am sure that there is an attribute along the lines of overflow that allows the use of a slider to view more content. I think that a height has to be defined to the div or it won't function.

I am a little confused and as I cant for the life of me remember the relevant wording I would appreciate a nudge in the right direction.

Cheers,

MRb

meelosh

12:10 am on Mar 5, 2010 (gmt 0)

10+ Year Member



if i think i know what it is you are trying to do set the dimensions of the div container to the size you want visible and then do overflow:scroll; it will hide anything outside the dimension but allow you to scroll through the content.....hope i understood what you were asking
cheers

Matthew1980

12:57 pm on Mar 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there meelosh,

Thats exactly what I was after, I just couldn't remember the syntax.

Thanks,
MRb

meelosh

4:30 pm on Mar 5, 2010 (gmt 0)

10+ Year Member



glad i could help

Auciker

12:38 am on Mar 6, 2010 (gmt 0)

10+ Year Member



Always define what direction you want overflow, otherwise you're likely to get it in both directions.

height:100px;
overflow-x:none;
overflow-y:scroll;