This text is really long and the height of its container is only. One possibility is that at some point overflow: hidden was applied to the button, or the button is not in the document flow (if, for instance, it's been floated). The CSS overflow property controls what happens to content that is too big to fit into an area. A JavaScript solution, instead, would imply a regular expression matching for the newline character. This guide explains the various ways in which overflowing text can be managed in CSS. andystructible That's probably going to be hard to answer, lacking context (what other styles are applied to it). This is rather difficult to achieve because CSS has no notion of lines. Here’s a big snippet with all the CSS players involved. A pure CSS solution would imply the use of a stated height for the text block and the text-overflowproperty. When a div has the attribute white-space: no-wrap, its child elements inherit the same property. 214 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 dont want other elements inside the div to behavior this way, just put the text inside a span element and move the white-space property to it. Put a border on the div and you will see it. The text-ovferflow property only affects content that overflows a block container element in direction of its inline progression which is usually right to left. To make text overflow its container, you have to set other CSS properties: overflow and white-space. There are times when a really long string of text can overflow the container of a layout.įor example: URL’s don’t typically have spaces in them, so they are often culprits. Actually, the text overflows the divs width. The text-overflow property doesn't force an overflow to occur.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |