I cannot remember where I read about self closing tags.
But when do you use them? Is it going to be the new standard? Is it a good idea that I start using it?Code:<br />
<hr />
Thanks
Michael
Printable View
I cannot remember where I read about self closing tags.
But when do you use them? Is it going to be the new standard? Is it a good idea that I start using it?Code:<br />
<hr />
Thanks
Michael
Use that only if you use XHTML or XML. You can use it like <br></br> too but <br /> is better for backward compatibility. XHTML is the newest web standard, you should try to use it, it's not really hard, it's just that you have to be stricter with your coding and break some old bad habbits :p. Start with transitional and then move to strict if you are interested.
This is the XML/XHTML standard - all tags must close, unlike HTML where some are optional.
OK thanks, I don't even know what XML is :) (Just haven't had the time to read about it) I know it has something to do w/custom tags. So I won't bother with it for now because all I do is asp pages.
Michael
if there is nothing you need between an open and closing tag..you just self close the open tag. Like for intance a hr or br...why waste space typing
<br></br>? its a waste.
Its also appropriate for input tags. Like a button
<input type="button"/>
but not in html only xml/xhtml correct?
Michael
use it anywhere...any browser is going to catch it correctly.
<br></br> and <br/> will do the same thing and any browser regardles wether you define the document as xhtml or not.
That's true but it won't validate if you use /> and you're not using XHTML/XML.
according to elizabeth castro from peachpit press
xhtml is a transition language betwenn html and xml
xml is to be the next true standard and shtml is but a tool to facilitate the transition
i wonder if this is true?
bsw1212
no that is not true and wouldnt make any sense. XML is is just a standard to describe data. xhtml is a markup language that uses the xml structure standard using very specific tags and attributes.
XML + CSS will probably replace HTML eventually. Once CSS is well-defined (CSS3 columns instead of HTML tables for layout) and supported (will take a while), there really is no use for HTML.
Code:<div class="menubar">
<div class="meniitem">Code</div>
<div class="meniitem">Code</div>
<div class="meniitem"><span class="important">Code</span></div>
</div>
Code:<menubar>
<menuitem>Code</menuitem>
<menuitem>Code</menuitem>
<menuitem><important>Code</important></menuitem>
</menubar>
Thats right..forgot about CSS3. And I guess XForms will replace the regualr old <form> tags some day