Reputation: 2355
I type long string in div
or span
tag whenever i maximise the window (any browser) , it perfectly matches the div tag but when i minimise it or compress the browser width then text coming out of div area . I just want to know how to set long text in a div area either stretched or compressed . I tried ellipsis
, white-space:nowrap
.. nothing result i found .
Is there any other solution for it ?
screen ex: When i compressed the browser width.
Upvotes: 2
Views: 816
Reputation: 9469
I hope you want something like this:
CSS:
div {
// Div Styles Without Fixed Width and Height
background: #ccc;
padding: 20px;
border: 1px solid #666;
}
If you are using fixed height for <div>
then you must define either a css property overflow:auto
(for scrollbar to appear while content varies), or overflow:hidden;
(to hide the text varies)
Upvotes: 1