Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

How to Use CSS - An Overview

 
Here's how to use CSS in your web pages.

First of all, you are reading this page because you already have some experience with HTML or, at the very least, you know what HTML elements are. If not then you should read my tutorials on Basic HTML.

Alright then, assuming that you've got a web page or two up and running, the deal now is you want to jazz up your act with some fancy CSS tricks, right? Well here's how to do it...

Essentially, CSS is applied to the HTML elements in your web pages and you can do this using any of three different methods:
  • Inline Styles ~ This applies CSS directly to each individual HTML element on your web page using the style attribute. This is the easiest CSS to learn and visualize. It's also handy for quickly testing out CSS properties you're not familiar with or for applying styles that you're not likely to repeat elsewhere.
  • Embedded Style Sheets ~ This applies CSS to the current page. It primarily consists of a list of CSS rule sets placed between a set of <style>...</style> tags which themselves are inserted in between the <head>...</head> tags of your web page. Here the real power of CSS starts to come in to play as you can apply the same styles to multiple HTML elements at once on the current page.
  • External Style Sheets ~ This is a list of CSS rule sets that are stored in an external file that carries the .css extension. It applies styling to all web pages that are linked to it using the link element in the <head>...</head> tags. This is the most powerful form of CSS as a single .css file can control the formatting of many web pages at once.

Any one or all three of the above methods can be applied to the same web page at the same time. Each method not only defines a manner of applying CSS but also carries with it a certain precedence which gives web authors some control over which style applies when more than one method targets the same HTML element.

Generally speaking, this CSS pecking order can be described as follows:
  • Inline styles are the boss ~ When more than one method applies to the same HTML element, the inline style wins and its style rules are applied to the HTML element.
  • Embedded style sheets are second in command ~ When no inline style exists for any particular HTML element, rule sets in the embedded style sheet which target that HTML element are applied.
  • External style sheets come up the rear ~ In the absence of any inline styles or rule sets in an embedded style sheet for any particular HTML element, rule sets in an external style sheet which target that HTML element are applied.

The precedence of each method thus 'cascades' down through this pecking order and hence you have Cascading Style Sheets.


*   *   *


Now let's get down to the nitty-gritty and start actually applying some CSS to your web page. We'll begin with a complete rundown on using inline styles...





Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting
How to Make a Web Page

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
<~ BACK TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell