It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

HTML vs. XHTML

Postby Fruitcake on Thu Sep 09, 2004 1:13 am

XHTML is not a new type of coding, it's just a standard.
It encourages you to write clean markup while styling your content with CSS. No deprecated tags should be used.

The rule about having a "slash" at the end of a tag that normally doesn't use a closing tag is the fact that "all tags should be closed". So for the <br> tag, in xhtml you would write it like <br />. Alternatively you can write it <br></br> .. i think ..

Other rules that apply to xhtml are that <img /> tags should alwayd have an alt attribute to comply with text-only browsers.

You can still write bad markup and it will work but if you have specified a doctype of XHTML 1.0 and have written your code according to the HTML 4.01 standards, it will not validate according to the W3C HTML Validator.

HTML and XHTML are parsed by the client's browser, so webhosts don't need special software in order to display XHTML.

I hope i have helped in some way and enlightened you all about XHTML :)

Dan.
Fruitcake
 
Posts: 30
Joined: Sun Sep 05, 2004 8:15 am
Location: Perth, Australia

Postby miles on Thu Sep 09, 2004 1:22 pm

XHTML is a conglomerate of HTML and XML. XHTML was designed to enable websites to be viewed across many different platforms for example: wap enabled mobile phones, pda's and such like.

Web browsers have been made so that they can still display/interpret poorly and/or incorrectly coded HTML web pages. However, this requires a large amount of processing power (from the PC).

This was fine a few years ago as you could only access the internet from personal computers. However due to vast advancements in computer technology the internet can now be acessed by phones and other devices. these devices unfortunately do not posess the processing power of a PC and so are unable to display poorly coded HTML.

Valid XHTML esures that the code is correctly written to allow cross platform and browser compatability.

Miles
miles
 
Posts: 4
Joined: Thu Sep 09, 2004 1:13 pm
Location: Liverpool, England

Postby webmaster on Thu Sep 09, 2004 1:29 pm

Interesting facts, and Miles, welcome to DEVPPL =)
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby ReFredzRate on Thu Sep 09, 2004 3:33 pm

Nice post Miles! :) (and welcome)

I try to keep my coding as clean as possible, but due to my layouts that isn't possible sometimes. For instance, I'm building a new website for my company, and I use a lot of tables for that. Without those it just would not be possible to look that good. I have a header on top, a footer at the bottom, an include on the left, and a 2 col frame at the right. It's unfortunately necessary to use tables, I couldn't get it right with div's. However, CSS has really helped me keeping my coding as clean as possible. And as soon as the website is done for the web, I will tear out even more variables and stuff them all into the stylesheet. So to make a site look good (Internally, the coding that is) you need CSS. But for the appearance, CSS would not be needed :)
ReFredzRate
1000+ Club
 

Postby miles on Fri Sep 10, 2004 1:14 pm

XHTML is essentially a reinterpretation of HTML 4 as an XML application. It takes the vocabulary of HTML and gives it the grammatical structure of XML. It's the first step in the transition of the Web to XML.

According to the W3C, the main advantages of XHTML are:

Extensibility: As an XML application, XHTML is extensible by definition. This makes future changes to the language much simpler in comparison to the process of changing HTML. Most browsers are already XML-compliant, so adding elements to the language is simply a matter of changing the document type definition and namespace. It's no longer necessary to wait for browser developers to implement support for new elements.

Interoperability and portability: A properly structured XHTML document can be reformatted for use on a variety of display devices, including cell phones, PDAs, and other handheld devices. An XHTML document is also interoperable with other XML tools and applications.
miles
 
Posts: 4
Joined: Thu Sep 09, 2004 1:13 pm
Location: Liverpool, England

Postby Fruitcake on Sun Sep 12, 2004 5:09 am

</paste> ;)
Fruitcake
 
Posts: 30
Joined: Sun Sep 05, 2004 8:15 am
Location: Perth, Australia

Re: HTML vs. XHTML

Postby felix56 on Tue Dec 22, 2009 2:39 am

Difference between XHTML and HTML
XHTML is XML that means the syntax rules are slightly different.
There are things you can do in XHTML but cannot in HTML.
There are differences regarding CSS.
There are differences regarding client-side scripting such as JavaScript.
felix56
 
Posts: 1
Joined: Tue Dec 22, 2009 2:38 am

Re: HTML vs. XHTML

Postby jonweb2009 on Sun Dec 27, 2009 5:56 pm

HTML STRICT
HTML TRANSITIONAL
XHTML TRANSITIONAL
XHTML STRICT

are all the just the variations of the basic HTML... with their own coding standards. The most widely used standard is XHTML TRANSITIONAL.

some tags and properties become obsolete in other varations.

HTML accepts CAPITALS of tag, XHTML accepts only lowercase.

More information can be obtained from

http://www.w3.org/
jonweb2009
 
Posts: 6
Joined: Sun Dec 27, 2009 5:23 pm

Previous

Who is online

Users browsing this forum: No registered users and 4 guests