Home>Article>Web Front-end> How to set css to exceed automatic line wrapping

How to set css to exceed automatic line wrapping

青灯夜游
青灯夜游 Original
2021-04-13 15:45:02 48755browse

How to set css beyond automatic line wrapping: 1. Use the "word-break: break-all;" style, based on letters, to force automatic line wrapping; 2. Use "word-wrap: break-word;" "Style, based on words, forces automatic line wrapping.

How to set css to exceed automatic line wrapping

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

In HTML, when div, p, h tags, etc. encounter a continuous large block of English and numbers, they will not automatically wrap according to the box width limit under normal circumstances. So how to set beyond automatic line wrapping in cssz?

In CSS, you can useword-wrap: break-word;orword-break:break-all;to force English to wrap.

  • word-break: break-all;Sets forced automatic line wrapping of text, but only works in English, using letters as the basis for line wrapping.

  • word-wrap: break-word;Sets forced automatic line wrapping of text, but only works in English, using words as the basis for line wrapping.

Example:

     

This paragraph text. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

This paragraph text. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

This paragraph text. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Rendering:

How to set css to exceed automatic line wrapping

(Learning video sharing:css video tutorial)

The above is the detailed content of How to set css to exceed automatic line wrapping. 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