What Is a User Style Sheet?

Why Should I Use a User Style Sheet?

Female photo editors discussing over digital tablet in creative office
Maskot / Getty Images

Now, when I use a user style sheet, I am not setting up a situation where all the webpages I visit look the same. Instead, I have a user style sheet that helps me to browse the web. User style sheets allow you to set styles on page elements so that they are easier for you to read and use, regardless of what the webpage designer intended.

One of the things I have noticed is that many webpages are built by younger people. These people seem to like fonts that are, well, microscopic. Using a user style sheet, I can set default font sizes to a font size that is more readable for me. Another popular trick by web designers is to remove the underlines from links. While this may make the page look nicer, it is harder to tell what is clickable. So with user style sheets, I put the underlines back on links on pages I visit.

Writing a User Style Sheet

Writing a user style sheet is as simple as writing a CSS style sheet for your webpage. You can use all the same properties and commands that you can in a standard style sheet. The trick to a user style sheet is that it's stored on your hard drive, and you tell your web browser to use it.

Playing With User Style Sheets

The most common way to use user style sheets is to add the underline back to links. You would do this by simply adding the following CSS property to your user style sheet:

:link, :visited { text-decoration: underline ! important; }

Adding the ! important to the end of the style is vital, because otherwise, the author-defined style sheet will take precedence over your user style sheet.

Another useful trick with user style sheets is to make some of the more annoying tags less annoying. This style makes the blink tag and the marquee tags not blink or scroll:

blink { text-decoration: none ! important; }
marquee { -moz-binding: none ! important; }

Web Designers: Keep This In Mind

You should remember that you have a user style sheet set when designing webpages. Otherwise, you'll spend hours and hours trying to troubleshoot why you see underlines on all the links while everyone else on your team does not. You may laugh, but if you set the user style sheet today, and then change your website styles in six months, chances are you'll have forgotten you set a user style sheet.

What I do is have my standard profile that I browse the web in and a default profile that I use to test my web pages with. That way I can browse the web how I'm most comfortable, but I also know how most people are going to see my webpage. If you insist on browsing with Internet Explorer, then you'll need to remember to turn off the user style sheets when testing your webpages.