Ryan
Ryan

Reputation: 3

div overflow right

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?

Upvotes: 0

Views: 2422

Answers (2)

MikeSmithDev
MikeSmithDev

Reputation: 15797

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>

Upvotes: 2

user1726343
user1726343

Reputation:

Try white-space:nowrap. That way the content won't wrap to a new line.

div{
    overflow:hidden;
    white-space:nowrap;
    width:100px;
}

Upvotes: 3

Related Questions