Eriginal [:-) Building a Website in XHTML 1.0 | Article 1.1 |
Article 1.1 | |||
"Oh, they have the internet on computers now" Homer Simpson | |||
|
Introduction: "I am a Web Page"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
What does it mean, and why did we use it? This DOCTYPE declaration identifies the document conforms to XHTML 1.0 transitional. This means there is backward compatibility built in for older browsers to intrepret the code, i.e. transitional. In these articles we will always use this DOCTYPE declaration. There are alternatives but as we want older browsers to read our web page and we are not using frames this is the required declaration. You don't really need to understand much beyond that at this stage, other than you need to include it, and it will always appear at the top of our pages.
What is XHTML 1.0?
Key Points in Writing XHTML
When these three points are met the document can be described as "well formed". Point one is straightforward and easy to follow, for example, a common convention in using a javascript event is to mix the case, as in the OnMouseOver event. To comply with XHTML it should be written onmouseover, i.e. everything in lowercase. Point two and three present more challenges.
Tags & containers
When you look at this code you can see a pattern. Things seem to have a start and an end, i.e. the code is written as if to say to the user agents
The start of a section, like the head section always appears like <head>. This is an opening tag. The closing tag includes a backslash and will always be written like </head>. The two tags together form a container and there is additional code we can write in between the tags, which is called nesting. All very well except there are some tags which do not form a container, i.e. there is no natural closing tag for them. An example of which is the tag for break rule (i.e. break to the next line). In HTML this tag would have been written <br>, but this is invaild for XHTML. The tag needs to be closed and we do this by including a space followed by a backslash. The tag should therefore be written as <br />.
The <head> </head> Container
These meta tags are therefore of the http-equiv variety as they are equivalent to HTTP headers. In some cases they may also be used by search engine robots to classify, for example
Putting it Together
When we start to look at content we will return to the title container and it's importance in page ranking, but for now we just need to understand that every page should have a title or name. This name will appear between the title tags and will be the display name for the page in your browser. For our example we will name our page "XHTML 1.0 Web Page Example", in code this will be written as <title>XHTML 1.0 Web Page Example</title> Our page can now be updated to include the new elements. As before type your name over the dots in the box below and press view to launch our new web page
Next Article
Mark O'Connor 11th May, 2006 |
||
<articles> | home | graphics | portfolio | hosting | web database | design | identity | registration | contact |
site :| privacy :| accessibility :| © www.eriginal.com 2003 - 2010, all rights reserved. Be Eriginal ! |