vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   The BR tag (https://vborg.vbsupport.ru/showthread.php?t=116520)

tommyxv 05-24-2006 02:41 AM

The BR tag
 
When I make changes to my template i sometimes use
Code:

<br>
and not
Code:

<br />
What problems will it cause?

hambil 05-24-2006 07:10 AM

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.

tommyxv 05-24-2006 07:58 AM

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 />
in the footer. I changed them so hopefully it will fix the problem.

Thanks,

firstrebel 05-24-2006 12:15 PM

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" />
Bob

Zachery 05-24-2006 12:48 PM

Quote:

Originally Posted by firstrebel
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" />
Bob

Its not normally bob, its in Older versions of HTML tags were abit less well defined.

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. :)

hambil 05-24-2006 10:40 PM

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.

Zachery 05-25-2006 02:51 AM

< 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

Adrian Schneider 05-25-2006 02:56 AM

<br> is HTML and <br /> is XHTML.

vBulletin is set to use XHTML Transitional by default, so to keep things consistent, use <br />.

tommyxv 05-25-2006 03:55 AM

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="" /> ???

Adrian Schneider 05-25-2006 03:59 AM

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
  • Page Generation 0.00982 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete