Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
36
rated 0 times [  39] [ 3]  / answers: 1 / hits: 132800  / 11 Years ago, tue, december 10, 2013, 12:00:00

I am trying with the following style:



.scrollDiv {
height:auto;
max-height:100%;
overflow:auto;
}


My Requirement is:




  1. max-height of div is equal to screen height

  2. If the content in the div exceeds screen size, then scroll bars should come in div.


More From » html

 Answers
9

Scroll bar appears only when content is overflown.



If max-height of your inner div is equal to the height of its container, scroll bar will never appear. if you want to see scroll bar use this.



.scrollDiv {
height:auto;
max-height:150%;
overflow:auto;
}

[#73826] Sunday, December 8, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deonkalvinw

Total Points: 409
Total Questions: 96
Total Answers: 89

Location: Saint Pierre and Miquelon
Member since Sun, Nov 27, 2022
2 Years ago
deonkalvinw questions
Sun, Feb 6, 22, 00:00, 2 Years ago
Tue, Dec 28, 21, 00:00, 2 Years ago
Sun, Aug 22, 21, 00:00, 3 Years ago
Sun, Mar 7, 21, 00:00, 3 Years ago
;