Home  >  Article  >  Web Front-end  >  How to set div beyond line wrap in css

How to set div beyond line wrap in css

WBOY
WBOYOriginal
2021-11-19 14:38:587819browse

In CSS, you can use the "word-break" attribute to achieve the div beyond line break effect. This attribute allows the div content to automatically wrap at the end. The syntax is "div{word-break:break-all;} ".

How to set div beyond line wrap in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to set div beyond line wrapping in css

In css, you can use the word-break attribute to specify the processing method of automatic line wrapping.

By using the word-break attribute, the browser can achieve a line break at any position.

The syntax is:

word-break: normal|break-all|keep-all;

It should be noted that:

  • normal means using the browser’s default line wrapping rules.

  • #break-all indicates that line breaks are allowed within words.

  • #keep-all means line breaks can only be made at half-width spaces or hyphens.

Let’s take an example to see how to set the div beyond the new line. The example is as follows:




    
    
    
    Document

aaaaaaaaaaaaaaaaaaaaaaaaaaaa

Output result:

How to set div beyond line wrap in css

For more programming-related knowledge, please visit: Programming Video! !

The above is the detailed content of How to set div beyond line wrap in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn