Ticker

6/recent/ticker-posts

Why don't use 'lb' & why use 'br' for html line break break tag

 

Why don't use 'lb' & why use 'br' for html line break break tag

The <br> tag in HTML stands for "line break" and is used to insert a single line break or newline within a block of text. It doesn't require a closing tag and is considered an empty element.

            Here's an example of how you can use the <br> tag:

                <p>This is the first line.<br>

                  This is the second line.</p>

.In the example above, the <br> tag is placed after the first line of text within the paragraph (<p>) element. When the HTML is rendered in a browser, it will display the text on two separate lines:

                This is the first line.

                This is the second line.

The <br> tag is useful for creating simple line breaks, but it's generally recommended to use CSS for more complex layout and spacing purposes.

why donot use 'lb' & why use 'br' for html line break ?

The choice of the tag name "br" for the HTML line break element was made early on in the development of HTML, and it has been maintained for compatibility and historical reasons. The decision to use "br" instead of "lb" (which could stand for "line break") is likely due to a combination of factors:

  1. Simplicity and brevity: HTML aims to have a concise and straightforward syntax. The shorter tag name "br" is more straightforward and easier to remember than "lb." It helps keep the markup clean and reduces the potential for typing errors.
  2. Backward compatibility: HTML has evolved over time, and maintaining backward compatibility with older versions and existing web content is crucial. Changing the tag name from "br" to "lb" could have caused compatibility issues and required significant updates to existing HTML documents.
  3. Existing conventions: The choice of "br" as the tag name for line breaks may also be influenced by existing conventions and practices in related programming and markup languages. Similar line break or newline concepts in languages like C, C++, Java, and JavaScript use the "br" convention.

While "lb" could have been an alternative choice for representing a line break, the continued use of "br" in HTML is rooted in historical reasons, simplicity, and backward compatibility considerations.

⬇️⬇️Video tutorial ⬇️⬇️





Post a Comment

0 Comments