Attributes and their values

This assignment will let you experiment with the attributes of the <hr /> tag and test your understanding of the terms tag, attribute and value.

Create a Web page with two paragraphs separated by a horizontal rule. The paragraphs can say anything you wish.

To create the horizontal rule, use the following HTML:

<hr color = "blue" size="5" width ="100" align = "center" />

Now experiment with the values of the attributes, and change the horizontal rule so that it is that is 20 pixels tall, 300 pixels wide, red, and on the left hand side of the window.

Do a second experiment in which the horizontal rule is the same except that its width is 50% of the window no matter how you resize it. (Be sure to resize the window to see if the horizontal rule resizes correctly).

If you cannot figure out how to do these experiments, check the W3Schools Web site, but do not do the experiments there, do them using Notepad and a browser on your computer.

Print out and turn in the HTML source and the resulting page displayed in a browser window for the original page and for both of your experiments.

Also answer the following questions:

  1. Is Width a tag, an attribute or a value?
  2. Is <hr /> a tag, an attribute or a value?
  3. Is Red a tag, an attribute or a value?
  4. What happens if you use the <hr> tag without any attributes?
  5. Does the order of the attributes within a tag make a difference?

Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.