skip to Main Content

I have seen two lines written like this:

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

Or, like this:

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

Is there any difference between the two, such as for SEO or browser rendering? My guess is they are virtually the same and that the preferred placement is a matter of opinion.

5

Answers


  1. i think it’s <br/>, not <br>. And two options are the same

    Login or Signup to reply.
  2. No, it doesn’t matter. Here is a resource on the tag:
    http://www.w3schools.com/tags/tag_br.asp

    Login or Signup to reply.
  3. According to the HTML 4 spec, line breaks are treated as whitespaces.

    Note that a sequence of white spaces between words in the source
    document may result in an entirely different rendered inter-word
    spacing (except in the case of the PRE element). In particular, user
    agents should collapse input white space sequences when producing
    output inter-word space. This can and should be done even in the
    absence of language information (from the lang attribute, the HTTP
    “Content-Language” header field (see [RFC2616], section 14.12), user
    agent settings, etc.).

    And

    Line breaks are also white space characters. Note that although
    
 and 
 are defined in [ISO10646] to unambiguously
    separate lines and paragraphs, respectively, these do not constitute
    line breaks in HTML, nor does this specification include them in the
    more general category of white space characters.

    Login or Signup to reply.
  4. I would consider the location of the <br> tag a matter of preference. It is virtually the same either way. The difference will amount to a space character either before or after the <br> tag in the resulting document. I am not aware of any bearing on SEO.

    Here is a great reference:
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br

    Login or Signup to reply.
  5. I would go for the first option, It doesn’t matter which one you use. The first option suits most workflows better.
    It doesn’t matter you can use </br>, <br/> or <br>

    The placement is a matter of opinion and it don’t have anything to do with SEO

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search