Web Stack Series Part 6: Cascading Style Sheets

CakePart 6 of our journey through the Web Stack brings us into the design realm. In the world of web design, HTML is the cake and Cascading Style Sheets, or CSS, is the decorative icing on top. CSS is responsible for making your web site look delicious.

Cascading Style Sheets didn’t get a lot of attention until about 5 years ago, when web standardistas such as Jeffery Zeldman and Eric Meyer started encouraging designers and developers to separate stylistic elements from semantic, structural elements. Doing so makes web sites consumable by a wide array of different applications.

CSS is a way of separating the look and feel of your website from the underling function of the data an content. This gives you the ability to apply several different style sheets to the same HTML to achieve wildly different results. For example, the following 5 links all point to the same HTML document, but each one uses a different style sheet to drastically change the appearance of that HTML

  1. http://www.csszengarden.com/?cssfile=201/201.css
  2. http://www.csszengarden.com/?cssfile=199/199.css
  3. http://www.csszengarden.com/?cssfile=194/194.css
  4. http://www.csszengarden.com/?cssfile=185/185.css
  5. http://www.csszengarden.com/?cssfile=189/189.css

Here is the same HTML document without any style sheets: CSS Zen Garden Sample HTML

Quite a difference! The possibilities that this flexibility affords are endless. You could create a style sheet that renders your web site one way for regular web browsers, and another style sheet that renders your web site in a more compact view for mobile phones. You could even provide different designs for different types of users - and you can do this without ever touching the underlying content or HTML.

I want to illustrate this concept with an example. Here is a small snippet of HTML:

<h1>Hello World!</h1>
<p>Nice to meet you!</p>

Now, let’s write some CSS to add some pizazz. This is what a typical style sheet rule might look like:

h1 { color: red; font-size: 32px; }
p { font-weight: bold; }

Hello World!

Nice to meet you!

Here, I am setting the size and color of all text inside of h1 tags. I am also making all paragraph text bold. Now let’s say I want to change the style of all the headings across my entire site. All that needs to be changed is the single CSS rule.

h1 { color: blue; font-size: 28px; }

Hello World!

Nice to meet you!

Now, on every page of my web site, h1 tags will appear blue and in a slightly smaller font size. Notice that I did not change the underlying structure of the HTML. This illustrates the flexibility that separating structure and style provide to us.

CSS is still maturing and being improved. The W3C issues specifications that browser makers use when creating their software. The specifications layout rules for rendering different elements of CSS. Despite these specifications, however, many browsers still render the same rules differently, creating big headaches for designers.

It is not uncommon for larger web design shops to have a person who is dedicated entirely to creating HTML and CSS, although this is a luxury that most can’t afford. In most situations, it is the graphic designer who will be responsible for creating the CSS for your website. Make sure that the person designing your website is knowledgeable regarding the use of style sheets. A good way to test your site is to view it without the CSS file. Is the site still usable? If so, then your designer has done a good job.

In the next part of this series I will explain graphic design and how it can be integrated with CSS to create spectacular web sites. Stay tuned!

Like This Article?

Subscribe Subscribe to the RSS Feed
Add Your Comments 3 Comments - Add Yours!

Related articles:
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • Ma.gnolia
  • Furl
  • Simpy
  • Netscape
  • YahooMyWeb

Tagged:
, , , , , ,

Comments

Basics of Web Usability

In my previous article Why Web Accessibility Matters I touched on why having and designing an accessible web site made good business sense. In this article, I would like to continue into the area of web usability.

What is web usability?

Web usability has multiple meanings depending to whom you are talking. Some people think it is just making a site work, at any cost. Yet others feel that usability is closely tied into accessibility, and I also feel that this the best practice. If you have a usable site, then the chances are really good that it is accessible. Why? In the backbone of the coding, chances are that the site will be using valid XHTML and CSS. This in and of itself helps to create a site that is usable.

Let’s take a look at a definition by Usability.gov:

Usability measures the quality of a user’s experience when interacting with a product or system—whether a Web site, a software application, mobile technology, or any user-operated device.

In general, usability refers to how well users can learn and use a product to achieve their goals and how satisfied they are with that process. Usability, as defined by Joseph Dumas and Janice (Ginny) Redish, means that people who use the product can do so quickly and easily to accomplish their tasks. Usability may also consider such factors as cost-effectiveness and usefulness. 

What defines a usable site?

