“alt” and “title” attributes for images

The alt attribute is designed to be an alternative text description for images. alt text displays before the image is loaded. It is a required element for images and can only be used for image tags.

In contrast, the title attribute can be used for any page element, but it isn’t required for any page element. Many search engine ranking algorithms read the text in title attributes as regular page content.

In the past,  the alt text description was often used as a sort of pop-up tooltip on images. That was because the title attribute wasn’t widely supported. Today most browsers interpret the W3C specifications rather strictly – alt text no longer “pops up” when you run your mouse over an image. You have to use a title attribute for that.

Google Website Optimizer

Google recently launched the Website Optimizer, a tool that can help you improve the effectiveness of your website by allowing you to test different versions of your site content to determine what will best attract users.

Website Optimizer uses two types of testing: A/B testing and multivariate testing.

An A/B experiment allows you to test the performance of two (or more!) entirely different versions of a page. You can change the content of a page, alter the look and feel, or move around the layout of your alternate pages; there’s plenty of design freedom with A/B testing.

Multivariate tests, on the other hand, allow you to test multiple variables — in this case, sections of a page — simultaneously. For example, you could identify the headline, image, and promo text as parts of your page you’d like to improve, and try out three different versions of each one.

A/B experiments are the simpler version of testing with Website Optimizer. Experiments can run on many webpages of a website.

Website Optimizer needs a Google Analytics Account, because it uses the same powerful tracking technology that is used in Google Analytics to collect experiment data. The performance of experiment pages won’t be impacted, with the possible exception of the very first page-load after you have added the tracking code.

A quick start guide is available at the Google site. Different test strategies are possible (time on page,  conversions, clicking rates, landing pages, …).

Website Optimizer scripts will fail W3C validation because they meet browser requirements which do not strictly adhere to the W3C guidelines. There is no workaround available for these errors.

Web Design : block and inline elements

Block elements take up the full width of the page and are naturally displayed on a new line. Block elements can not be nested within inline elements.

Examples of block elements :

  • <div>
  • <h1> … <h6>
  • <p>
  • <table>
  • <ul>, <ol>, <dl>
  • <li>, <dt>, <dd>
  • <form>

Inline elements only take up as much width as is required to display the element and will not force a new line. A width or height will not displayed on an inline element.

Examples of inline elements :

  • <span>
  • <img>
  • <a>
  • <strong>
  • <em>

With the CSS command “display: inline” block elements can be altered to behave as inline elements. By floating these elements, it will give the appearance of an inline element  but will also allow you to style them as if they were block elements. Therefore width and height can be applied to float’s successfully irrespective of whether the element has a default display of block or inline which is the reason why float’s are used so much in web design.

Web Design : layout’s with rounded corners

last update : 18 August 2011

In the past it was impossible to create any kind of curved shapes using pure HTML. There were three methods to generate layouts with rounded corners :

  • CSS
  • Javascript
  • Images

There were a lot of tutorials available on the net how to create rounded corners with CSS. A simple way to generate the CSS and HTML you need to create anti-aliased corners without using images or javascript was the online tool Spiffy Corners from Greg Johnson.

One of the first creators of CSS layouts with rounded corners was Alessandro Fulciniti. He improved his Nifty Corners technique by adding Javascript.

Both methods didn’t work as expected on elements with fixed height, even if a external wrapper was applied. For this reason I preferred the image method with four corner images. Douglas Livingston‘s demo-page show a simple way how to do it (creative commons license). Another useful tutorial about rounded corners has been published by Trenton Moss, complete overviews of techniques are available at CSSjuice and Smileycat.

With HTML 5 and CSS3, the described techniques have become obsolete. CSS3 supports native rounded corners.

Flexible Web Design: web-page width

Last update : June 24, 2014

Web-page layouts can be grouped into four categories based on how their width is set: fixed-width, fluid (or liquid), elastic and hybrid. Creating web pages without fixed-width is considered as flexible web design.

The width of the overall layout of a fixed-width design is set to a value in pixels that’s decided by the designer, based on common screen resolutions, such as 800 by 600 or 1024 by 768. A recommended page width for 1024 by 768 pixel screens is 960, which is divisible by many numbers (2, 3, 4, 5, 6 and multiples). Fixed-width designs are rigid: they don’t change size based on any variations in the user’s setup. Because some people don’t browse with their browser window maximized, the screen resolution doesn’t match the browser window width all the time. Fixed-width designs are always going to result in some segment of the audience seeing a design that is either too wide for their windows (necessitating the dreaded horizontal scrolling) or too narrow (leaving oceans of space on one or both sides of the layout). Many people get almost as distressed about “wasted space” in their browser as they do about horizontal scrolling.

Fluid layouts, also known as liquid layouts, change in width based on the size of the user’s viewport (the viewable area of a page in the user’s device). If fluid layouts don’t have a width assigned with CSS, they will fill up the user’s viewport no matter how big or small it is. If a designer does assign a width to a fluid layout, it will be measured in percentages, not in pixels. The percentage refers to the portion of the viewport it takes up. When a fluid layout changes in size, all of the content within it has to shift around on the page to fill up the space. Horizontal scrollbars are the sworn enemy of readability. After all, scrolling continually back and forth to read across several lines of text does not make for the most enjoyable reading experience. With a liquid layout, horizontal scrollbars almost never happen, because users can size the window however they like to produce lines of text that they find the most comfortable to read and understand.

Elastic layouts change in width based on the text size set in the user’s browsing device. A user who has set a larger default text size will see a page where not only is the text bigger, but the entire layout is bigger proportionally than that seen by people with the default text size. Like fixed-width layouts, elastic layouts always have a width assigned to them, but that width is set in a unit of measurement called an em. One em is equal to the font height, which in turn equals roughly two characters in width, since most characters aren’t nearly as wide as they are tall. Elastic layouts are the rarest type of layout because before CSS became usable for page layout, they were simply impossible to create with tables. In many browsers, you can use the zoom feature to make all pages act like elastic layouts, which reduce the interest to use real elastic layouts.

Most web layouts are built using the idea of columns, whether or not the columns are explicitly visible in the design. Each column can have its own unit of measurement and be thought of individually as fixed-width, fluid or elastic. Mix them together, and you’ve got a hybrid layout. For example, a common type of hybrid layout has a fixed-width sidebar with a liquid main content area.

A resolution-dependent layout is a page that uses JavaScript to switch the CSS and thus the layout of the elements on the page by detecting browser window size. The CSS properties min-width and max-width allow you to set limits on how far a flexible layout will expand or contract.

More informations are available at the Peachpit website and at baekdal.com.