2. An introduction to coding web pages with XHTML

2. An introduction to coding web pages with XHTML

In this series of tutorials, you will learn the basics of coding web pages with XHTML. Part One of the Basic XHTML series -- what you're watching now -- contains the essential knowledge you must know to create a simple web page.

Part Two will be released at a later date and will contain less essential but still highly useful and important aspects of XHTML.

You should know right away, though, that neither part of the Basic XHTML series will teach you how to create beautiful and complex websites. In fact, you won't learn anything about changing a site's appearance in either series; that will be reserved for the CSS (Cascading Style Sheets) series.

It can take years for web designers and developers to master their craft. However, once you understand the basics of XHTML, you should have no trouble moving on to more advanced stuff from there.

So what is XHTML, exactly? Like its predecessor HTML, XHTML is a tag-based markup language designed specifically for creating websites.

Tags are used to denote different parts of a web page. It is then the web browser's job to convert the data contained in those tags from code to a consistent, structured format that's more easily read by an average human.

In the background, you can see part of a simple XHTML document. Tag names are surrounded on either side with angle brackets.

Tags are typically used in pairs; these are called opening and closing tags. This allows tags to contain text, or even other tags. In general, there's no limit to what a tag pair can contain.

In an opening tag, you have the option of putting any of several attributes; some are specific to each tag, while others can be used with all tags.

Attribute values should always be contained by double or single quotes, though double quotes are preferred. An attribute should always have a value, even if it's an empty string (i.e. two quotes "" with nothing inside).

In the case of <body class="intro">, shown below, body is the tag, class is the attribute, and intro is the attribute's value. You'll find out what all this really means in later tutorials.

Closing tags should always have a forward slash after the first bracket. For example, </head>.

All XHTML tags that can contain something should always have a closing tag. If a tag can't contain something, no closing tag is necessary; the slash should go at the end of the only tag, i.e. <img />.

That pretty much covers the basics of XHTML's overall structure. If you want to find out more, we recommend you keep watching the rest of this series in its entirety, for fullest effect.

Your introduction to XHTML is now complete.

  • 0 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

3. How is XHTML different from HTML?

3. How is XHTML different from HTML? If you watched the previous tutorial, you'll know that...

5. Some resources you should know about before you begin

5. Some resources you should know about before you begin Before we begin, you should know...

4. Choosing a text editor for web development

4. Choosing a text editor for web development In this tutorial, we will discuss the factors...

6. How to quickly open a local web page in your browser

6. How to quickly open a local web page in your browser They may seem obvious to some, but...

7. How to correctly save an XHTML document

7. How to correctly save an XHTML document If you haven't watched our tutorial on choosing a...