Pages

Monday, March 25, 2013

Add Scrolbar only if content present

If you have an element whose content has to scroll only when it exceeds a particular width/height you can do so by assigning an id or class with the following css properties so that the scrollbar will appear only if the height exceeds the threshold value.

.noscroll {
  width:150px;
  height:150px;
  overflow: auto; 
}

No comments: