Tag: CSS

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>
<ul>
  <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>
</ul>

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>
<ol>
  <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>
</ol>

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>
<dl>
  <dt>Alice In Chains</dt>
    <dd>Main In the Box</dd>
    <dd>Would? (Unplugged)</dd>
  <dt>Gwen Stefani</dt>
    <dd>Cool</dd>
  <dt>Fugees</dt>
    <dd>Killing Me Softly with His Song</dd>
  <dt>t.A.T.u.</dt>
    <dd>Not Gonna Get Us</dd>
  <dt>Jimmy Hendrix</dt>
    <dd>Born Under a Bad Sign</dd>
</dl>

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
Cool
Fugees
Killing Me Softly with His Song
t.A.T.u.
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: , , , , , , , , , , , , ,

The CSS Anthology

The CSS Anthology BookI finished reading Rachel Andrew’s The CSS Anthology: 101 Essential Tips, Tricks & Hacks and I have to say, that this is a very well written book.

There is nothing more frustrating for me than to buy a technical computer book and find out that it was totally useless. I often run into the problem where most computer books are either too easy, (like explaining how to install something or edit a preference), or they are tomes of reference material which I get bored with very easily. It seems like everything is written for the absolute beginner or experienced professional, perhaps publishers do not like to market to articulate readers who can do multiple things well. However Rachel Andrew’s book happen to be a welcomed and exceptional computer book.

To begin with this is a CSS book, and in case you do not have much experience with CSS, this is a very intimidating subject. CSS does two things for html web design, it removes the layout leaving only the content for you to write, and it styles the content. CSS layout and CSS styling are where most web designers are aiming for these days, but if you are just learning CSS, you will soon find out that CSS styling is the easiest concept to grasp and CSS layout is quite the opposite. Given this, every CSS book tries to conquer both layout and style, and usually fails miserably when it comes to explaining layout. Part of the problem is that there are multiple browsers and each one supports CSS positioning in different ways, and you end up having to find a layout that works well in most browsers, while with font styles, even if a font does not display quite right, it still displays, so web designers has an easier time with CSS styling.

Although the title of this book states to have a 101 essential topics, while reading it cover to cover, you do not have the impression of counting each topic and that some topics are not all that essential. Rachel Andrew’s writing style makes each topic seem important and relevant to the overall discussion which is important, because it also allows you to read the book in multiple ways. Most computer book authors tend to reiterate the same things over and over again too, because they know most people will not be reading the entire chapter at once, as if they also know their book is boring; Rachel Andrew avoids a lot of repetition which is good, but obviously some points have to be restated for clarity. Personally I found the book a better read if you can finish the whole chapter at once, and this tends to work very well until you get to the later chapters which tend to be less consistent and have more random points.

Continue reading

Filed under: Book ReviewsTagged with: , , , , , , , ,