Submit Your Article Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read


Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-27-2005, 04:59 PM
jawn_tech's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jun 2004
Location: USA
Posts: 1,546
jawn_tech RepRank 3jawn_tech RepRank 3jawn_tech RepRank 3
Default Why use <br/> and not just <br> if not xml?

I'm writing a PHP program and some sample scripts I've looked at use
. I wondered why because it essentially does the same thing as
, (note: without the backslash).

So when I look into it, I find that
is used by some because it's "xml" compliant. That leads me to the question of, "so what?" Why the extra keystroke for something that isn't going to be used in xml anyway?
__________________
Domain Name Registration and Website Hosting :: DesignerTrade
Reply With Quote
  #2 (permalink)  
Old 01-27-2005, 05:32 PM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default

I'm not going to attempt to write a tutorial on XHTML syntax, you should check out W3Schools for that!

All elements in a well-formed XML document have a start and closing tag. XHTML whilst not being a fully fledged version of XML is a sort of transitional stage in authoring web documents.

There are a number of instances where elements can be written in slightly different ways and yet still validate.

For example, you can write
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
OR
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>

Both of the above are perfectly acceptable!

The <img> tag is a good example of an element that requires the trailing backslash. There is a start tag but not normally a closing tag, hence it needs that backslash! :o)

Incidentally, the space is required in the
line break to accommodate older browsers who just treat the tag as though it were an old-fashioned


Paul
Reply With Quote
  #3 (permalink)  
Old 01-27-2005, 10:47 PM
jawn_tech's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jun 2004
Location: USA
Posts: 1,546
jawn_tech RepRank 3jawn_tech RepRank 3jawn_tech RepRank 3
Default

So am I headed for trouble or what...

Paul do you think I need to go back and change all I've written from
to
?

What I mean is, will
become obsolete and not work in future browsers? (If the pages I'm doing still have the same script)

I know this is just one example. But I just want to make sure that even though something validates now, it will still work for the client for time to come.

thanks, as always, Paul :)
__________________
Domain Name Registration and Website Hosting :: DesignerTrade
Reply With Quote
  #4 (permalink)  
Old 01-28-2005, 05:00 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default

I'm not sure I'd sweat too much on the humble
character. I'm sure it's going to be around for a good deal longer! While I was in university three years ago, I thought everyone would be coding in pure XML by now.. the adoption of new Internet technologies can seem to take forever!

All I can say, is that I would try to code for the latest standards in XHTML, and ensure the code you're using follows the syntax dictated by the doctype (and logically the DTD).

If you're still writing stuff in HTML 4.01, maybe you should consider stepping up to XHTML, the difference is marginal, and you'll be in a better position to make the transition to more exacting standards (whenever they may arrive!).

Paul
Reply With Quote
  #5 (permalink)  
Old 01-30-2005, 01:41 PM
jawn_tech's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jun 2004
Location: USA
Posts: 1,546
jawn_tech RepRank 3jawn_tech RepRank 3jawn_tech RepRank 3
Default

Then what about the <rant> </rant> tags?

;)
__________________
Domain Name Registration and Website Hosting :: DesignerTrade
Reply With Quote
  #6 (permalink)  
Old 01-30-2005, 02:18 PM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default The beauty of XML

<post>
<quote>
Then what about the <rant> </rant> tags?

;)
</quote>
<reply>
That's the beauty of XML! it's a subset of SGML and a markup language that allows you to set your own tags!
</reply>
</post>
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:30 PM.



Search Engine Optimization by vBSEO 3.3.0