Style Sheets
  Home arrow Style Sheets arrow Page 4 - The Advantages of Style Sheets
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

The Advantages of Style Sheets
By: Stephen Davies
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-08-07

    Table of Contents:
  • The Advantages of Style Sheets
  • Inline and External Styles
  • The CLASS and ID tags
  • Final Working Examples

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Advantages of Style Sheets - Final Working Examples


    (Page 4 of 4 )

    Take a look at the CSS code below. I want to show you some useful tricks that can be applied with style sheet commands.

    .menu {
      
    margin: 0px;
      
    padding: 0px;
      
    align: center;
      
    font-family: Arial, Helvetica, sans-serif;
    }

    This is a typical usage of the class sector. Any text or lists that use the class name .menu will have several properties applied. Setting the margin to zero maximizes the width. The padding property keeps the spacing of the text to a minimum. The text will be aligned to the center of the page and will be assigned the Arial font type.

    Here are a few examples that can be used to add a little extra static sparkle to an otherwise standard look:

    Example A

    Make the links block elements and give them padding and some style. Links will become black text on a white background, aligned to the center:

    A { color: black; font: bold 11px Arial; background-color: white; display: block; padding: 0px; align: center; }

    Example B

    Specify the rollover style for links under the classes .style1 and .style2. There are a few settings here that may be of use. These lines show how hyperlinks can be styled differently. For consistency, choose one style and apply to all links in the same section such as the menus and main body text. A common use is to remove the underlines from hyperlinks using 'text-decoration: none' e.g. Hyperlink. Conversely, retain the underline on links by specifying 'text-decoration: underline' e.g. Hyperlink

    .style1 a:hover { border-left : 5px solid red; background-color: blue; color: white; }
    .style1 a:link { color: #ffffff; text-decoration: none; }
    .style2 a:visited { color: yellow; text-decoration: none; }
    .style2 a:hover { background-color: blue; color: cyan; text-decoration: underline; }

    Example C

    Do you want to change the scroll bar properties? Here is a line showing various styles that can be applied to the scrollbar.

    body { scrollbar-base-color: #FFFFFF; scrollbar-arrow-color:
    #000000; scrollbar-3dlight-color: #C5F69D; scrollbar-darkshadow-
    color: #C5F69D; scrollbar-face-color: #C5F69D; scrollbar-
    highlight-color: #FFFFFF; scrollbar-shadow-color: #C5F69D;
    scrollbar-track-color: #000000;
    }

    There are many more examples of style sheet usage. I hope that this article has at least introduced the versatility offered by the use of style sheets. Feel free to play around with the examples in styling consistency into those web pages.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This taster on style sheets should be helpful to those starting out on style sheets....
     

    STYLE SHEETS ARTICLES

    - Improving the Visual Presentation of a CSS D...
    - Fixing Browser Incompatibilities in a CSS Dr...
    - Building Clean Drop-Down Menus with CSS
    - Creating Hybrid Web Page Layouts with Negati...
    - Creating Three-Column Web Page Layous with N...
    - Swapping Column Positions in Web Page Layout...
    - Creating Web Page Layouts with Negative Marg...
    - Creating Gradients for Individual Containers...
    - Creating Gradients for Web Page Headers with...
    - SEO Scrolling Frames Problem Solved
    - Building Cross-Browser Background Effects wi...
    - CSS: Pseudo
    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT