12

break line tag is not working in firefox, neither in chrome. When i see the source of my page i get:

<p>Zugang zu Testaccount:</br></br>peter petrelli </br></br>sein Standardpwd.</br></br>peter.heroes.com</p>

However when i do view selected source, i get:

<p>Zugang zu Testaccount: peter petrelli  sein Standardpwd. peter.heroes.com</p>

It seems firefox is filtering break line tags out.

It works in IE7 fine.

Dana
  • 28,425
  • 17
  • 58
  • 72
Sergio del Amo
  • 71,609
  • 66
  • 148
  • 177

12 Answers12

66

You're looking for <br /> instead of </br>

Self closing tags such as br have the slash at the end of the tag.

Here are the other self-closing tags in XHTML:

Community
  • 1
  • 1
Jason Navarrete
  • 7,145
  • 5
  • 24
  • 22
13

If you are trying to put space between two divs and <br/> is not working then insert this code (between the divs) to get the <br/> tag working.

<div class="clear"></div>

and add

.clear {
    clear: both;
}

in your css file.

Kunal Kumar
  • 779
  • 9
  • 10
11

The br tag should be:

<br/>
Alaa
  • 115
  • 12
andyuk
  • 34,840
  • 15
  • 49
  • 52
11

It should be <br> or <br /> not </br>

curtisk
  • 18,798
  • 4
  • 50
  • 68
6

IE7 is more forgiving of incorrect syntax in quirksmode.

Instead of <br> or </br> it should be <br />

Adam Kinney
  • 1,065
  • 7
  • 5
3

That's because </br> is an invalid tag. What you want is <br />.

Dan
  • 31
  • 2
1


should probably be used only if you are writing XHTML. If you use validator.w3.org to validate the following as HTML 4.01:

<html>
<head>
<title></title>
</head>
<body>
<p>
<br />
</p>
</body>
</html>

This warning is generated:

Line 8, Column 3: NET-enabling start-tag requires SHORTTAG YES.

<br />

The sequence can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag '). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.

Grant Wagner
  • 23,293
  • 6
  • 50
  • 60
0

It should just be <br>.

nsanders
  • 10,872
  • 2
  • 37
  • 46
0

You want <BR> or <BR />, not </BR>

moonshadow
  • 75,857
  • 7
  • 78
  • 116
0

If you are using struts set escapeXml="false"

0

It’s not </br>, it’s <br> or <br />.

So, this doesn’t work as expected:

<!doctype html>
<html>
 <head>
  <title></title>
 </head>
 <body>
  <p>
   Some text... </br>
   Some more text...
  </p>
  More content...
 </body>
</html>

But this works:

<!doctype html>
<html>
 <head>
  <title></title>
 </head>
 <body>
  <p>
   Some text... <br>
   Some more text... <br />
  </p>
  More content...
 </body>
</html>
-3

Alternatively to <br /> or <br> you can use <p></p> or </p>

Tim Stack
  • 3,080
  • 2
  • 14
  • 32