Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm a code newbie and I was just making a wordpress post and instead of using the correct line break code of <br /> I used </ br> in the VISUAL editor. When I switched to the HTML editor and back to the VISUAL editor, to my surprise the line break code was still there. But it had changed from </ br> to <!-- br-->

Should I just use that <!-- br--> code now instead of </ br> or </ br>? If it's okay, I would like to because I like switching between visual and html tabs. This allows me to do that with the line break code to disappear. So should i use that <!-- br-->? I don't want it to break my theme later on if i'm using the wrong code.

share|improve this question

2 Answers 2

This <!-- br--> does not do anything, most probably WP nulled it because it was broken, so you should use <br /> , in HTML mode.

share|improve this answer
    
Oh i just looked at the page source it says, <p><!-- br--><br /> <!-- br--><br /> <!-- br--><br /> <!-- br--><br /> <!-- br--><br /> <!-- br--><br /> <!-- br--><br /> <!-- br--><br /> <!-- br--></p> <p>my text, text, text</p> do you think i could leave it like that? –  user6133 May 27 '12 at 21:44
    
Use just <br> or <br />, <!-- br--> is an invalid markup, invalid = not good = useless ;) . From what I know WP can auto add <br> just by pressing the ENTER on your keyboard, and it is always hiding <br> and <br />. –  Bogh May 28 '12 at 5:50

</ br> is invalid markup. The editor can either remove it or hide it in a comment. It does the latter, so you can fix it by hand.

For line breaks use <br> or <br />, nothing else.

share|improve this answer
    
Ok so the <code></ br></code> is an invalid markup but it does produce a line break though. Can I use it? I just want to because the line break doesnt disapear when i switch between tabs –  user6133 May 27 '12 at 21:38
    
Use it for what? –  toscho May 27 '12 at 21:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.