| Your source for computer information |
| Topic Categories Links Contact |
| Website -Website Design -Domain Names -Advertising Tips -Hosting -DNS -IIS -HTML -XHTML -PHP -MySQL -Search Engine Optimization -Forum Software Programming -Assembly -C/C++ -C# -Delphi -Java -Visual Basic -VB.net -Programming Books General Computer -Windows -Linux -Unix -Computer Hardware -Computer Vocabulary -System Maintenance Other Software -MailEnable -XVI32 -Olly Debugger -TextPad | A Quick Guide to XHTML by TheProgrammer.org XHTML is the next version of HTML and one day will replace HTML, which means you need to make sure that your websites follow the XHTML standard. There are three XHTML types: frameset, strict, and transitional. Most people develop for transitional and that's probably the one you want to focus on. Frameset is used for websites that contain frames. These are just some quick rules to help you in developing a valid XHTML webpage. Rule #1 All XHTML documents most start with a doctype. Transitional Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Strict Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Frameset Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> Rule #2 All XHTML webpages must have a content type. Defines what language your webpage is for. Example: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> Rule #3 All html tags are lowercase. Valid XHTML <p></p><b></b><i></i> Invalid XHTML <P></P><B></B><I></I> All attributes are lowercase as well Valid XHTML <body bgcolor="red"> Invalid XHTML <body BGCOLOR="red"> Rule #4 All tags must have an ending tag. Valid XHTML <p>This is my text</p> Invalid XHTML <p>This is my text Even tags that have no ending tag in HTML must have an ending such as <br> and <hr> Valid XHTML <br /> <hr /> <img src="http://site.com/image.gif" \> Invalid XHTML <br> <br> <img src="http://site.com/image.gif"> Rule #5 Tags have to be in proper order. Valid XHTML <p><b>This text is bold></b></p> Invalid XHTML <p><b>This text is bold></p></b> Rule #6 All values have to be in quotes. Valid XHTML <hr width="50%" size="10" /> Invalid XHTML <hr width=50% size=10 /> Rule #7 All images must contain the alt tag. This is so other devices can access your site and for people who has disabilities to access your site. Rule #8 All XHTML documents must contain at least DocType <html><head><title> and <body> tags. Rule #9 The name attribute no longer exists and is now the id attribute. Rule #10 No longer allow short attributes. Basically any attribute inside a tag that is one word just do the word="word" replace word with the attribute name. Valid XHTML <option selected="selected" value="1">Choice 1</option> Invalid XHTML <option selected value="1">Choice 1</option> This rule seems kind of pointless to me but this is how it is. |
| Copyright TheProgrammer.org 2006 |
|
ServerBeach Coupon: |