Skip to main contentdfsdf

      • Cascading Order

          

        What style will be used when there is more than one style specified for an HTML element?
         
         
         Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority: 

         
           
        1. Browser default
        2.  
        3. External style sheet
        4.  
        5. Internal style sheet (inside the <head> tag)
        6.  
        7. Inline style (inside an HTML element)
        8.  
         

        So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default value).

    • Styles can be specified inside a single HTML element, inside the <head> element of an HTML page, or in an external CSS file. Even multiple external style sheets can be referenced inside a single HTML document. 
    • There are three ways of inserting a style sheet: 

        

      External Style Sheet

    • Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section: 

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

    5 more annotations...

    • The CSS syntax is made up of three parts: a selector, a property and a value:

       
       
      selector {property: value}
    • The CSS syntax is made up of three parts: a selector, a property and a value:

       
       
      selector {property: value}
        

      The selector is normally the HTML element/tag you wish to define, the property is the attribute you wish to change, and each property can take a value. The property and value are separated by a colon, and surrounded by curly braces:

       
       
      body {color: black}

    5 more annotations...

1 - 3 of 3
20 items/page
List Comments (0)