return to tranceaddict TranceAddict Forums Archive > Main Forums > Chill Out Room

 
quick html question..
View this Thread in Original format
UglyDave
what's the difference between two ways of writing a tag:

code:
[br] [br /]

..pretend i used < > brackets instead of [ ]
seen it in a few places. just wondrin why the slash at the end?

cheers,

Dave
sym
nothing in that code box lol
UglyDave
damn html!

thought the code box printed that kinda stuff? :rolleyes:
MaDDHatteR
I dont see crap in that box either, but If u mean the html tags ..something like "< center >....< /center > the / in the second tag indicated that the command (whatever it is that comes after the /) ends. So everything in between the tags will be centered. most html tags work like this, especially text modifiers like bold, italics, center, and font commands. table and layout modifiers work the same way
cviper
It has to do with the "new" xhtml standard, where you're supposed to end all tags, i.e.

<br></br>

"<br />" is really just a shortcut for that. Same goes for other tags, obviously ;)
DJAntSmith
depending on where the slash is it means the end of the tag
Ocean-Glow
Oh crap good question, i always used [/blah] at the start of the command as i closed the action,,, but slash used in the end,,, should be some new XHTML standard,,,,,
UglyDave
hmm, < br > shouldn't need to be closed though.

Dave is hung like a donkey < /centre >

u sayin i could do:

< centre /> David is hung like a donkey??

..doesn't make sence to me!
Thunder5
Well it used to be

<BR>

But since the coming of XML the HTML started to follow it more.. therefore tags with no end tags like <BR> became
<BR />

As far as I know both of those go fine through HTML parsers.
cviper
quote:
Originally posted by UglyDave
hmm, < br > shouldn't need to be closed though.

Dave is hung like a donkey < /centre >

u sayin i could do:

< centre /> David is hung like a donkey??

..doesn't make sence to me!


No, according to the new xhtml standard (which bases on XML) even <br> needs to be "closed". Typing <br></br> is equivalent to <br />, except that the second one takes less typing.

Because the center tag affects the data it encloses it makes little sense to write <center />. AFAIK it's correct to write that, but it does nothing:

code:
<center /> David is hung like a donkey??

is equivalent to
code:
<center></center> David is hung like a donkey??


As you can see, ther center tag does not enclose any text/data, and therefore it doesn't center anything.


The "rule" that all tags must be closed comes, IIRC, from the underlying XML standard. There are a few other rules; for instance, you're no longer allowed to overlap tags, i.e. you can no longer do
<b><i></b></i>

I guess, in the end, this makes writing standardized parsers easier...
CLICK TO RETURN TO TOP OF PAGE
 
Privacy Statement