HTML: How to create a DIV with only vertical scroll-bars for long paragraphs?
Use overflow-y. This property is CSS 3.
Use overflow-y. This property is CSS 3.
Ok if anyone else is having this problem this may be your answer: If you are trying to hide absolute positioned elements make sure the container of those absolute positioned elements is relatively positioned.
A trick that works is to position box #2 with position: absolute instead of position: relative. We usually put a position: relative on an outer box (here box #2) when we want an inner box (here box #3) with position: absolute to be positioned relative to the outer box. But remember: for box #3 to … Read more
overflow-x: hidden;
Make outer <div> to position: relative and inner <div> to position: absolute. It should work for you.
Use the .scrollHeight property of the DOM node: $(‘#your_div’)[0].scrollHeight
If you want the overflowing text in the div to automatically newline instead of being hidden or making a scrollbar, use the word-wrap: break-word property.
If you want to restrict it to one line, use white-space: nowrap; on the div.
Creating a site wrapper div inside the <body> and applying the overflow-x:hidden to the wrapper instead of the <body> or <html> fixed the issue. It appears that browsers that parse the <meta name=”viewport”> tag simply ignore overflow attributes on the html and body tags. Note: You may also need to add position: relative to the … Read more
Just add white-space: initial; to the text, a line text will come automatically in the next line.