Suprasite (trademark) copyright 1994-2005. all rights reserved.
home | graphics and design | computers and networks | methodology | links | glossary of terms


Make money with your website for free

Protect Your PC from Viruses with the McAfee VirusScan!

Free Shipping with any $75 purchase: expires 11/30/04

OD - Supervalues

©2004 SupraSite(tm) all rights reserved.

 

Welcome to SuprasiteTM

Graphics & Design

  • Introduction
  • Web Design
  • PhotoShop Basics
  • Effective Presentations
  • Misc. HTML

    MISC. HTML

    More music…

    <embed src="FILENAME.mp3" autostart=true loop=0 volume=100 width="175" height="15">

     

     

    <!-- Start of chat HTML: do not alter this (flash-gear.com)--><script type="text/javascript">if(typeof(cfashbl)!="string"){cfashbl="";}else{cfashbl="&cf=1";}document.write("<"+"script type=\"text/javascript\" src=\"http://www.flash-gear.com/ncht/cht.php?c=j&t="+Math.random()+cfashbl+"&id=32&a=394614874\"></"+"script>");</script> <br>

    <!-- End of chat HTML (flash-gear.com) -->

     

    links glow:

    <style type="text/css"><!-- a:hover{filter:glow(color:FF0000, strength=3);height:0px;width:inherit} //--></style>

     

    mouseover border:

    <style type="text/css"><!-- a:hover {border:FF0000 1px solid;} --></style>

     

    mouseover hover color

    <style type="text/css"><!-- a:hover {color:COLOR;} --></style>

     

    mouseover blur:

    <style type="text/css"><!-- a:hover{filter:blur(color:B22222, strength=3);height:0px;width:inherit} //--></style>

     

    scrolling text with color background

    <marquee direction="left" width="65%" style="background:3333FF"> <font color=B22222>UR TEXT</font></marquee>

     

    arrows that point and blink at text

    <marquee behavior=alternate width="4%">>></marquee>YOUR WORDS HERE<marquee behavior=alternate width="4%"><<</marquee>

     

    FADE PICTURE INTO BACKGROUND

    <div style="filter: alpha(style=3, opacity=100); width:200; height:200; background:FFFFFF url(PIC URL)"></div>

     

     

    FADE PICTURE INTO BACKGROUND AS CIRCLE

    <div style="filter: alpha(style=2, opacity=100); width:200; height:200; background:FFFFFF url(PIC URL)"></div>

     

     

    The link goes in the <head>...</head> section.
           
    <link rel="shortcut icon" href="favicon.ico">
            It can be tedious if you have a lot of pages but some editors can do a site-wide search and replace so you could replace
    </head> with <link rel="shortcut icon" href="favicon.ico"></head> if you have such a facility.

     

    Most common fonts:

    "Verdana, Arial, Helvetica, sans-serif"

    " Georgia, Times New Roman, Times", "Courier New, Courier".

    Commonly-installed typefaces on Macs and PCs

     

    Windows

    MacOS

    Serif

    Georgia
    MS Serif
    Book Antiqua
    Times New Roman

    Georgia*
    New York
    Palatino
    Times

    Sans-serif

    Verdana
    MS Sans Serif
    Arial
    Trebuchet

    Verdana*
    Geneva
    Helvetica
    Chicago

    Monospace

    Courier New

    Courier

    *Georgia and Verdana are installed on Macs by MSIE, so they may or may not be present.

     

    Reference   HTML Cheat sheet


    Basic Tags

    <html></html>
    Creates an HTML document

     

    <head></head>
    Sets off the title and other information that isn't displayed on the Web page itself

    <body></body>
    Sets off the visible portion of the document



     

     

     

    Header Tags

    <title></title>
    Puts the name of the document in the title bar

     

     

    Body Attributes

    <body bgcolor=?>
    Sets the background color, using name or hex value

    <body text=?>
    Sets the text color, using name or hex value

    <body link=?>
    Sets the color of links, using name or hex value

    <body vlink=?>
    Sets the color of followed links, using name or hex value

    <body alink=?>
    Sets the color of links on click

     

     

    Text Tags

    <pre></pre>
    Creates preformatted text

    <hl></hl>
    Creates the largest headline

    <h6></h6>
    Creates the smallest headline

    <b></b>
    Creates bold text

    <i></i>
    Creates italic text

    <tt></tt>
    Creates teletype, or typewriter-style text

    <cite></cite>
    Creates a citation, usually italic

    <em></em>
    Emphasizes a word (with italic or bold)

    <strong></strong>
    Emphasizes a word (with italic or bold)

    <font size=?></font>
    Sets size of font, from 1 to 7)

    <font color=?></font>
    Sets font color, using name or hex value

     

     

    Links

    <a href="URL"></a>
    Creates a hyperlink

    <a href="mailto:EMAIL"></a>
    Creates a mailto link

    <a name="NAME"></a>
    Creates a target location within a document

    <a href="#NAME"></a>
    Links to that target location from elsewhere in the document

     

     

    Formatting

    <p></p>
    Creates a new paragraph

    <p align=?>
    Aligns a paragraph to the left, right, or center

    <br>
    Inserts a line break

    <blockquote>
    </blockquote>
    Indents text from both sides

    <dl></dl>
    Creates a definition list

    <dt>
    Precedes each definition term

    <dd>
    Precedes each definition

    <ol></ol>
    Creates a numbered list

    <li></li>
    Precedes each list item, and adds a number

    <ul></ul>
    Creates a bulleted list

    <div align=?>
    A generic tag used to format large blocks of HTML, also used for stylesheets

     

     

    Graphical Elements

    <img src="name">
    Adds an image

    <img src="name" align=?>
    Aligns an image: left, right, center; bottom, top, middle

    <img src="name" border=?>
    Sets size of border around an image

    <hr>
    Inserts a horizontal rule

    <hr size=?>
    Sets size (height) of rule

    <hr width=?>
    Sets width of rule, in percentage or absolute value

    <hr noshade>
    Creates a rule without a shadow


    </TD< tr>

     

    Tables

    <table></table>
    Creates a table

    <tr></tr>
    Sets off each row in a table

    <td></td>
    Sets off each cell in a row

    <th></th>
    Sets off the table header (a normal cell with bold, centered text)

     

     

    Table Attributes

    <table border=#>
    Sets width of border around table cells

    <table cellspacing=#>
    Sets amount of space between table cells

    <table cellpadding=#>
    Sets amount of space between a cell's border and its contents

    <table width=# or %>
    Sets width of table — in pixels or as a percentage of document width

    <tr align=?> or <td align=?>
    Sets alignment for cell(s) (left, center, or right)

    <tr valign=?> or <td valign=?>
    Sets vertical alignment for cell(s) (top, middle, or bottom)

    <td colspan=#>
    Sets number of columns a cell should span

    <td rowspan=#>
    Sets number of rows a cell should span (default=1)

    <td nowrap>
    Prevents the lines within a cell from being broken to fit

     

     

    Frames

    <frameset></frameset>
    Replaces the <body> tag in a frames document; can also be nested in other framesets

    <frameset rows="value,value">
    Defines the rows within a frameset, using number in pixels, or percentage of w idth

    <frameset cols="value,value">
    Defines the columns within a frameset, using number in pixels, or percentage of width

    <frame>
    Defines a single frame — or region — within a frameset

    <noframes></noframes>
    Defines what will appear on browsers that don't support frames

     

     

    Frames Attributes

    <frame src="URL">
    Specifies which HTML document should be displayed

    <frame name="name">
    Names the frame, or region, so it may be targeted by other frames

    <frame marginwidth=#>
    Defines the left and right margins for the frame; must be equal to or greater than 1

    <frame marginheight=#>
    Defines the top and bottom margins for the frame; must be equal to or greater than 1

    <frame scrolling=VALUE>
    Sets whether the frame has a scrollbar; value may equal "yes," "no," or "auto." The default, as in ordinary documents, is auto.

    <frame noresize>
    Prevents the user from resizing a frame

     

     

    Forms

    For functional forms, you'll have to run a CGI script. The HTML just creates the appearance of a form.

     

    <form></form>
    Creates all forms

    <select multiple name="NAME" size=?></select>
    Creates a scrolling menu. Size sets the number of menu items visible before you need to scroll.

    <option>
    Sets off each menu item

    <select name="NAME"></select>
    Creates a pulldown menu

    <option>
    Sets off each menu item

    <textarea name="NAME" cols=40 rows=8></textarea>
    Creates a text box area. Columns set the width; rows set the height.

    <input type="checkbox" name="NAME">
    Creates a checkbox. Text follows tag.

    <input type="radio" name="NAME" value="x">
    Creates a radio button. Text follows tag

    <input type=text name="foo" size=20>
    Creates a one-line text area. Size sets length, in characters.

    <input type="submit" value="NAME">
    Creates a Submit button

    <input type="image" border=0 name="NAME" src="name.gif">
    Creates a Submit button using an image

    <input type="reset">
    Creates a Reset button

    Reference   Special Characters


     

    ISO Entities

    Name Code

    Number Code

    Glyph

    Description

     

    &lsquo;

     

      

    left single quote

    &rsquo;

     

      

    right single quote

    &sbquo;

     

      

    single low-9 quote

    &ldquo;

     

      

    left double quote

    &rdquo;

     

      

    right double quote

    &bdquo;

     

      

    double low-9 quote

    &dagger;

     

      

    dagger

    &Dagger;

     

      

    double dagger

    &permil;

     

      

    per mill sign

    &lsaquo;

     

      

    single left-pointing angle quote

    &rsaquo;

     

      

    single right-pointing angle quote

    &spades;

     

    ?  

    black spade suit

    &clubs;

     

    ?  

    black club suit

    &hearts;

     

    ?  

    black heart suit

    &diams;

     

    ?  

    black diamond suit

    &oline;

     

    ?  

    overline, = spacing overscore

    &larr;

     

    ?  

    leftward arrow

    &uarr;

     

    ?  

    upward arrow

    &rarr;

     

    ?  

    rightward arrow

    &darr;

     

    ?  

    downward arrow

    &trade;

     

      

    trademark sign

     

    Name Code

    Number Code

    Glyph

    Description

     

     

    &#00;-
    &#08;

     

    unused

     

    &#09;

     

    horizontal tab

     

    &#10;

     

    line feed

     

    &#11;

     

    unused

     

    &#32;

     

    space

     

    &#33;

    !  

    exclamation mark

    &quot;

    &#34;

    "  

    double quotation mark

     

    &#35;

    #  

    number sign

     

    &#36;

    $  

    dollar sign

     

    &#37;

    %  

    percent sign

    &amp;

    &#38;

    &  

    ampersand

     

    &#39;

    '  

    apostrophe

     

    &#40;

    (  

    left parenthesis

     

    &#41;

    )  

    right parenthesis

     

    &#42;

    *  

    asterisk

     

    &#43;

    +  

    plus sign

     

    &#44;

    ,  

    comma

     

    &#45;

    -  

    hyphen

     

    &#46;

    .  

    period

     

    Name Code

    Number Code

    Glyph

    Description

     

    &frasl;

    &#47;

    /  

    slash

     

    &#48;-
    &#57;

     

    digits 0-9

     

    &#58;

    :  

    colon

     

    &#59;

    ;  

    semicolon

    &lt;

    &#60;

    <  

    less-than sign

     

    &#61;

    =  

    equals sign

    &gt;

    &#62;

    >  

    greater-than sign

     

    &#63;

    ?  

    question mark

     

    &#64;

    @  

    at sign

     

    &#65;-
    &#90;

     

    uppercase letters A-Z

     

    &#91;

    [  

    left square bracket

     

    &#92;

    \  

    backslash

     

    &#93;

    ]  

    right square bracket

     

    &#94;

    ^  

    caret

     

    &#95;

    _  

    horizontal bar (underscore)

     

    &#96;

    `  

    grave accent

     

    &#97;-
    &#122;

     

    lowercase letters a-z

     

    &#123;

    {  

    left curly brace

     

    &#124;

    |  

    vertical bar

     

    Name Code

    Number Code

    Glyph

    Description

     

    &#125;

    }  

    right curly brace

     

    &#126;

    ~  

    tilde

     

    &#127;-
    &#149;

     

    unused

    &ndash;

    &#150;

      

    en dash

    &mdash;

    &#151;

      

    em dash

     

    &#152;-
    &#159;

     

    unused

    &nbsp;

    &#160;

       

    nonbreaking space

    &iexcl;

    &#161;

    ¡  

    inverted exclamation

    &cent;

    &#162;

    ¢  

    cent sign

    &pound;

    &#163;

    £  

    pound sterling

    &curren;

    &#164;

    ¤  

    general currency sign

    &yen;

    &#165;

    ¥  

    yen sign

    &brvbar; or &brkbar;

    &#166;

    ¦  

    broken vertical bar

    &sect;

    &#167;

    §  

    section sign

    &uml; or &die;

    &#168;

    ¨  

    umlaut

    &copy;

    &#169;

    ©  

    copyright

    &ordf;

    &#170;

    ª  

    feminine ordinal

    &laquo;

    &#171;

    «  

    left angle quote

    &not;

    &#172;

    ¬  

    not sign

    &shy;

    &#173;

    ­  

    soft hyphen

    &reg;

    &#174;

    ®  

    registered trademark

    &macr; or &hibar;

    &#175;

    ¯  

    macron accent

     

    Name Code

    Number Code

    Glyph

    Description

    &deg;

    &#176;

    °  

    degree sign

    &plusmn;

    &#177;

    ±  

    plus or minus

    &sup2;

    &#178;

    ²  

    superscript two

    &sup3;

    &#179;

    ³  

    superscript three

    &acute;

    &#180;

    ´  

    acute accent

    &micro;

    &#181;

    µ  

    micro sign

    &para;

    &#182;

      

    paragraph sign

    &middot;

    &#183;

    ·  

    middle dot

    &cedil;

    &#184;

    ¸  

    cedilla

    &sup1;

    &#185;

    ¹  

    superscript one

    &ordm;

    &#186;

    º  

    masculine ordinal

    &raquo;

    &#187;

    »  

    right angle quote

    &frac14;

    &#188;

    ¼  

    one-fourth

    &frac12;

    &#189;

    ½  

    one-half

    &frac34;

    &#190;

    ¾  

    three-fourths

    &iquest;

    &#191;

    ¿  

    inverted question mark

    &Agrave;

    &#192;

    À  

    uppercase A, grave accent

    &Aacute;

    &#193;

    Á  

    uppercase A, acute accent

    &Acirc;

    &#194;

      

    uppercase A, circumflex accent

     

    Name Code

    Number Code

    Glyph

    Description

    &Atilde;

    &#195;

    Ă  

    uppercase A, tilde

    &Auml;

    &#196;

    Ä  

    uppercase A, umlaut

    &Aring;

    &#197;

    Å  

    uppercase A, ring

    &AElig;

    &#198;

    Æ  

    uppercase AE

    &Ccedil;

    &#199;

    Ç  

    uppercase C, cedilla

    &Egrave;

    &#200;

    È  

    uppercase E, grave accent

    &Eacute;

    &#201;

    É  

    uppercase E, acute accent

    &Ecirc;

    &#202;

    Ê  

    uppercase E, circumflex accent

    &Euml;

    &#203;

    Ë  

    uppercase E, umlaut

    &Igrave;

    &#204;

    ̀  

    uppercase I, grave accent

    &Iacute;

    &#205;

    Í  

    uppercase I, acute accent

    &Icirc;

    &#206;

    Π 

    uppercase I, circumflex accent

    &Iuml;

    &#207;

    Ï  

    uppercase I, umlaut

    &ETH;

    &#208;

    Đ  

    uppercase Eth, Icelandic

    &Ntilde;

    &#209;

    Ñ  

    uppercase N, tilde

    &Ograve;

    &#210;

    ̉  

    uppercase O, grave accent

    &Oacute;

    &#211;

    Ó  

    uppercase O, acute accent

    &Ocirc;

    &#212;

    Ô  

    uppercase O, circumflex accent

    &Otilde;

    &#213;

    Ơ  

    uppercase O, tilde

     

    Name Code

    Number Code

    Glyph

    Description

    &Ouml;

    &#214;

    Ö  

    uppercase O, umlaut

    &times;

    &#215;

    ×  

    multiplication sign

    &Oslash;

    &#216;

    Ø  

    uppercase O, slash

    &Ugrave;

    &#217;

    Ù  

    uppercase U, grave accent

    &Uacute;

    &#218;

    Ú  

    uppercase U, acute accent

    &Ucirc;

    &#219;

    Û  

    uppercase U, circumflex accent

    &Uuml;

    &#220;

    Ü  

    uppercase U, umlaut

    &Yacute;

    &#221;

    Ư  

    uppercase Y, acute accent

    &THORN;

    &#222;

    ̃  

    uppercase THORN, Icelandic

    &szlig;

    &#223;

    ß  

    lowercase sharps, German

    &agrave;

    &#224;

    à  

    lowercase a, grave accent

    &aacute;

    &#225;

    á  

    lowercase a, acute accent

    &acirc;

    &#226;

    â  

    lowercase a, circumflex accent

    &atilde;

    &#227;

    ă  

    lowercase a, tilde

    &auml;

    &#228;

    ä  

    lowercase a, umlaut

    &aring;

    &#229;

    å  

    lowercase a, ring

    &aelig;

    &#230;

    æ  

    lowercase ae

    &ccedil;

    &#231;

    ç  

    lowercase c, cedilla

    &egrave;

    &#232;

    è  

    lowercase e, grave accent

     

    Name Code

    Number Code

    Glyph

    Description

    &eacute;

    &#233;

    é  

    lowercase e, acute accent

    &ecirc;

    &#234;

    ê  

    lowercase e, circumflex accent

    &euml;

    &#235;

    ë  

    lowercase e, umlaut

    &igrave;

    &#236;

    ́  

    lowercase i, grave accent

    &iacute;

    &#237;

    í  

    lowercase i, acute accent

    &icirc;

    &#238;

    î  

    lowercase i, circumflex accent

    &iuml;

    &#239;

    ï  

    lowercase i, umlaut

    &eth;

    &#240;

    đ  

    lowercase eth, Icelandic

    &ntilde;

    &#241;

    ñ  

    lowercase n, tilde

    &ograve;

    &#242;

    ̣  

    lowercase o, grave accent

    &oacute;

    &#243;

    ó  

    lowercase o, acute accent

    &ocirc;

    &#244;

    ô  

    lowercase o, circumflex accent

    &otilde;

    &#245;

    ơ  

    lowercase o, tilde

    &ouml;

    &#246;

    ö  

    lowercase o, umlaut

    &divide;

    &#247;

    ÷  

    division sign

    &oslash;

    &#248;

    ø  

    lowercase o, slash

    &ugrave;

    &#249;

    ù  

    lowercase u, grave accent

    &uacute;

    &#250;

    ú  

    lowercase u, acute accent

    &ucirc;

    &#251;

    û  

    lowercase u, circumflex accent

     

    Name Code

    Number Code

    Glyph

    Description

    &uuml;

    &#252;

    ü  

    lowercase u, umlaut

    &yacute;

    &#253;

    ư  

    lowercase y, acute accent

    &thorn;

    &#254;

      

    lowercase thorn, Icelandic

    &yuml;

    &#255;

    ÿ  

    lowercase y, uml

     

    Reference   Stylesheets Guide

    Name of
    Property

    Rule syntax

    Possible values

    font-family

    <selector> {font-family:<value>}

    <family-name> (specify) or <generic-family>~ [serif, sans-serif*, cursive*, fantasy*, monospace]


    font-style

    <selector> {font-style:<value>}

    normal, italic


    font-weight

    <selector> {font-weight:<value>}

    normal*, bold, 100*, 200*, 300*, 400*, 500*, 600*, 700*, 800*, 900*


    font-size

    <selector> {font-size:<value>}

    <absolute-size>, <relative-size>*, <length>~~, <percentage>


    font $

    <selector> {font:<value>}

    <font-style>~~, <font-weight>*, <font-size>**, <font-family>**
     

    Color and Background

    Name of
    Property

    Rule syntax

    Possible values

    color

    <selector> {color:<value>}

    <color> (see "Units of Measure")


    background-color

    <selector> {background-color:<value>}

    <color> (see "Units of Measure")


    background-image

    <selector> {background-image: url(<value>)}

    URL (relative or absolute path)


    background $

    <selector>{background:<value>}

    <background-color> (i.e., <color>)
     

    Text properties

    Name of
    Property

    Rule syntax

    Possible values

    Text-decoration

    <selector>{text-decoration:<value>}

    underline, line-through


    text-transform

    <selector>{text-transform:<value>}

    capitalize*, uppercase*, lowercase*, none*


    text-align

    <selector>{text-align:<value>}

    left, right, center, justify*


    text-indent

    <selector>{text-indent:<value>}

    <length>, <percentage>
     

    Box properties

    Name of
    Property

    Rule syntax

    Possible values

    margin $

    <selector>{margin:<value>}

    <length>**, <percentage>**, auto(sequence: t r b l)


    margin-top

    <selector>{margin-top:<value>}

    <length>**, <percentage>, auto


    Margin-right

    <selector>{margin-right:<value>}

    <length>, <percentage>, auto


    margin-bottom*

    <selector>{margin-bottom:<value>}

    <length>*, <percentage>*, auto*


    margin-left

    <selector>{margin-left:<value>}

    <length>, <percentage>, auto


    padding $*

    <selector>{padding:<value>}

    <length>*, <percentage>*, (sequence: t r b l)


    padding-top*

    <selector>{padding-top:<value>}

    <length>*, <percentage>*


    padding-right*

    <selector>{padding-right:<value>}

    <length>*, <percentage>*


    padding-bottom*

    <selector>{padding-bottom:<value>}

    <length>*, <percentage>*


    padding-left*

    <selector>{padding-left:<value>}

    <length>*, <percentage>*


    border-color*

    <selector>{border-color:<value>}

    <color>*


    border-style*

    <selector>{border-style:<value>}

    solid*, double*, groove*, ridge*, inset*, outset*


    border $*

    <selector>{border:<value>}

    <border-width>*, <border-style>*, <color>

    Block-level and Replaced Elements

    width

    <selector>{width:<value>}

    <length>, <percentage>, auto


    height

    <selector>{height:<value>}

    <length>, auto


    float

    <selector>{float:<value>}

    left, right


    clear

    <selector>{clear:<value>}

    none, left*, right*
     

    Position (CSS - P)

    Name of
    Property

    Rule syntax

    Possible values

    position

    <selector>{position:<value>}

    absolute, relative


    top

    <selector>{top:<value>}

    <length>, <percentage>, auto


    left

    <selector>{left:<value>}

    <length>, <percentage>, auto


    visibility

    <selector>{visibility:<value>}

    hidden, visible, inherit


    z-index

    <selector>{z-index:<value>}

    <number>, auto


    overflow

    <selector>{overflow:<value>}

    visible, hidden, auto


    * = Not supported on IE 4/Mac
    ** = Buggy on IE 4/Mac
    ~ = Partially supported on IE 4/Mac
    ~~ = Partially supported on all 4 browsers
    $ = Shorthand Property

     

    Reference   Stylesheets Guide


    Individual Properties

    Style rules

    Comments

    p

    {font-family: Helvetica, Geneva;

    Of those listed, the first available font will be applied.

     

    font-style: italic;

    Text will be rendered as italic.

     

    font-weight: bold;

    Text will be rendered as bold.

     

    font-size: 10pt;

    Text will be rendered as 10-point type.

     

    color: #00FFFF;

    Text will be rendered to the hex color value #00FFFF.

     

    background-color: blue;

    The element's background color will be rendered as blue.

     

    background-image: url(images/foo.gif)}

    The element will have the background image(s) specified.


    .foo

    {text-decoration: underlined}

    Text in the class "foo" will be underlined.

     

    {text-transform: lowercase}

    Text in the class "foo" will be rendered as lowercase.


    #foo

    {text-align: center}

    Text with the ID "foo" will be center-aligned.

     

    {text-indent: 1em}

    Text with the ID "foo" will be indented 1 em.


    p

    {margin-top: 12px;

    The element's top margin will be 12 pixels.

     

    margin-bottom: 18px;

    The element's bottom margin will be 18 pixels.

     

    padding-right: 8pt;

    The element's right padding will be 8 points.

     

    padding-left: 4pt}

    The element's left padding will be 4 points.


    body

    {border-color: red;

    Borders will be red.

     

    border-style: solid}

    Borders will be solid.

    Block-level and replaced elements

    img

    {width: 20px;

    The element's width will be 20 pixels.

     

    height: 40px;

    The element's height will be 40 pixels.

     

    float: left}

    Text will flow to the left of the element.


    p

    {clear: left}

    Moves the element below a floating element placed on the left.

    Shorthand Properties

    Style rules

    Comments

    p

    {font: 10pt bold non-serif}

    Text will be rendered as 10-point bold non-serif type.

     

    {background: black}

    The element's background color will be black.

     

    {margin: 25px}

    All of the element's margins will be 25 pixels.

     

    {margin: 20px 10px 20px 10px}

    Top and bottom margins will be 20 pixels; left and right margins will be 10 pixels.


    body

    {padding: 2px}

    Padding will be 2 pixels on each side.

     

    {padding: 8px 4px 8px 4px}

    Top and bottom padding will be 8 pixels; left and right padding will be 4 pixels.

     

    {border: 2px solid red}

    There will be a red, solid border on all sides of the element.

    Position (CSS - P)

    Style rules

    Comments

    #foo

    {position: absolute; top: 15pt; left: 15pt}

    The element's absolute position will be set 15 points from the top and 15 points from the left.

     

    {visibility: hidden}

    The element's contents will be hidden.


    .foo

    {z-index: 2}

    The element's z-index will be two.


    p

    {overflow: visible}

    The element's contents will be rendered (visible) even if they exceed its height or width.

     

    {overflow: hidden}

    The element's contents will be clipped to its height and width, and no scrolling mechanism will be provided.

     

    A CSS declaration has two parts,

    a property ("color") and a value ("red").

    The basic syntax of a rule

    selector {property 1: value 1; property 2: value: 2} "

    An example (containing two declarations, as above)

    P {font-size: 8pt; color: red}

     

    Global (embedded) stylesheet declarations, applicable to an entire document, are defined within the <style> and </style> tags, which precede the <body> tag in the HTML document and are usually placed in the header.

    To embed a global stylesheet in your HTML document:

    <html>
    <head>
    <title>Title</title>
    <style type="text/css">
    <!--
    [STYLE INFORMATION GOES HERE]
    -->
    </style>
    </head>
    <body>
    [DOCUMENT BODY GOES HERE]
    </body>
    </html>

    Linked stylesheet declarations use a single stylesheet (in a separate file, saved with the .css suffix) to define multiple pages. A typical .css file is a text file containing style rules, as here:

    P {font-family: non-serif; font-size: medium; color: red}
    H1 {font-family: serif; font-size: x-large; color: green}
    H2 {font-family: serif; font-size: large; color: blue}

    To apply a .css stylesheet ("style.css" in the example below) to an HTML page, a <link> tag is added to the page header:

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

    Inheritance

    In cases where local, global, and linked style definitions conflict, the most specific stylesheet will generally take precedence: local overrides global, global overrides linked. Similarly, inline style attributes override ID, ID overrides class, and class overrides stylesheet-defined HTML elements.

    Attributes

    Class and ID

    Classes let you create grouping schemes among styled HTML tags by adding the style definition of a particular class to the style definitions of several different tags. In the stylesheet, a class name is preceded by a period (.) to identify it as such:

    .foo {property 1: value 1; property 2: value 2}

    A very simple example:

    <style>

    P {font-family: sans-serif; font-size: 10pt}
    H1 {font-family: serif; font-size: 30pt}
    H2 {font-family: serif; font-size: 24pt}
    .red {color: red}
    .green {color: green}
    .blue {color: blue}

    </style>

    The tags and classes can then be used in combination:

    <h1 class="red">This is rendered as 30-point red serif text.</h1>

    <p class="red">This is rendered as 10-point red sans-serif text.</p>

    Or not:

    <p>This is rendered as 10-point sans-serif text in the default color.</p>

    The ID attribute is used for a uniquely defined style within a stylesheet. In the stylesheet, an ID name is preceded by a hash mark (#) to identify it as such:

    #foo {property 1: value 1; property 2: value 2}
    <h2 id="foo">Text rendered in the foo style.<h2>

    Text-Level Attributes: <SPAN> and <DIV>

    The <span> tag is generally used to apply a style to inline text:

    <p><span class="foo">This text is rendered as foo-style</span> and this is not.

    The <div> tag is generally used to apply a style to a block of text, which can also include other HTML elements:

    <div class="foo">
    <p>The "foo" style will be applied to this text, and to <a href="page.html">this text</a> as well.
    </div>

    The style attribute provides a way to define a style for a single instance of an element:

    <p style="font-size: 10pt; color: red">This text is rendered as red, 10-point type</p>

    The class, ID, and style attributed can be applied within the <span> and <div> elements. Used with class or ID, the <span> and <div> tags work like customized HTML tags, letting you define logical containers and apply a style to their contents.

     

    Units of Measure
    Throughout this CSS reference guide, abstract values (notably values involving units of measure) appear between angle brackets: <color>. They should be replaced by actual values as indicated in the key below.

    Length Units

    <length> indicates a number followed by a unit of measure: 24px.

    The number can be an integer or a decimal fraction, and can be preceded by + or -.

    Units can be absolute or relative:

    Absolute: mm, cm, in, pt, pc (millimeters, centimeters, inches, points, picas)

    Relative: em, ex, px (the element's font height, the element's x-height, pixels)

    Font size may be defined in points, pixels, inches, or centimeters (pt, px, in, cm) or as a percentage.

    <absolute-size> can be: xx-small, x-small, small, medium, large, x-large, xx-large.

    <relative-size> can be: larger, smaller.

    Percentage Units

    <percentage> indicates a number followed by a % sign: 50%.

    In the text-indent, margin, padding, and width properties, percentage values are relative to the width of the parent element.

    In the font-size property, percentage values are relative to the font size of the parent element.

    In <color> values, percentages can be used to express RGB values.

    Color Units

    <color> can represent either <color-name> or <rgb> values, as defined below:

    <color-name> can be: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow

    <rgb> can be: #<hex><hex><hex> rgb(<number>, <number>, <number>) rgb(<percentage>,<percentage>,<percentage>) <hex> represents a hexidecimal value, <number> a decimal value, and <percentage> a percentage.

     

    Reference   Color Codes


    When you're adding a color to your Web page with HTML, sometimes you can just type in the name of the color. But more often than not, you'll need to use what's called the hex code, which is something that the browser will be able to understand. Choose a color from the list below and look to its left to get the hex code. If we wanted our background to be red, for example, we'd type bgcolor="#FF0000". Try it out!

    If you'd like to print this chart and you are using Internet Explorer, click on "Tools" and then "Advanced." Next, scroll down to "Printing" and make sure the "Print background colors and images" box is checked.

    Hex Code

    Color

    #FFFFFF

     

    #FFFFCC

     

    #FFFF99

     

    #FFFF66

     

    #FFFF33

     

    #FFFF00

     

    #FFCCFF

     

    #FFCCCC

     

    #FFCC99

     

    #FFCC66

     

    #FFCC33

     

    #FFCC00

     

    #FF99FF

     

    #FF99CC

     

    #FF9999

     

    #FF9966

     

    #FF9933

     

    #FF9900

     

    #FF66FF

     

    #FF66CC

     

    #FF6699

     

    #FF6666

     

    #FF6633

     

    #FF6600

     

    #FF33FF

     

    #FF33CC

     

    #FF3399

     

    #FF3366

     

    #FF3333

     

    #FF3300

     

    #FF00FF

     

    #FF00CC

     

    #FF0099

     

    #FF0066

     

    #FF0033

     

    #FF0000

     

     

     

    Hex Code

    Color

    #66FFFF

     

    #66FFCC

     

    #66FF99

     

    #66FF66

     

    #66FF33

     

    #66FF00

     

    #66CCFF

     

    #66CCCC

     

    #66CC99

     

    #66CC66

     

    #66CC33

     

    #66CC00

     

    #6699FF

     

    #6699CC

     

    #669999

     

    #669966

     

    #669933

     

    #669900

     

    #6666FF

     

    #6666CC

     

    #666699

     

    #666666

     

    #666633

     

    #666600

     

    #6633FF

     

    #6633CC

     

    #663399

     

    #663366

     

    #663333

     

    #663300

     

    #6600FF

     

    #6600CC

     

    #660099

     

    #660066

     

    #660033

     

    #660000

     

     

    Hex Code

    Color

    #CCFFFF

     

    #CCFFCC

     

    #CCFF99

     

    #CCFF66

     

    #CCFF33

     

    #CCFF00

     

    #CCCCFF

     

    #CCCCCC

     

    #CCCC99

     

    #CCCC66

     

    #CCCC33

     

    #CCCC00

     

    #CC99FF

     

    #CC99CC

     

    #CC9999

     

    #CC9966

     

    #CC9933

     

    #CC9900

     

    #CC66FF

     

    #CC66CC

     

    #CC6699

     

    #CC6666

     

    #CC6633

     

    #CC6600

     

    #CC33FF

     

    #CC33CC

     

    #CC3399

     

    #CC3366

     

    #CC3333

     

    #CC3300

     

    #CC00FF

     

    #CC00CC

     

    #CC0099

     

    #CC0066

     

    #CC0033

     

    #CC0000

     

     

     

    Hex Code

    Color

    #33FFFF

     

    #33FFCC

     

    #33FF99

     

    #33FF66

     

    #33FF33

     

    #33FF00

     

    #33CCFF

     

    #33CCCC

     

    #33CC99

     

    #33CC66

     

    #33CC33

     

    #33CC00

     

    #3399FF

     

    #3399CC

     

    #339999

     

    #339966

     

    #339933

     

    #339900

     

    #3366FF

     

    #3366CC

     

    #336699

     

    #336666

     

    #336633

     

    #336600

     

    #3333FF

     

    #3333CC

     

    #333399

     

    #333366

     

    #333333

     

    #333300

     

    #3300FF

     

    #3300CC

     

    #330099

     

    #330066

     

    #330033

     

    #330000

     

     

    Hex Code

    Color

    #99FFFF

     

    #99FFCC

     

    #99FF99

     

    #99FF66

     

    #99FF33

     

    #99FF00

     

    #99CCFF

     

    #99CCCC

     

    #99CC99

     

    #99CC66

     

    #99CC33

     

    #99CC00

     

    #9999FF

     

    #9999CC

     

    #999999

     

    #999966

     

    #999933

     

    #999900

     

    #9966FF

     

    #9966CC

     

    #996699

     

    #996666

     

    #996633

     

    #996600

     

    #9933FF

     

    #9933CC

     

    #993399

     

    #993366

     

    #993333

     

    #993300

     

    #9900FF

     

    #9900CC

     

    #990099

     

    #990066

     

    #990033

     

    #990000

     

     

     

    Hex Code

    Color

    #00FFFF

     

    #00FFCC

     

    #00FF99

     

    #00FF66

     

    #00FF33

     

    #00FF00

     

    #00CCFF

     

    #00CCCC

     

    #00CC99

     

    #00CC66

     

    #00CC33

     

    #00CC00

     

    #0099FF

     

    #0099CC

     

    #009999

     

    #009966