Snippets tagged “white-space”
12 snippets use this tag.
- How Not to Wrap the Contents of <p>, <div>, and <span> ElementsHTML
In this snippet, we want to demonstrate how you can make the contents of the <p>, <div>, and <span> elements not to wrap. Use the CSS white-space property.
- How to Add a Fixed Width Column with CSS FlexboxCSS
On this page, you will find out how to add a fixed-width column with the help of CSS Flexbox. To achieve this, you need to use the flex or flex-basis property.
- How to Add Line Break Before an Element with CSSCSS
In this tutorial, we’re going to show some ways of adding a line break before an element. For that, use the white-space property and ::before pseudo-element.
- How to Break Line Without Using <br> Tag in CSSCSS
There are a few ways to break a line without using a <br> tag. For that, we can use the white-space and display properties, as well as pseudo-elements.
- How to Disable Word Wrapping in HTMLHTML
In this snippet, we’re going to demonstrate how you can disable word wrapping. For that, use the white-space property either with the “nowrap” or “pre” value.
- How to Force the Content of the <div> Element to Stay on the Same LineHTML
In this snippet, we’ll demonstrate how to force the content of the HTML <div> element to stay on the same line. Use the overflow and white-space properties.
- How to Limit the Text Length to One Line with CSSCSS
In this snippet, you can find out how to limit the text length to one line by clipping the line, adding an ellipsis or strings. Use the text-overflow property.
- How To Make CSS Ellipsis Work on a Table CellCSS
This tutorial will help you to make CSS ellipsis work on a table cell. To achieve this goal, you can use some CSS properties which are demonstrated on this page.
- How to Make the CSS overflow: hidden Work on a <td> ElementCSS
In this tutorial, we’ll demonstrate how to use the CSS overflow property with its “hidden” value on the HTML <td> element. Read the tutorial and find examples.
- How to Render an HTML String Preserving Spaces and Line BreaksHTML
In this tutorial, you can learn how to render an HTML text preserving spaces and line breaks. You need to use the HTML <pre> tag or the CSS white-space property.
- How to Wrap Text in a <pre> Tag with CSSCSS
The <pre> tag inserts a preformatted text into an HTML document. Since the <pre> tag doesn’t support wrapping, we’ll show how to do it with the help of CSS.
- How to Wrap Words in a <div> Tag with CSSCSS
If you’ve faced the situation when you need to wrap long words in a <div>, use the white-space property with the “pre-wrap” value and word-wrap property.