| You are here: | About>Computing & Technology>Web Design / HTML> CSS> Beginning CSS> CSS Step By Step |
![]() | Web Design / HTML |
More CSS ArticlesCSS LinksCSS Step By StepHow to Add CSS Stylesheets to Your Web PagesWhat is CSSThere are essentially two parts to Cascading Style Sheets:
Style properties are covered in detail in the styles library and other articles. In this article, you will learn exactly how to place your stylesheets so that you can use them both on one page and all throughout your Web site. Inline CSS Styles (Without a Stylesheet)Inline styles are styles set within one tag. They only affect the current tag, every other similar tag on the page will have the default styles. For example, if you want one paragraph to have a grey background, you can use an inline style: <p style="background-color : #cccccc; border : none;"> The style is defined by the "style" attribute on the element itself. One Document CSS StylesheetIf you want to set up a stylesheet to affect one Web page, you can do that with a stylesheet in the head of your document. For this you use the<style></style>tag in the <head> of your Web document. Here are some tips for working with these stylesheets:
Site-Wide Stylesheets
The fact that importing is only supported by Internet Explorer allows you to create multiple stylesheets that are browser independent, but without relying on DHTML and JavaScript to detect the browser. Create three stylesheets:
In the head of your document load them in this order:
Because of cascading, the IE stylesheet will "overwrite" style rules found in the Netscape stylesheet, when viewed in Internet Explorer. And Netscape won't load the imported stylesheet at all. More CSS ArticlesCSS Links |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


