Website Design Edmonton       Website Design Feedback       Website Design Sitemap     Contact Website Design Company
Website Designers R Us - Home
What is Style Sheet (CSS)?

Style Sheet was adopted by W3 in December 1996. It's the new way to get control of your page. But, writing the script and put it in your document without help from an authoring tool is hard work. For an updated list of Authoring Tools, check the page at W3C. [W3C is The World Wide Web Consortium, the organization that recommends the standards for using HTML.

Style Sheets can be created in many ways. The current Cascading Style Sheets (CSS) is what people talk about and it is a standard that is supported by Internet Explorer 3.0 and Netscape Navigator 4.0. Using Style Sheets you can get better control of your page. CSS properties are: Font, Color and Background, Text, Box, and Classification. As I have seen nowadays, Style Sheets are mostly used for control over text color and font. Check at cnet.com, for some good examples of using Style Sheets.


How to get it working?
You have to put the style definition in the <head> section.

<HEAD>
<STYLE TYPE="TEXT/CSS">
<!--
.headline   {font-family: Courier New;
             font-size: 24pt;
             font-weight: bold;
             text-decoration: underline}
.topic      {font-family: Arial;
             font-size: 14pt;
             font-weight: bold}
.text       {font-family: Arial;
             font-size: 10pt}
.example    {font-family: courier new;
             font-size: 10pt;
             line-height: 120%;
             color: red}
-->
</style>
</HEAD>
.headline is the name being used to represent 16pt bold Courier New underline text. When you want to apply this rule to your text such as the headline of this page, you can just simply put <span> tag in front of my text -- e.g. We have put <span class="headline"> in front of headline text on this page. This rule also applies to other definitions that we have set (e.g. topic, text, example). Now, it isn't hard to guess that we use </span> as an ending tag.

Still not clear? Here is what we did to the above paragraph:
<p><span class="text"><font size="2" face="Arial"> .headline is the name we use ............. an ending tag.</font></span>

In order to deal with browsers that do not support Style Sheets, we have put the font face attribute tag before my text. So, now our page can display in both Style Sheets supported and non Style Sheets supported browsers, and it still looks the same.

Remember to put <span class="--"> in front of font face attribute because IE 3.0 will read Style Sheets tag. Other browsers can't read Style Sheets tag and will read your next tag such as <b> or whatever. If you still aren't clear on the use of Style Sheets, you can view HTML source for this page.

The SPAN Element is a Text-level element. That means it has to be placed around text. As you have seen from my example it resided in <p> tag

<span> tag is just one way to link Style Sheets definitions to the sections of your pages. You can also use CLASS Attribute, ID Attribute, and DIV Element to reference Style Sheets definitions to HTML.

Example:

1. Using the CLASS Attribute
    <p class=text>hello

2. Using the ID Attribute
Specify the ID attribute in the <head> section such as #abc12 {font-style: italic}. Then, specify it to HTML
    <p ID=abc12>hello

3. The DIV Element is a block-level element. Unlike the SPAN Element, the DIV Element can contain heading, paragraph, and even tables.
    <div class=example>
<H1>Although this is surrounded with header element, it will appear as an example style -- courier 10pt red</H1>
<p>This sentence will also appear as an example style.</p>
   </div>


Style Sheets can be used in a wide variety of other circumstances. We recommend you to stop by at W3C Style page. There is a ton of information there. You can also find details of Cascading Style Sheets at WDG site.

Return to Listing

Website Designer R Us is the right company to get your job done professionally and cost effectively. We've seen the good, the bad, and the ugly, and we are here to help you by recommending the services that match your needs based on our knowledge of other website designers and web design companies whom can perform the type work you are needing.
 Home          ::             About Us          ::             Support            ::             Services            ::             Link Partners          ::             Contact

Copyright © 2006-2011 Website Designers R Us, a DOT Specialist Company. All rights reserved.