Now that we have a basic definition of usability, let’s take a look at some considerations that will make your site more usable. There are multiple ways to make a site usable and a lot of them depend on factors of what type of site you have (blog, ecommerce, etc.), your audience (casual web surfer or expert), and what your site is conveying (its purpose).

Use clear and consistent Navigation

One of the problems that I have encountered and I’m sure that you have too, is not knowing where the navigation system is going to take you to. And once you get someplace in the site, where exactly are you? One of the best ideas is to have a clear and consistent navigation system that stands out on the page. The reason is you want to make sure that your visitors know where the navigation system is for your site, whether it be in the upper part of the site and horizontal, or running down either side. 

Another aspect of clear and concise navigation is the use of breadcrumbs, or another method of letting users see where they are, and what pages they have taken to get there. You’ve seen them on sites before, and they resemble something like this:

Home » About » Thanks for finding me!

This allows for users that have maybe followed a link to the final page to backtrack easily without having to “go home” and start over again. Statistics have shown that most users scan pages for the content they are looking for within 15 seconds, and if they don’t find it, the go back to the previous page, or leave your site. Not good if you want to sell a service or product.

Sitemaps are another good method of ensuring an easy method of users to quickly find what they are looking for. One big plus of sitemaps is if they are correctly written, it helps with Search Engine Optimization as the spiders from Google and other sites can quickly follow those links to the main content of each page and article. Not to bad for killing two birds with one page, eh?

Make it easy to read

This one gets real tricky, but since you have an accessible site already up and running, it should be pretty easy. You want to make sure that your text is easy to read and resizable. Several factors affect both of these issues:

Remember that the purpose of your site is to convey information and if that information is hard to read or search, you have lost your audience. I’m sure that each of you have been to a site that the text was too small, or crammed together and hard to read. Or to another site where you couldn’t tell if an image was a link or just an image. Some of the best sites are simple and concise with their presentation of their product or services. Don’t believe me? Take a look at the main Google page, or Amazon.com. Their sites are pretty simple and help you look for what you are after.

Keep Searching

One of the biggest usable tips is to have a site search feature for your site. If the user has an idea of what they want to find, but aren’t sure where to find it on your site, then they will leave. The site search is invaluable for your business or personal site, especially if it has more than just a few pages. The site search takes the guess work out of how you have your site organized and where you might have put that valuable piece of information that the user is looking to find. This allows the user to come to your home page, type in a few keywords, and have the relevant results returned to them in a timely and efficient manner.

Don’t make me Scroll!

One of my biggest pet peeves is to have to scroll the page I am viewing left and right to read the content. I’m not talking so much about extra side bars for advertisements or additional information as I am the main content of a page. What I am talking about is the main content of the page. This also relates to making the content readable in simple format. Limit how wide your content is on your page and don’t make it go all the way across the screen. Trust me, your viewers eyes will appreciate this.

Watch your colors

Color is an important visual aspect to any good web design, but it can easily be abused. We all love looking at nicely designed sites, but the colors that are chosen for any site have to be done so carefully. One of the factors we have to consider is that you want certain things to stand out without being confusing. For example, you want consistency in the colors of your headings so that the users know they are going into another section of the content. Your links should look like links, and that should be consistent throughout the site. Don’t underline anything that is not a link to add emphasis, use bold or italics to do this. 

Another usability and accessibility factor dealing with colors is that some users could have color deficits, such as color blindness or difficulty distinguishing slight hue and tint variations of a certain color. You want strong contrast with your colors, especially with the background color of your areas.

Testing, testing…

The final usability factor deals with the testing of your site. Often times sites are put together for Internet Explorer, which is not the optimum testing platform. IE 7 is now catching up with Web Standards, so it isn’t too bad of a browser to test and design for. However, designing a site to look right is best if designed in Firefox, Opera or Safari browsers as their rendering of sites is often times most correct. Testing of your site in multiple browsers will ensure that the most users can see and use your site as you intend it to be used and seen.

Validation of your site is a good idea also. It will help you catch errors that can lead to problems with the code, usability and accessibility for your users. You can start with the validation process for your site by using the W3C Validation Service and the best part is that it is free! If you are using Cascading Style Sheets for your site (you are making an accessible site, aren’t you?), then you can use the CSS Validation Service from the W3C also.

It’s a wrap

I hope you have enjoyed reading some of the tips and ideas on creating an accessible and usable site. This article only scratches the surface however on these topics. If you want to learn more about these topics, please contact me or check out some of these links as a good start.

Like This Article?

Subscribe Subscribe to the RSS Feed
Add Your Comments 1 Comment - Add Yours!

