Tutorials & Script Homepage
Style Sheets 1 to 6
Style Sheets: Intro. Part 1
Style Sheets: Intro. Part 2
Primer Part 1
Primer Part 2
Primer Part 3
Primer Part 4
advertisment
advertisement
advertisement
Host With Us: HostingHelper.co.uk From Only $5.00p/m
Spotted an Error ? Let us Know
100's more FREE templates at FreeWebTemplates
Looking for a new Web Host ?
Free templates from TemplatesLand
Professional High-End Templates
TemplateBox.com more FREE templates
Free Flash Templates and Intros
advertisement
 
STYLE SHEETS NUMBER : 02
Please Click Here, and Help Keep This Site FREE to Use
 
Please click on our sponsors advert to the right if you download or use anything from this page.
Thank you for your help.

Style Sheets: Introduction (Part 2)

Classes let you identify a content area regardless of the tags used to create it and assign a style to it. For example, a <p>tag with header class would look like this:

	<p class="header">This is the header</p>

You can define rules for classes just as easy as for regular tags except classes always start with a period. Here's an example of a class declaration.

	.header  { font-family: "ms sans serif" 
	           font-size: 24pt; }
	.content { font-family: "arial"
	           font-size: 12pt;
	           color: blue; }

This makes it easy to set up a CSS definition that defines the style for the various elements in your page without having to hard-code each one. It's easier, saves time, and makes for smaller HTML files.

CSS lets you add styles to your pages in several ways. As we saw above, you can use the <STYLE> tag to add your style declarations at the top of each individual page. This is great when you only want to modify one page but a better solution is to put all your style declarations in an external file and link to them from your Web page. This way you can update your entire Web site by modifying just one file. Using the first example we could create a style sheet file named "styles.css":

	P  { font-family: "ms sans serif"
	     font-size: 12pt;
	     background-color: yellow; }
	H1 { font-family: "impact"
	     font-size: 35pt;
	     color: blue; }

and link to it by inserting the following within the <HEAD> of your Web page.

	<HEAD>
	  <TITLE>Page Title</TITLE>
	  <LINK REL="stylesheet" TYPE="text/css" HREF="styles.css">
	</HEAD>

Finally, if you want to apply a style declaration to just a single HTML element, you can do that too. Here's an example.

	<font face="arial" style="background-color: yellow;
	  font-size: 16pt;">
	Inline Style Declaration
	</font>

Style Sheets: Introduction Part 1 | Style Sheets: Introduction Part 2

Web Hosting  |  Membership website templates  |  Reliable UK Web Hosting  |  Dallas Web Design  |  Art Web Templates  |  Cheap Flight Deals  |  Free Web Hosting  |  UK Web Hosting Company  |  Coursework Writing  |  Reseller Hosting  |  Web Design India  |  Cheap UK Web Hosting  |   Youth hostels  |  Web Design  |  Low Cost Domain Names  |  ASP.NET Hosting  |  Website templates  |  Broadband Reseller  |  Dedicated Server  |  Business Broadband  |  Professionelt webdesign firma - webbureau  |  Austin Web Design  |  Flash Templates  |   SEO India  |  Flash Intros  |  Web Templates  |  Cheap Web Hosting  |  Hyper-V Hosting  |  Website Templates  |  Corporate Logo Design Service  |  Bathroom Shower  |  UK Dedicated Server Hosting  |  Website Templates  |  Bespoke Software Development  |  Domain Name Registration  |  Free Website Templates  |   Free Web Hosting  |  UK Web Hosting  |  Dating Software - aeDating 4.1  |  Flash Templates  |  Website Templates  |  Power Saver  |  Website Design Quote  |  Flash templates  |  cctv cameras  |  SEO  |  Web Templates  |  Web Design uk  |  Sharepoint Hosting  |   Flash templates  |  Cheap Web Hosting Deal  |  Linux Hosting  |  Web Design uk  |  Web Hosting  |  Business web directory  |  Accept Credit Cards  |  Mobile Phone Contracts  |  Car Rental Deals  |  Free domain names  |  Business Email  |  Best UK web Hosting  |  

 
advertisment
advertisment
advertisment
advertisment
  Top-end templates
  Flash Templates
  Reseller web hosting UK
  SEO company India
  Website Templates
  Website Templates
  Website Templates
  Website Templates
  Website Templates
  Website Templates
  Templates
  Website Templates
  Free Website Templates
  Company Logos
  Website Templates
  Website Templates
  Web Hosting UK
  Free Web Templates
  templatebox.com
  freewebtemplates.com
  templatesland.com
  topfreegraphics.com
  freegraphicland.com
  free-templates-layouts
  Ink & Toner Cartridges
  Layouts4Free
  Webmaster Resoucres
  Web Templates Factory
  Free Web Templates
  Free Templates Catalog
  Web Templates
  Reseller Web Hosting
  Stock Photography
  Animations-galore.com
  4print.com.au
  Host Review
  Web Hosting Host Color
  Dedicated Servers
  FlashTemplateDesign
  ZeroDollarTemplates
  Killersites.com
  how-to-build-websites
  Build a free website
  web Hosting
  Business Logo Design
  Templates Favpage
  webmastermind.de
  flasheasy.com
  More Featured Sites