FAQs archive

These are some of the questions I find are commonly asked on the CSS forums of which I’m a member (CSS Creator, Sitepoint), so here’s some quick answers to those common problems.

How do I get different styled links?


So you’ve set up the styles for the links of your page but you have one section that you want to be different from everything else. To do that, you need to assign a different class or ID.

More on How do I get different styled links?

How do I centre my layout?


To centre a CSS layout horizontally, you need to add margin: 0 auto; to either the body or a containing element More on How do I centre my layout?

I’m getting CSS validator warnings


When you validate your CSS file, do you get a load of warnings about background-color not being accompanied by a color and vice versa? More on I’m getting CSS validator warnings

My floated layout won’t work!


Usually when people have trouble with floating columns it’s because they’ve specified a width where there doesn’t always need to be one.

More on My floated layout won’t work!

How do I include code on every page?


Variations on this question can include:

  • Can CSS insert content onto a page?
  • How do I update the content of multiple pages from a single file?
  • How can I get CSS to behave like frames?

More on How do I include code on every page?

Why does my layout look wrong in IE?


If your site looks right in a browser like Firefox, Opera or Mozilla, but not in Internet Explorer, it’s highly likely you’re being affected by one of IE’s numerous bugs.

Fortunately, most of these have been well-documented at Position is Everything.

Why won’t faux columns work?


One of the easiest methods of giving your site the appearance of the columns being the same height is to used the Faux Columns technique as first outlined by Dan Cederholm on A List Apart.

While the method is simple, unfortunately, many newcomers to CSS have trouble getting it right at first. More on Why won’t faux columns work?