eHow launches Android app: Get the best of eHow on the go.

About

CSS Tutorial for Dreamweaver MX

Contributor
By Josh Shear
eHow Contributing Writer
(0 Ratings)

Cascading style sheets (CSS) are a good way to set up a website so that you are able to affect colors, fonts, type sizes, layout and other aspects of your site design on one document. Updating the document updates the look of the entire site, keeping it uniform and simple.

Adobe Dreamweaver MX assists you in the vocabulary of CSS as you create your style sheet, making it a good program to use both for beginners and experts.

    Creating a New Style Sheet

  1. To create a new CSS file in Dreamweaver MX, start a new document (use CTRL+N on a PC or CMD+N on a Mac), and select Cascading Style Sheet from the pop-up menu. Dreamweaver will pre-populate the new document with the base tags necessary; you only need to begin typing in between the opening and closing tags.
  2. What Goes on a Style Sheet?

  3. A CSS file contains instructions for what various elements of your website look like. For example, you can place a background image or color (or both) on a page, set which font, size and color you want for various sections (such as your page header, your navigation menu, links and body text), and create various layout elements, like setting the width and position of columns or lists.

    Much of this is done by using IDs (frequently, but not necessarily, used for major elements like a navigation menu) and classes.
  4. Syntax

  5. The syntax of a CSS file looks something like this:

    #ID { attribute1:description; attribute2:description; }

    or

    .class element { attribute1:description; attribute 2:description; attribute3:description; }
  6. Vocabulary and Help from Dreamweaver MX

  7. While you decide what to call the IDs and classes, there are specific vocabularies for the attributes and descriptions. Dreamweaver MX will offer a list of attributes, arranged alphabetically, after each space within your brackets. If you start typing, it will narrow the list of available attributes starting with the letters you have typed.

    Dreamweaver does offer limited suggestions for descriptions, but it might be a good idea to have a reference guide, like the W3 Consortium's tutorial or the Webmonkey library available (See references).
  8. Tying your CSS to your Website

  9. For each page in your website using a style sheet, you will need to add a link to the style sheet (or style sheets--you can use more than one if you wish) within the head of the pages.

    That link will look like this (place it between the <head> and </head> tags):

    <link type="text/css" rel="stylesheet" href="LocationAndNameOfYourStylesheet.css">

References

Subscribe

Post a Comment

Post a Comment Post this comment to my Facebook Profile

Related Ads

Get Free Internet Newsletters

Copyright © 1999-2010 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

Demand Media
eHow_eHow Technology and Electronics