Archive results for: HTML

Formatting Tables Quickly

tablesWhen you have lots of data tables on a website and need to quickly format them so they are readable look at least somewhat not too boring a little CSS and jQuery can go a long way.

As we all know tables should be only used for tabular spreadsheet-like data but even then there are considerations to me made when trying to design them in a way that matches the rest of your site. So every situation will be unique but here is a sample that can be used as a starting point.

These styles add a thin border around all cells, put content vertically spaced, unique header background color, and consistent text alignment to the left. Read more ›

What is Semantics?

Semantics in front-end development concerns whether to use a div or a header, or if some text should be a paragraph or a heading, or whether a list is to be ordered or unordered, and so on. It’s about elements and not attributes.

It’s about machines (screen readers, browsers, assistive technologies, bots) gleaning meaning from the elements we use to mark up our documents. Read more ›

Naming your ID and Classes

When naming your IDs and classes, it is important that you keep the names as “unpresentational” as possible.

For instance, if you want all of your form notification messages to be red, you could give them a class of red. This is fine as long as there are no other red elements on the page. However, say you wanted to style required form labels red as well. You are now forced to guess to which element that class could refer, and things are already starting to get confusing.

Imagine how confusing the code could become if you used presentational elements across the whole site? Read more ›


The DOCTYPE isn’t exactly an HTML tag or XHTML element. Instead it is a declaration and always appears at the very top of your documents. It identifies the version of the markup  language the page was created.

It refers to a known Document Type Definition, or DTD for short. The DTD sets out the rules and grammar for that version of markup, enabling the browser to render the content as well as allow a validator which version of HTML to use in checking the document’s syntax.

Below are the most common DOCTYPES, although HTML5 should be the one you use from now on. Read more ›