Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html show scroll only if bigger than max-height

Tags:

html

css

I wanna show scroll only if is bigger than max-height. But it seems the scroll is always enable

<div style="text-align: left; font-size: 1.5rem; max-height: 7rem; overflow-y: auto;">
  Some text
</div>

image example in my case

enter image description here

like image 734
travis_911 Avatar asked Oct 18 '25 16:10

travis_911


1 Answers

Use vh rather than using rem which is meant for font-size not for relative height:

Unit-Reference

div {
  text-align: left;
  font-size: 1.5rem;
  max-height: 10vh;
  overflow-y: auto;
  border: 1px solid red;
}
<div>
  Some text Before Oracle9 if I had "select any table" privileges there was no problem doing so. ... allow direct access to the v$ tables, do not allow access by stored procedures ... I don't think O7_DICTIONARY_ACCESSIBILITY provides access to sys.link$
  ... Before Oracle9 if I had "select any table" privileges there was no problem doing so. ... allow direct access to the v$ tables, do not allow access by stored procedures ... I don't think O7_DICTIONARY_ACCESSIBILITY provides access to sys.link$ ...
  https://jsfiddle.net/Manju06/3zshy8r0/34/ Before Oracle9 if I had "select any table" privileges there was no problem doing so. ... allow direct access to the v$ tables, do not allow access by stored procedures ... I don't think O7_DICTIONARY_ACCESSIBILITY
  provides access to sys.link$ ...
</div>
like image 147
Manjuboyz Avatar answered Oct 20 '25 07:10

Manjuboyz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!