Home Web Front-end HTML Tutorial Summarize various line wrapping methods in html and css

Summarize various line wrapping methods in html and css

Jun 06, 2017 am 11:15 AM

In web development, you can use the br tag in HTML to wrap lines. If you are in an article, you can add <br /> to the place where the article needs to wrap to achieve automatic line wrapping - often There is no gap between the small line break mentioned and before the line break; use the <p> tag to achieve a large line break. You can also use css attributes to implement automatic line wrapping and forced line wrapping. Use css to wrap consecutive English letters and numbers. If you encounter the article title list style and hope not to wrap, you can also use css style attributes to perform some control. This article is to talk about various line breaks in html and css.

You can first learn free courses related to php Chinese website

1. Study"HTML Development Manual"##<br>tags and <p>tags in # Related tutorials

html 开发手册

2. Study

"CSS 3.0 Reference Manual" Various line break properties

CSS 3.0参考手册

html, line breaks in css

1.

How to deal with css overflow and line breaks

Line breaks,

Note: Only valid for English

a. Long word wrap

word-wrap:

normal: Default, using the browser's default form, without destroying the word structure

break-word: break the structure of the word

b, text line break

word-break:

Value:

normal:

break-all: Destroy the word structure for line break

keep-all: Break line under the space in half-width state

2.

css control forced line break Solution

Under normal circumstances, elements have the default white-space:normal (automatic line wrapping, white-space:nowrap if not line wrapping). When the entered text exceeds the defined width, it will automatically wrap. But when the entered data is a bunch of characters or letters or numbers without spaces (regular data should not be there, but some testers will do it this way), when the width of the container is exceeded, the container will be expanded. Line break.

3.

Introduction to paragraph layout and line wrapping methods of HTML web pages

The appearance of a web page depends largely on its layout. When large paragraphs of text appear on the page, they are usually planned in paragraphs, and line breaks are also divided very strictly. This section starts with the detailed settings of paragraphs, so that readers can use tags to handle large paragraphs of text freely after learning.

4.

How to implement forced line breaks or non-line breaks in DIV, td, p and other containers in html

normal: According to text in Asian languages ​​and non-Asian languages Rules that allow line breaks within words

break-all : This behavior is the same as normal for Asian languages. Breaks within any word of a line of non-Asian language text are also allowed. This value is suitable for Asian text that contains some non-Asian text
keep-all : Same as normal for all non-Asian languages. For Chinese, Korean, and Japanese, word breaks are not allowed. Suitable for non-Asian text syntax that contains a small amount of Asian text: word-wrap : normal | break-word

5.

CSS3 Text line break

Text line break is actually a very common but An inconspicuous feature. You don’t need to set anything, the browser will automatically wrap the line. For example, in English, the browser will choose to wrap lines at half-width spaces or hyphens based on the container size. For example, in Chinese, the browser will choose to wrap the text or punctuation marks. But sometimes when encountering long words or URLs, the browser is not so smart, and the container will burst, which is ugly.

Related Questions and Answers

1.

How to wrap the text displayed when the mouse hovers over the title?

2.

How to wrap the string returned in the angular filter

2. css English paragraph line wrapping, word truncation

[Related recommendations]

1. PHP Chinese website free video tutorial: 《php.cn Dugu Jiujian (2) - CSS video tutorial"

2. PHP Chinese website free tutorial: "Learn HTML+CSS at your fingertips"

The above is the detailed content of Summarize various line wrapping methods in html and css. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

Nested Table in HTML

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Table Border in HTML

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

HTML margin-left

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

HTML Table Layout

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Moving Text in HTML

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

HTML Ordered List

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

HTML onclick Button

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

How do you parse and process HTML/XML in PHP?

See all articles