0

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?

2
  • 1
    look at how to use overflow-x and overflow-y in CSS. Commented Nov 20, 2012 at 16:40
  • @Diodeus Those properties have nothing to do with his problem. Commented Nov 20, 2012 at 16:44

2 Answers 2

3

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

div{
    overflow:hidden;
    white-space:nowrap;
    width:100px;
}
Sign up to request clarification or add additional context in comments.

1 Comment

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.)
2

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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.