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.
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>
2. The css style can also achieve
, but first we need to understand the usage of the
tag. The code is as follows:
<html> <head> <title>实现分段和大换行</title> </head> <body>
<h1><p>标签的使用</h1></h1> <p>这是一个段落。</p> <p>这是另外一个段落。</p> </body> </html>
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!