TimKeesling.com
CSS Week 1 Review


  1. Many tags do not have to be closed such as the <p> tag and the <li> tag. Why is it important to have an opening and a closing tag when using STYLES?
    • The closing tag (example - <strong>This text will be bold type</strong>) tells the browser that your definition is complete.


  2. What is an inline style? Please provide an example.
    • <span style="color: #ff0000; background-color: #ffffff;">This text will be red</span>


  3. What is a document level style? Please provide an example.
    •          <head>
               <title>Embedded Stylesheet<title>
               <style type="text/css">
               <!--
               h1 {
                 font-size: 1.8em;
                 color: #000000;
                 background-color: #ffffff;  
               }   
               -->
               <style>
               </head>


  4. What is a linked style? Please provide an example.
    •          <head>
               <title>Linked External Stylesheet<title>
               <link rel="stylesheet" type="text/css" href="stylesheet.css" />
               </head>


  5. In the CSS code h1 { font-family: helvetica, arial, sans-serif; }, which font value is given first priority?
    • a. helvetica


  6. What does the cascade refer to in Cascading Style Sheets?
    • If there is a conflict in styles i.e. the same property has been redeclared, the rule that comes later in the cascade (nearer to the actual element) wins. The later in the cascade the more likely it is to effect an element, this applies not only to an external stylesheet but to all the varying methods of applying styles, even the use of multiple classes.


  7. All class names begin with
    • c. a period (.).


  8. Convert the following statement using CSS.
    • Before Conversion: <font color="#008000" face="Arial">This text is green and in Arial font</font>
    • After Conversion: <span style="color: #008000; background-color: inherit; font-family: Arial, sans-serif;">This text is green and in Arial font</span>