Using your own Stylesheet

While the author of a web page controls the content of their web page, they can only make suggestions with regard to the way that they want their web page to look. Everything with respect to the fonts that their page uses, what colours are used on the page, and even how their page is laid out is under the control of their visitors.

How does a visitor have control of these aspects of a web page? Well HTML defines the content of a web page but modern browsers expect Cascading Style Sheets (CSS) to be used to control the appearance of the page. Any CSS definition will override and HTML definition relating to the appearance of the page. Also most web browsers are set up so that user defined CSS overrides author defined CSS. This means that if you define your own stylesheet that you will control the appearance of any web pages that you visit.

A user defined stylesheet is identical in the way that it is defined to an external stylesheet defined by a web page author. The stylesheet contains aseries of HTML tag definition with the attributes that you wish to associate with those tags. What is different between a user defined and an author defined stylesheet is the way that you attach it to web pages. With an author defined stylesheet there is an HTML command placed into the page to specify the stylesheet to use. Visitors don't have access to the web pages to attach their stylesheets, instead they need to tell their browser which styolesheet that they want it to use.

Internet Explorer can easily override author defined stylesheets with your own it is just that the option to attach your own stylesheet to IE hidden away in the Accessibility options. To attach your own stylesheet to Internet Explorer go into Internet Options from the Tools menu and on the General page select the Accessibility button. At the bottom of this page you will find a section labeled User Style Sheet. If you select the checkbox Format documents using my style sheet you will then be able to enter the filename of the file that contains that stylesheet into the field below.

Note that some web pages also contain information in the authors stylesheets that is required for some of the page functionality to work properly. Overriding their stylesheet with your own may cause some of the functionality of the page to malfunction.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow