Category: XHTML

Inline Quotations

Short inline quotations can actually be incorporated into your html via the q tag. This allows you to skip the actual quotations marks.

Steve Jobs told us, 
<q> lang="en-us">design is not just what it looks like and feels like, design is how it works.</q>

Note that it is also a good idea to add the lang attribute when using q elements.

You can use the lang attribute other tags such as the paragraph tag, if for example you had one paragraph in a different language than your document.

Filed under: XHTMLTagged with: , , , , , , ,

HTML Lists Tags

One easy way to start coding semantically is to use lists tags. For me personally, lists tend to organize my HTML code and make content more readable in general. Lets look at three basic tags that everyone can use, starting with the most common.

The Unordered List

This is probably the tag that we rely most often on. Many designers use it to create link menus as well as the occasional content list. In our example we are going to organize some audio tracks that I got from Apple’s iTunes Store.

<h4>My iTunes Music</h4>
  <li>Man In the Box - Alice In Chains</li>
  <li>Cool - Gwen Stefani</li>
  <li>Killing Me Softly with His Song - Fugees</li>
  <li>Not Gonna Get Us - t.A.T.u.</li>
  <li>Born Under a Bad Sign - Jimmy Hendrix</li>

The above code will render with a bullet for each item, and automatically indent. It should look something like this:

My iTunes Music

  • Man In the Box – Alice In Chains
  • Cool – Gwen Stefani
  • Killing Me Softly with His Song – Fugees
  • Not Gonna Get Us – t.A.T.u.
  • Born Under a Bad Sign – Jimmy Hendrix

But how about if I wanted to organize each of my iTunes tracks? Perhaps I had many of them and I wanted to have them all numbered. In this case, the standard unordered list tag is not what I really need.

The Ordered List

Enter the ordered list tag which can automatically number all my items for me.

<h4>My iTunes Music</h4>
  <li>Man In the Box - Alice In Chains</li>
  <li>Cool - Gwen Stefani</li>
  <li>Killing Me Softly with His Song - Fugees</li>
  <li>Not Gonna Get Us - t.A.T.u.</li>
  <li>Born Under a Bad Sign - Jimmy Hendrix</li>

Using CSS, I can also style the ordered list using the list-style-type property so that the default list style can be:

  • decimal: 1, 2, 3,…
  • upper-alpha: A, B, C,…
  • lower-alpha: a, b, c,…
  • upper-roman: I, II, III,…
  • lower-roman: i, ii, iii,…
  • none:

The standard decimal default, of the ordered list for my iTunes tracks automatically numbers each of the items for me, so that I do not have to worry about actually adding numbers between the li tags.

My iTunes Music

  1. Man In the Box – Alice In Chains
  2. Cool – Gwen Stefani
  3. Killing Me Softly with His Song – Fugees
  4. Not Gonna Get Us – t.A.T.u.
  5. Born Under a Bad Sign – Jimmy Hendrix

However, after ordering my iTunes tracks, I decide that I would rather organize my tunes according to artist, since my collection has grown and now includes multiple tracks from the same artist.

The Definition List

In this case, I am going to change my list and make things even more structured.

<h4>My iTunes Music by Artist</h4>
  <dt>Alice In Chains</dt>
    <dd>Main In the Box</dd>
    <dd>Would? (Unplugged)</dd>
  <dt>Gwen Stefani</dt>
    <dd>Killing Me Softly with His Song</dd>
    <dd>Not Gonna Get Us</dd>
  <dt>Jimmy Hendrix</dt>
    <dd>Born Under a Bad Sign</dd>

By using the multiple dd tags, for the same dt tag, I have an easy way of organizing my songs by artist.

My iTunes Music by Artist

Alice In Chains
Main In the Box
Would? (Unplugged)
Gwen Stefani
Killing Me Softly with His Song
Not Gonna Get Us
Jimmy Hendrix
Born Under a Bad Sign

By using common list tags like the Unordered List, Ordered List, and Definition List you can quickly add structure to your HTML and at the same time use CSS more effectively to quickly add design elements to your page.

Filed under: XHTMLTagged with: , , , , , , , , , ,

So You Want To Learn HTML

Every now and then someone asks me how they can learn how to put together web sites, and I always find it somewhat difficult to answer this question, when I do not know much about the person asking the question. Honestly site design can mean so many different things that there is not one answer that will satisfy everyone. Instead of trying to give an overall answer, let me be more specific. Suppose you have a lot of patience, you have an internet connection, and a lot of time to spend on a computer, but you do not know anything about web servers or HTML, but you at least know how to use Word on your computer. Basically you are starting from scratch.

The first thing you need to do is go to your local library and find the computer books section. This section will have lots of old outdated computer books which no one has read in over a year or two. However, the HTML 4 and XHTML books are what you are looking for. Browse through them all until you find a few that you are comfortable with and go home and read them. At the same time start looking at web sites that cover XHTML and CSS.

Eventually you need to start creating your first site in basic HTML on your computer. You will make many revisions and versions, the more you create, the more you will get the hang of it. Once you have the experience of working with HTML and CSS, you probably will need to re-read some of those books you checked out the library and this time around you probably will gravitate to certain areas of web design that you find more interesting. At this time I would recommend you check out The CSS Anthology, which is a great overall CSS book. You will also come to realize the differences between XHTML and HTML and hopefully gravitate to at least Transitional XHTML. For an overall argument for XHTML check out Jeffrey Zeldman’s Designing With Web Standards and for practical applications of XHTML you can take a look at Web Standards Solutions: The Markup and Style Handbook by Dan Cederholm.

After all the reading and hands on coding, you can explore the infinite resources of the Internet and HTML and XHTML will just make sense to you. There is always more to learn, but this is just to get you started. Good Luck!

Filed under: XHTMLTagged with: , , , , , , , , , , , , ,