A Styles Icon HTML presents the document content, that is, it mainly displays the text and the images. Styles are used to declareDeclaration

A declaration contains an element name and the values the properties of that element will have. Properties are assigned their values with a colon (:). An example of stylesheet declaration for an <h1> tag might be:
h1 {color:blue; text-align:center}
or modify the attributes or properties of that content, that is, styles format the appearance of the text and images, defining how content should rendered in a browser. For instance, you should use a CascadingCASCADING

"Cascading" because a single change on a cascading stylesheet such as a new background color, can cascade down to every page on a site.
Stylesheet (CSS) to format a site to set consistent colors, fonts, font sizes, background images, block alignment, and the layout for the entire Web site.

Virtually all of your style definitions for your entire site should be set in an External Cascading Stylesheet. A CSS page is a separate file created in distinct stylesheet language that is used to describe the presentation or formatting of a Web page. CSS files have a .css extension. One of the most important tags used within an HTML document that is linked to an External Cascading Stylesheet is the <div> tag. A div is a block element used to define a division or a section in an HTML file, such as the MastHead or LeftColumn or Footer; and the formatting of that HTML division is declared in the separate CSS page.

The short 6 minute YouTube video below shows you how to quickly create and edit a simple introductory Cascading Style Sheet. In order to save viewing time, and to instantly show split screen result, and to allow for color coded presentation, Notepad was not used. However the CSS code is the same regardless of what software platform is used.

1. Examples of HTML Type Selectors (existing tags) used in a stylesheet:
body {
width:800px;
margin:auto; /* center the page when using current DOCTYPE */
background-color: yellow;
}

Notice how the attributes are enclosed in curly brackets or braces { }
   If you fail to close a brace, or mismatch braces, the style will not work
Notice how each attribute is followed a colon (:) which is used to assign the value
Notice how multiple attributes are separated by a semicolon (;)
Notice how comments are placed in CSS pages using this format: /* comment */

For more HTML code samples see: www.w3schools.com
For other resources and tutorials see: quackit.com and htmlquick.com
ValidateValidate

Validation checks the syntax of your file, looking for both errors and possible issues when viewing your page in a browser. Some of the problems reported are missing end tags, missing characters, invalid attributes, incorrect nesting of elements...
 your file, see: http://validator.w3.org

Review Assignment Learning Project: 10 Practice Review Steps

Return to Menu   Top   Valid XHTML 1.0 Transitional