<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Example xhtml 1.0</title> <meta http-equiv="Content-Language" content="en-us" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="copyright" content="Copyright 2013 Jacob Persico" /> <meta name="author" content="Jacob Persico" /> <meta name="description" content="An example of a well made xhtml file." /> <meta name="keywords" content="html example,xhtml example,html codes,xhtml codes" />
The code above "head" is the xhtml 1.0 header.
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" specifies the file that validates the HTML. This validation is done to make sure all the xhtml code is typed properly.
The line starting with "html" specifies the language as english.
The meta tag is useful for many different things, it is like 10 tags in 1. meta tags are not required, however; they should always be used.
meta http-equiv="Content-Type" specifies what type of file this is, and how the text is encoded.
All HTML/XHTML files must have a title. The tags "html", "head", "title", and "body" are required, also all html files must always have a name ending in ".htm" or ".html".
meta name="description" specifies what description the web page has. This is useful when your web page pops up in a search engine (like google).
meta name=keywords" specifies what search words or phrases will (hopefully) find your site in a search engine.
In an HTML/XHTML file line returns are treated like a space, and multiple spaces are treated like 1 space. So to make a line return you use the tag "br" or you use the tag "p". To make multiple spaces use " ".
Special characters like less then sign ("<"), greater then sign (">") and ampersand ("&"), must be entered with special codes. Use "<" for "<", ">" for ">", and "&" for "&".
This is a paragraph, it is standard to use the p tag for paragraphs, however; sometimes I proffer to use the br tag instead.
This is another paragraph, as you can see, unlike in books, paragraphs in HTML files typically have a double line return between them.
You can put comments in your HTML files, comments are not visible unless you are viewing the HTML code. Here is an example of a comment:
<!-- This is a comment. -->
<img src="Picture.gif" alt="[Picture]" />
<img src="Picture.gif" alt="[Picture]" align="right" />Note: The newer XHTML standard ("XHTML Strict") does NOT define the "align" attribute of the "img" tag. www.visibone.com/html says that the value "middle" differs between IE and Netscape.
<img src="Picture.gif" alt="[Picture]" align="middle" />By the way, the tags "h1", "h2", "h3", "h4", "h5", and "h6" make text big, they are the 6 "header tags".
The first 3 Pokémon captured by trainer Ash Ketchum.
Pokémon names are trademarks of Nintendo.
Note: "é" shows up as "e" with a line over it.
| Pokémon | Number | Element | Type |
| Pikachu | 25 | Electric | Mouse |
| Caterpie | 10 | Bug | Worm |
| Pidgeotto | 17 | Normal/Flying | Bird |
<table border="1"> <tr> <td><b>Pokémon</b></td> <td><b>Number</b></td> <td><b>Element</b></td> <td><b>Type</b></td> </tr> <tr> <td>Pikachu</td> <td>25</td> <td>Electric</td> <td>Mouse</td> </tr> <tr> <td>Caterpie</td> <td>10</td> <td>Bug</td> <td>Worm</td> </tr> <tr> <td>Pidgeotto</td> <td>17</td> <td>Normal/Flying</td> <td>Bird</td> </tr> </table>
Use hr to make a horizontal line.