How To Customize the Cascading Style Sheets

Discussions:

Suggestion 1: Start Over From Scratch

If you wish to produce a dramatically different layout and style, then it may be best to simply remove the CSS files from 20/20 DataShed and begin with a blank CSS file.

This process would require that you:

  1. study the HTML code produced by 20/20 DataShed for each page or interface and,
  2. apply styles as necessary to produce your desired effect.

Suggestion 2: Reverse Engineer Our HTML

  1. Identify the HTML element(s) you wish to apply styles to (or alter).
  2. Open both 20/20 DataShed style sheets and discover whether the existing CSS definitions already have effect upon that HTML element(s).
  3. If so, then alter the CSS definitions (or override the CSS definition) as necessary.
  4. If no, then create new CSS definitions specifically for that HTML element.

Suggestion 3: Reverse Engineer Our CSS

  1. Study each CSS definition in the 20/20 DataShed style sheets to learn which HTML element(s) is effected. (This usually requires that you browse through the 20/20 DataShed interfaces until you find the HTML elements effected by the CSS in question.)
  2. Alter (or override) the CSS definition as you see fit.

A Helpful Trick

The 20/20 DataShed style sheets can be temporarily disabled or "turned off". This may be helpful if you would like to view a page or interface without CSS. More information about this trick can be found in _globals.asp.

Step-by-Step Example

In the steps below, we will transform this example into a more attractive and more readable page by simply altering the CSS.

  1. Access your web site with an FTP application such as CuteFTP, FTP Explorer, or Windows "My Network Places".
  2. Download 2020applications_stylesheet.css from the parent folder of this application to your local computer.
  3. Open 2020applications_stylesheet.css in a text editor such as Notepad. We recommend that you do not use a WYSIWYG editor like Frontpage or Dreamweaver for this purpose.
  4. In that file, locate the CSS definition for .summary5ViewItemDiv. Each item on this page is written inside a <DIV> element with this class name; therefore we can alter the appearance of the items by styling those <DIVs>.
  5. Note that there may already be some styles applied to that class name. In this example, the CSS definition looks like this:
    .summary5ViewItemDiv {
        width:100%;
        margin-bottom:12px;
        border-style:solid;
        border-width:0px;
        border-color:#000000;
        }
  6. Change that CSS definition to look like this:
    .summary5ViewItemDiv {
        width:100%;
        margin-bottom:12px;
        border-style:solid;
        border-width:1px;
        border-color:#000000;
        background-color:#e5e5e5;
        }
  7. Next in the file, locate the CSS definition the "TextModuleTextLink" class name. In our example, these definitions look like this (and note that there are separate definitions for the active, visited, hover hyperlinks):
    a:link.TextModuleTextLink,a.TextModuleTextLink {
        color:#ffccff;
        text-decoration:none;
        }

    a:visited.TextModuleTextLink {
        color:#ccccff;
        }

    a:active.TextModuleTextLink {
        color:#3333ff;
        text-decoration:underline;
        }

    a:hover.TextModuleTextLink {
        color:#9999cc;
        text-decoration:underline;
        }
  8. Change that CSS to look like this (to change the colour of the "View Details" hyperlink):
    a:link.TextModuleTextLink,a.TextModuleTextLink {
        color:#0000ff;
        text-decoration:none;
        }

    a:visited.TextModuleTextLink {
        color:#0000ff;
        }

    a:active.TextModuleTextLink {
        color:#0000ff;
        text-decoration:underline;
        }

    a:hover.TextModuleTextLink {
        color:#ff00ff;
        text-decoration:underline;
        }
  9. Save the file.
  10. Upload the file to your web site using the FTP application and overwrite the existing 2020applications_stylesheet.css file.
  11. Reload the listings.asp page. In our example, the page now looks like this:

Related topics


© 2005 - 2007 20/20 Applications. All rights reserved.