Chapter 1 - Some Theory
So what is XHTML
XHTML is the latest release of HTML and what is HTML?
HTML is a language with which you build your website's structure.
My code examples will have so called comments in them. In HTML, comments looks like this:
<!-- A comment! --> I will explain various things with these comments, you will recognize them on the green color. Code will have red color.
This is the foundation of every website:
<html> <!-- defines this as a html document -->
<head> <!-- the head tag, you will put things like title, stylesheet and keywords here -->
<title>The sites title</title>
</head> <!-- Ends the head tag -->
<body> <!-- This is the websites body, you will build the html content in here. -->
</body> <!-- Ends the body tag -->
</html> <!-- Ends the html tag -->
A html tag is something inside <>, each tag must end with a slash, it is done in two ways depending on which tag you need to end, let me show you two examples:
<p>this is a paragraph, you put text inside these</p>
As you can see you start the paragraph with a <p> and end it with a </p> where the slash indicated that you want to end the tag.
<img src="myimage.jpg" alt="myimage" />
This is a html tag used to put images on your website. Because you don't need to put anything in it, you add a slas at the end of the tag so that it will close it self.
What is CSS?
CSS is a design language used in symbios with HTML. You make all elements with HTML such as <p></p> tags, <h1></h1> tags. But CSS should control how they behave.
You will start to learn CSS in Chapter three, though I should make one thing clear. When building a website you must separate structure from styling. It means that you should use HTML to build your site's structure and use CSS to style it or one can say "Give Life".
I have prepared an example for you, so that you may understand it better. I will now show you this website you're reading this tutorial from without any CSS code.
So you see my site would look terrible without CSS, I don't just use CSS to style text and define colors, I use it to position the structure I have built with my HTML.
Don't worry if you find all this complicating, theory often isn't entirely understood until used in practice