Home > Web Front-end > CSS Tutorial > How to set CSS non-line wrapping style and CSS line wrapping style? (Case)

How to set CSS non-line wrapping style and CSS line wrapping style? (Case)

云罗郡主
Release: 2018-10-20 14:03:07
Original
4215 people have browsed it

When many novices learn CSS, they are always confused about the difference between CSS non-line wrapping style and CSS line wrapping style. How to set up CSS non-line wrapping style and CSS line wrapping style area? Let’s take a look at it through examples.

How to set CSS non-line wrapping style and CSS line wrapping style? (Case)

css non-line wrapping style and CSS line wrapping style can be set through div, and the text can be styled through css style.

1: Settings and methods of CSS line break style

1. In the css style, we can use the
tag for line break,
As long as we add a line break tag where a line break is required, the text can be wrapped, for example:

<body>
php中文网<br />
学习是最好的投资<br />
学习php<br />
</body>
Copy after login

2. The css style can also achieve large line breaks, if we want If we want to have a large line break in the article and display it in sections, we can use

, but first we need to understand the usage of the

tag. The code is as follows:

<html>
<head>
<title>实现分段和大换行</title>
</head>
<body>
Copy after login
<h1><p>标签的使用</h1></h1>
<p>这是一个段落。</p>
<p>这是另外一个段落。</p>
</body>
</html>
Copy after login

3. Another way is to set the css to customize the height and width. We can set a css style in the div to wrap it. Many programmers will encounter word-wrap:break-word when making websites. If this problem occurs, we can use a custom method to wrap the line, or implement forced line wrapping, as long as we add the width to the div. Can.

2: css non-line wrapping style

css non-line wrapping style can use nowrap to force all text to be displayed in one line until br is encountered.

The above is how to set the CSS non-line wrapping style and CSS line wrapping style? (Case) full introduction, if you want to know more about CSS video tutorial, please pay attention to php Chinese website.


The above is the detailed content of How to set CSS non-line wrapping style and CSS line wrapping style? (Case). For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template