Is there away to change the default behavior of a div so that overflow:hidden causes the content to overflow out the right side of a div, rather than out of the bottom of the div?
-
1look at how to use overflow-x and overflow-y in CSS.Diodeus - James MacFarlane– Diodeus - James MacFarlane2012-11-20 16:40:35 +00:00Commented Nov 20, 2012 at 16:40
-
@Diodeus Those properties have nothing to do with his problem.user1726343– user17263432012-11-20 16:44:05 +00:00Commented Nov 20, 2012 at 16:44
Add a comment
|
2 Answers
Try white-space:nowrap. That way the content won't wrap to a new line.
div{
overflow:hidden;
white-space:nowrap;
width:100px;
}
1 Comment
Ryan
Ah, thank you! Exactly what I needed. Thanks so much. (I can't up-vote yet because I don't have a high enough reputation.)
Yes. Have the text not wrap:
<div style="width:100px;height:30px; overflow:hidden; white-space:nowrap;">
Is there away to change the default behavior of a div so that
overflow:hidden causes the content to overflow out the right side
of a div, rather than out of the bottom of the div?
</div>