![]() |
Practice Assignment
2 |
The purpose of Practice 2 is to create an ORDERED LIST which includes a NESTED UNORDERED LIST of at least two links followed by a NESTED ORDERED LIST of at least two links to Web sites you like or visit frequently. You will have to use the URLs to these sites in the link code and an appropriate text for the link that describes the site. Study the sample codes below for creating lists:
Browser Windows | |
---|---|
|
|
HTML Code | |
Nested Ordered Lists | Nested Ordered & Unordered Lists |
<ol type="1"> <li>Item 1 <ol type="A"> <li>sub item a</li> <li>sub item b</li> </ol> </li> <li>Item 2 <ol type="a"> <li>etc.</li> <li>. . .</li> </ol> </li> </ol> |
<ol type="I"> <li>Item 1 <ul type="square"> <li>sub item a</li> <li>sub item b</li> </ul> </li> <li>Item 2 <ul type="circle"> <li>etc.</li> <li>. . .</li> </ul> </li> </ol> |
The above code does not use Cascading Style Sheets (CSS) to format the lists as it requires more explanation than intended for this exercise. During class, we will look at the CSS options for lists. NOTE: Some of the code listed above is depricated.
Ordered list – creates a list with a specified hierarchy. By default it is 1, 2, 3, etc.
Code in <body> area How it looks in the browser
<ol>
<li>content goes here</li> 1. Content goes here
<li>content goes here</li> 2. Content goes here
<li>content goes here</li> 3. Content goes here
</ol>
If you wanted to have your list use a different symbol for the hierarchy you can specify the type of number or letter your list uses. For an ordered list you can specify with CSS the kind of symbol that should be used in the ordered list:
Choose upper-alpha for uppercase letters (A, B, C,...), lower-alpha for lowercase letters (a, b, c, ...), upper-roman for uppercase Roman numerals (I, II, III, ...), lower-roman for lowercase Roman numerals (i, ii, iii, ...) and number for numbers, which, as mentined, is the default.
You create the ordered list in the html of the body then specify the following CSS in the style area of the head section:
ol {list-style-type: upper-alpha;}
This would cause your list to use upper case letters: A, B, C, etc.
Unordered list – creates a list with an unspecified hierarchy. By default it is a solid ● disc.
Code in <body> area How it looks in the browser
<ul>
<li>content goes here</li> ● Content goes here
<li>content goes here</li> ● Content goes here
<li>content goes here</li> ● Content goes here
</ul>
To specify the bullet for an unordered list use disc for a solid round bullet (default for first level lists), circle for an empty round bullet (default for second level lists), square for square bullets (default for third level and subsequent lists)
You create the unordered list in the html of the body then specify the following CSS in the style area of the head section:
ul {list-style-type: square;}
This would cause your list to use a square ■ bullet. See CSS Lists for more examples.
In the example below there is one ordered list that has one nested unordered list and one nested ordered list.
This will be considered Practice 2 of the Web practices for Project 2B - Part 3. We will have worked on this together in class so that you should have:
<a href="http://www.google.com/" target="_blank">Search Google</a>
Click on the link below to get a copy of the RGB Hex Triplet Color Chart.
RGB Hex Triplet Color Chart
The chart will give you the hexadecimal code for other colors you may want to use in your page.
Practice 2 is 20% of the web practices grade.