Depiction- Webmaster Resources
Stock Image


Contributors: Advertise Here  |  Advertise Here  |  Advertise Here


Misc Links: Submit Tutorials (Earn $$) l Advertising l Privacy Policy | Site Map

Tutorials > CSS > External Style Sheets

 

Save time by using external style sheets.


Many people put their style in the actual html code, but I find that using a seperate .css file for all styling is really helpful. By using external style sheets, you can save time. When you want to change a property that you have set using CSS, you only have to edit one file. Here's how it's done.


First, put this in your html file after the <head> tag. For example:

<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>

<body>
<p>Welcome to my site</p>
</body>

</html>

You should then create a new file called "style.css" in the same directory as the .html file. You can then put all of your needed styles in that file. You can reference multiple html files to that one CSS file which makes life a lot easier. Here is an example of a basic CSS file that sets anything in <p> tags to normal Tahoma font at 12px:

p {font-family: "Tahoma"; font-weight: normal; color:#000000; font-size: 12px}


Please Note: In a .css file you don't need <style> tags or semicolons!



Tutorial Submitted by: StupendousMan



 
 

Affiliates

DNSandIP Photoshop Tutorials
Tutorial Man Wallpaper Stock  More

Resources