Sergio del Amo
Sergio del Amo

Reputation: 78106

</br> not working in firefox and chrome

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.

Upvotes: 13

Views: 91217

Answers (13)

Ramratan Gupta
Ramratan Gupta

Reputation: 1086

For me CSS was an issue.

For this tag display: none; was used so <br> tag was not rendering.

Upvotes: 0

UserName Name
UserName Name

Reputation: 313

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>

Upvotes: 0

Arun Chandra
Arun Chandra

Reputation: 11

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

Upvotes: -2

Thushara Buddhika
Thushara Buddhika

Reputation: 1

If you are using struts set escapeXml="false"

Upvotes: -1

andyuk
andyuk

Reputation: 39108

The br tag should be:

<br/>

Upvotes: 11

Kunal Kumar
Kunal Kumar

Reputation: 1149

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.

Upvotes: 16

Grant Wagner
Grant Wagner

Reputation: 25931


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.

Upvotes: 1

Jason Navarrete
Jason Navarrete

Reputation: 7521

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:

Upvotes: 67

Adam Kinney
Adam Kinney

Reputation: 1075

IE7 is more forgiving of incorrect syntax in quirksmode.

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

Upvotes: 6

curtisk
curtisk

Reputation: 20175

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

Upvotes: 11

Dan
Dan

Reputation: 31

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

Upvotes: 3

moonshadow
moonshadow

Reputation: 89085

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

Upvotes: 0

nsanders
nsanders

Reputation: 12636

It should just be <br>.

Upvotes: 0

Related Questions