Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mislz28/public_html/wp-content/themes/css-faq-v2/timeweather/timeweather.php on line 19
  • CSS Faqs
28 June 2008

External Style Sheet

An external CSS style sheet could be made using any text or HTML editor, including Notepad or Dreamweaver. A CSS file contains CSS codes only and no (X)HTML. It must also be saved with a .css extension. You could link a CSS file externally by putting any of the links below inside the head section of every (X)HTML file that you wish to modify using CSS.

<link rel=”stylesheet” type=”text/css” href=”Path To stylesheet.css” />
You could also try the @import method:
<style type=”text/css”>@import url(Path To stylesheet.css)</style>

Implement either of the two by placing the link of your choice inside the head section as shown below:
<head>
<title><title>
<link rel=”stylesheet” type=”text/css”href=”style.css” />
</head>
<body>

OR

<head>
<title><title>
<style type=”text/css”> @import url(Path To stylesheet.css) </style>
</head>
<body>

Web designing through an external style sheet links all your (X)HTML documents to only a single CSS file and you are all set to style your pages. All it takes is editing one .css file to design all your pages or overhaul your website.
In conclusion, CSS is simply more convenient to use because:
 It makes your pages easy to maintain.
 It reduces the file size of your web documents.
 It saves bandwidth.
 It offers greater flexibility in designing.

Choosing the Best CSS Method
Now that we have gotten you acquainted with different options on how to insert CSS into your (X)HTML files, you may be wondering which one is best suited for your needs.

The methods we presented are similar in such a way that they will all cascade into a new “pseudo” style sheet as arranged below:
1. Inline Style (inside (X)HTML element)
2. Internal Style Sheet (within the <head> tag)
3. External Style Sheet

Choosing the perfect method depends on what you want to achieve. For example, if you want to modify only a single file, it would suffice to put the CSS within the <head> </head> tags (internal style sheet). But if you aim to style several pages, it would be best to use the external file method.
Now in picking between the @import and <link related=> methods, there is really not much difference. But based from my experience, CSS files containing the @import rule sometimes take a little longer to read in Internet Explorer compared to the other one.

Tags:

This entry was posted on 28 June 2008 at 2:52 PM and is filed under CSS Faqs. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment