Sunday, April 29, 2007

CSS Introduction

1. Start with a new notepad document.
2. SAVE AS--"myfirstcsspage_html"
3. Save it in a new folder called: "Last Name First CSS Layout"
4. Copy the code:
<!DOCTYPE html>
<html>
  <head>
    <title>Types of CSS</title>
  </head>

  <body>
   <h1>Types of CSS</h1>
    <p>This paragraph will contain an INLINE STYLE of CSS </p>
  </body>
</html> 

INLINE STYLES
--can only be placed directly in the <body> element.
--they are expressed as attributes within a tag.



The syntax is as follows:

<element attribute="property: value; property: value;">

Here's an example:

<p style="color:red; text-align: center;"> some content </p>

p is the HTML element
style is the attribute of the HTML element
style has the properties color and text-align color has the value red text-align has the value center


EMBEDDED/INTERNAL and EXTERNAL STYLES
 --it includes the HTML element as the selector and the 
declaration (property and value).
--3 parts-  A SELECTOR, a PROPERTY and a VALUE


The Syntax:

selector {property: value; property: value;}
  


How to write it:


  1. enter the selector you want to define characteristics for, such as h1
  2. use the { bracket to start the rule
  3. use } to end the rule
  4. inside the brackets, list the characteristics you want the tag to use
    1. list the property
    2. use the colon (:) to separate the property from its value
    3. list the value
  5. use a semi-colon (;) to separate each characteristic.



 
 
 
 


 

No comments:

Post a Comment