Home > Web Front-end > HTML Tutorial > How to disallow line breaks in enclosed text in HTML?

How to disallow line breaks in enclosed text in HTML?

PHPz
Release: 2023-09-08 17:01:05
forward
1579 people have browsed it

How to disallow line breaks in enclosed text in HTML?

Use the tag to allow enclosed text in HTML to not break. The HTML tag instructs the browser not to corrupt specified text.

This is used in conjunction with the tag, which will advise the extension browser when it can insert a newline character in an unbreakable sequence. text. Unlike the
tag, which always causes a line break even within the segment of a - tag, the tag only occurs when placed within a content segment of a - tag Works and only causes a line break if the current line has exceeded the browser's bounds. Show window margins.

Example

You can try running the following code to allow enclosed text in HTML to not break -

<!DOCTYPE html>
<html>
   <head>
      <title>HTML nobr Tag</title>
   </head>
   <body>
      <nobr>This is a very long sequence of text that is forced to be
      on a single line, even if doing so causes <wbr />

      the browser to extend the document window beyond the size of the
      viewing pane and the poor user must scroll right <wbr />

      to read the entire line.
      </nobr>
   </body>
</html>
Copy after login

The above is the detailed content of How to disallow line breaks in enclosed text in HTML?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
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