Related articles:
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • Ma.gnolia
  • Furl
  • Simpy
  • Netscape
  • YahooMyWeb

Tagged:
, , , , , , , ,

Comments

Web Stack Series Part 5: HTML and Markup

HTMLHow do web developers create the layouts of web pages? How do they tell the browser to arrange images around the copy in just the right fashion? How do web browsers know that one paragraph of text should be italic, while the other should be bold? The secret sauce behind all this magic is a markup language known as HTML.

HyperText Markup Language, or HTML, is probably the most ubiquitous and well known language in the world of web development. It is the language that programmers use to describe a web page’s content and structure so that web browsers can display it correctly to the end user. Marking up a web page means wrapping all of the content in descriptive tags. These tags describe the content’s purpose and how it relates structurally to the rest of the web page.

HTML is used to create headings, paragraphs, tables, block quotes, and a lot more types of content. It is also used to insert images into a web page. Here are some examples of HTML:

HTML is usually created after the web site mock-up has been created by the graphic designer. After the mock-up is sliced up into the appropriate images, HTML is used to arrange those images around the content of your site. If you have a dynamic web site, the business logic programming will wrap the dynamic content with HTML so that it is displayed correctly in the browser.

Good vs Bad HTML

In the early days of the Web, HTML was used to add style to a web page. It could be used to make things bold and italic, big or small, and even colorful. Once the Web started to mature and gain popularity, a bunch of smart people decided that HTML was being used incorrectly and that standards should be created. Instead of defining the style of a web site, HTML should have been defining the structure. This approach to marking up a web site according to its function rather than its form is called using semantic HTML, or marking up the content to reflect only the author’s intentional meaning. Styling the content is something that should be left up to style sheets, which we will talk about in more detail in the next installment of this series.

Good HTML is the single best ingredient for good SEO. By using semantic HTML to describe the structure of your web site’s content, you make it easier for search engine robots to parse through your site. For example, using the appropriate level of heading to segment content based on importance will help the bots know what information is most important and which information it can ignore.

Traditional HTML did not enforce much discipline on programmers. If the HTML was slightly wrong or incomplete, most web browsers would automatically correct the problem. XHTML is a more recent version of HTML that specifically adheres to the strict standards set forth by XML. This version forces programmers to be disciplined in their syntax. By requiring strict syntax, web pages are more consistent and better prepared to be consumed by applications other than web browsers. For example, if a web site’s content is marked up semantically with XHTML, it can be consumed by feed readers, mobile devices, desktop software, and many other software environments.

There are several different versions of HTML, I recommend that you require your site to be marked up with XHTML 1.0 Strict; your developer should know what this means - if they don’t, find a new developer. the W3C provides specifications for all versions and even makes available a handy validation tool to ensure that your site adheres to the rules of your chosen HTML version. When you are working with a developer, make it a requirement that all pages pass W3C validation.

Browser Wars

Unfortunately, the browser wars that continue to rage on have left many battle scars along the way. As a result, none of the current web browsers render and display HTML in exactly the same way, creating huge headaches for developers. For example, a level 2 heading in Microsoft Internet Explorer may be displayed in 14pt font while the same heading in Mozilla Firefox may be displayed using 12pt font. This is another area where style sheets come into play - they help normalize differences between browsers so that web sites look consistent regardless of the browser in which they are rendered.

Additionally, in an attempt to out do one another, some browsers have included support for proprietary HTML tags. If your web site uses a proprietary tag that is only available in one browser, the site may break or be displayed incorrectly in other browsers. It is best to just stick with plain vanilla HTML as defined by the W3C to ensure maximum cross-browser compatibility.

Educate Yourself!

HTML is a very easy language to learn and understand. I recommend picking up a basic HTML book (for example: Learning Web Design: A Beginner’s Guide to HTML, Graphics, and Beyond) or reading through some online tutorials so that you have a good understanding of how HTML works and what its capabilities are. This will further arm you when discussing your site with designers and programmers. Additionally, a good knowledge of HTML will give you a greater appreciation of the planning and work that goes into creating a good, quality web site.

In the next part of this series, we will be discussing Cascading Style Sheets. Style sheets are the icing on the HTML cake - they add style and glamour to your semantically marked-up web site. Check back soon!

Like This Article?

Subscribe Subscribe to the RSS Feed
Add Your Comments Add Your Comments!

Related articles:
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • Ma.gnolia
  • Furl
  • Simpy
  • Netscape
  • YahooMyWeb

Tagged:
, , , , , , , , ,

Comments