Tags for this article: building a style sheet, cascading style sheets, css, css guide, external style sheet, linking a style sheet, property, selector
External Style Sheets- Advantages and disadvantages
The best thing that is very good about the Cascading Style Sheets is that you will be able to use them in order to keep your website consistent. One of the easiest ways to do this is to import or link an external style sheet. If the same external style sheet is used in every page of your site, then you will be sure that all the pages of the site will have the same style.
Advantages
At once, you will be able to control the feel and look of many documents. This will be very much helpful if you work with a team of people. It is hard to remember many style rules and while you may have printed the style guide, it is pretty tedious and inefficient to continuously flip through it in order to determine.
You will be able to create classes of some styles that can be easily used on many elements of HTML.
You should not give emphasis to different things on the pages if you use the special windings often, you will be able to use windings class set up in the style sheets in order to create.
The styles can be easily grouped to be much more efficient.
Disadvantages
The external style sheets increases that download time, when they are large enough
The complexity of the site will be increased if you have less number of styles.
Just like the table rendering, you have to still wait until the whole style sheet is loaded prior to the page display
These sheets get big quickly as it is hard to tell when the style is no longer will be in use as it is not deleted when the pages are removed.
Creating an External Style Sheet
These sheets are created with very much similar syntax to the document level style sheets (in the <head>). You have to include both the declaration and selector as well. The syntax for the rule will be ‘selector {property: value ;}’.
These rules must be saved into the text file with an extension of .css. Actually, this is not required but it is good habit so that it will easier for you to recognize the sheets in the listing.
Once the style sheet document is ready, you have it to the WebPages and this can be done in two ways:
1. The HTML tag <link> should be used to link the style sheet. This has some attributes such as href, type and rel. rel tell what you are going to link, type defines the MIME-type and href will be the path to .css file.
2. Importing
Within the document level sheet, you can use an imported sheet so that you will be able to import the attributes of the external style sheet while you will not lose any specific documents. This can be called it in the similar way in calling the linked style sheet but it must be within the document level style.