![]() |
The BR tag
When I make changes to my template i sometimes use
Code:
<br> Code:
<br /> |
It's not well formed. Some browsers and other tools could have problems with it, causing the page not to display properly, or the tool not to work as expected.
|
Thats what i figured. My footer would be bunched up and be on top of the posts in a thread sometimes in FF. I had a many
Code:
<br> and not <br /> Thanks, |
Normally most tags need to be closed, such as <p></p>, but the br tag is one of a few that has never need to be closed, that is why most have always used <br>. With things moving on, especially with XHTML you should close all tags, so this should be <br />. It is also a good idea to close all other similar tags by putting a space then /> after the tag name. For example with the img tag -
Code:
<img src="graphics/v8_engine.gif" alt="Animated V8 engine" width="90" height="90" border="0" align="left" /> |
Quote:
In HTML 4 and such, not all tags that were opened needed to be closed. <br> for examle is a prefectly valid tag in html 4, as well as <img src=""> <table> <tr> <td> <td> <td> <td> </tr> </table> I believe is valid in html3 and possibly also 4. XHTML came around and it made lots of changes to how things should and should not be done in the code, it was alot of standarization. All tags are lower case, all tags must be opened and closed. Some tags must have additional attirbutes. So, <br> becomes <br /> and <img src=""> becomes <img src="" alt="" />. Tables get more strict too as well as deprecated. <table> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> Not to mention tons of times in less well coded html people would use the <p> tag like it was a br tag and thats also not accectable. :) |
I hate the space before the />
<br /> just annoys me. I always use <br/>. I have no idea why someone decided the 'standard' was to stick a space in there, and I'd like to find them and do bad things to them. |
< start tag
br start tag type spacing /> end tag, if there is no space its not valid as the tag is recognized as br/ not br |
<br> is HTML and <br /> is XHTML.
vBulletin is set to use XHTML Transitional by default, so to keep things consistent, use <br />. |
I had a few <hr>'s too. Changed them to <hr />.
Will I get pages not displaying correctly if my <img src=""> tags are not <img src="" alt="" /> ??? |
Very unlikely, but you should change them...
If you go to find/replace in templates, I think that was one of the regex examples (change img tag). This might save you some work. ;) |
All times are GMT. The time now is 01:12 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|