html newline character

Release: 2019-10-25 09:48:13
Original
21715 people have browsed it

html newline character

在html源代码中对内容进行编辑,如果直接采用回车换行,那么浏览器解析的结果可能会是一个空格、或者被忽略,正确的做法是使用
标签,在html语言中,br标签定义为一个换行符,所以应将它理解为简单的输入一个空行,而不是用来对内容进行分段。

在HTML中,
没有结束标签,它是一个单标签
,连续的多个br标记可以进行多次换行,也就是说在同一个位置插入5个br标签,则会空出5行的垂直间距。

br标签通常用作对文本中的内容进行换行,当某些内容需要在新的一行显示,而如果换段又可能会导致文字间的行距较大,这个时候只需在相应的位置插入一个br换行符,就能实现文字紧凑着上一行,并且在新的一行显示。

示例:






使用换行符进行换行,
使用换行符进行换行,使用换行符进行换行。

Copy after login

效果图:

html newline character

The above is the detailed content of html newline character. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!