HTML Selector - Redefining a Tag

The HTML Selector type of cascading style sheet adds new values to a tag while usually maintaining the original tag's meaning. For example, you can redefine the italics tag to be bold and 42 points and it will still also apply the italics format to the text.

Here is an example of how to make the bold tag do more.

Your assignment:

  1. Open up the source code for this file in Notepad or your favorite ASCII text editor.
  2. Redefine the italics tag ( i ) to be:
  3. Follow the example in the code in the <style> tag in the head of this document for the syntax needed. You will see some comments above it in the code as well that might help you.
  4. What you will need to do the following, which is very similar to what is within the existing style tag for redefining the "b" tag:
    1. After the closing curly brace of the bold tag's redefinition, start a new row in the code and type in an "i".
    2. Follow it by an opening "curly brace".
    3. Then use the following CSS properties along with the values specified above (60 points, courier) but be sure to write the rule using the correct syntax (colon, semi-colon, etc.). The same properties were also used in the redefinition of the bold tag that is already there. Follow that as an example of how to specify the following using the values in step 2:
      • font-family
      • font-size
    4. Then put in a curly brace at the end
  5. Apply the italics tag to the following word right here within the instructions: WORD.
  6. Once you save the file and then view it in your browser you ought to see the difference. Save the file as:
    CSS_Redefine_Tag_yourlastname.html
  7. Send it to me by email.

© 2008 Dan Hitchcock Vaughan and its licensors. All rights reserved.