WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

CSS3 Text


CSS3 Text

CSS3 contains a few new content features.

In this section you will find out about the accompanying content properties:

  • text-overflow
  • word-wrap
  • word-break

Browser Support

The numbers in the table determine the principal program form that completely underpins the property.

Numbers pursued by - o-determine the main form that worked with a prefix. 

Property
text-overflow 4.0 12.0 6.0 7.0 3.1 11.0
9.0 - o-
word-wrap 23.0 12.0 5.5 3.5 6.1 12.1
word-break 4.0 12.0 5.5 15.0 3.1 15.0

CSS3 Text Overflow

The CSS3 text-overflow property indicates how flooded substance that isn't shown ought to be motioned to the user.

It can be clipped:

This is some long content that won't fit in the box

or it very well may be rendered as an ellipsis (...):

This is some long content that won't fit in the box

The CSS code is as follows:

Example

p.text1 {
    void area: nowrap;
    width: 200px;
    outskirt: 1px strong hotpink;
    flood: hidden;
    content flood: cut;
}

p.text2 {
    void area: nowrap;
    width: 200px;
    outskirt: 1px strong hotpink;
    flood: hidden;
    content flood: ellipsis;
}
Try it yourself »

The following model shows how you can show the flooded substance while drifting over the element:

Example

div.text:hover {
    content flood: inherit;
    flood: visible;
}
Try it yourself »

CSS3 Word Wrapping

The CSS3 word-wrap property enables long words to most likely be broken and wrap onto the following line. 

If a word is too long to even think about fitting inside a territory, it extends outside:

This section contains a long word: thisisamemememememeongword. The long word will break and wrap to the following line.

The word-wrap property enables you to compel the content to wrap - regardless of whether it implies part it amidst a word:

This section contains an extremely long word: thisisamemememememeongword. The long word will break and wrap to the following line.

The CSS code is as follows:

Example

Allow long words to almost certainly be broken and wrap onto the following line:

p {
    word-wrap: break-word;
}
Try it yourself »

CSS3 Word Breaking

The CSS3 word-break property determines line breaking rules.

This section contains some content. This line will-break-at-hyphens.

This passage contains some content. The lines will break at any character.

The CSS code is as follows:

Example

p.text1 {
    word-break: keep-all;
}

p.text2 {
    word-break: break-all;
}
Try it yourself »