Lesson Practice 2-4:
Make a List!
Task 1: Create a Bulleted List
- Open template.htm.
- In the title element, add the title: Unordered or Bulleted Lists
- Add an h1 element with the same text.
- Add the list:
- Between the body tags, type the unordered list element tags.
- Between the <ul> tags, add a list item element.
- Between the list item tags, type:
This is the first item.
- In the same manner, before the closing </ul> tag, add three more list items with appropriate text.
- Indent each list item in your coding by adding 2-3 spaces before the opening <li> tags.
- Save the file as ulist.htm and display in the browser. You should see a bulleted list with the four items.
- Format the bullet characters:
- Return to the file and edit by adding a second unordered list element.
The next attributes will later be replaced by CSS styles, as mentioned before.
- Between the tags, add three list items as follows:
<li type= “square”>This makes the bullet a square.</li>
<li type= “circle”>This makes the bullet a circle.</li>
<li type= “disc”>This makes the bullet a disc.</li>
- Indent the list items as before.
- Save the file in your text folder as list1.htm and display it in the browser. When you are satisfied with your list, save and close.
Task 2: Create a Multi-Level List
- Open (or return to) ulist.htm in notepad++.
- Resave the file using the new filename ulist2.htm. Change the title and h1 element text to:
A Multi-Level List
- Add a sublist:
- Inside the first set of <li> tags, after the text (after “This is the first list item”), press enter and type <ul>
- Indent this opening sublist tag 2-3 spaces to the right.
- Add a line that says: <li>This is a sub point.</li>
- Add another line that says: <li>This is another sub point.</li>
- Indent both sublist items to the right their list items
- Close out the sub list with </ul>, backing up the indenting to 'match' its opening <ul> tag.
- Save and preview the file - there should be a two bullet sublist under the first list item of the main list.
- Create more sublists:
- Return to the htm file. Repeat the steps to create a sub-list three more times - you will add a sublist to each of the other three main list item elements.
- Indent the sublists and subitems properly.
- Save the file and display in the browser. You should have four main level bullets, each with two sub-bullets under it.
- Create a sub-sub-list:
- Choose one list item from one of the sublists.
- Create another sublist consisting of three list items, under this chosen sub-item.
- Indent the list and items properly.
- Save in your text folder and preview. When you are satisfied with your lists, save and close.
Task 3: Create a Numbered List
- Open template.htm.
- In the title element, add the title: Ordered or Numbered Lists
- Add an h1 element with the same text.
- Create an ordered list:
- Between the body tags, type a set of ordered list tags.
- Between the <ol> tags, type:
<li>Ordered lists display items with numbers</li>
<li>But HTML doesn’t sort the items</li>
<li>It only numbers them</li>
<li>You have to set the correct arrangement yourself</li>
- Indent the list items as before.
- Save the file as olist.htm and display in the browser. When you are satisfied with your work, save and close.
- Format the numbering characters:
- Return to the file and add another ordered list element.
The next attributes will later be replaced by CSS styles, as mentioned before.
- In the opening tag, add the attributes: type= “I” start= “10”
- Add the list items:
This is the tenth list item.
This is the eleventh list item.
This is the twelfth list item.
This is the thirteenth list item.
- Indent the list items properly.
- Save the file in your text folder and display in the browser to see the result. When you are satisfied with your work, save and close.
Exercise 4: Create an Outline
- Open template.htm.
- In the title element, add the title: A Sample Outline
- Add an h1 element with the same text.
- Create the outline:
- Between the body tags, type the following, indenting as illustrated:
<ol type= “I”>
<li> First Main Point
<ol type= “A”>
<li> First Sub-point</li>
<li> Second Sub-point</li>
</ol>
</li>
<li> Second Main Point</li>
<li> Third Main Point</li>
</ol>
- Examine the coding, and notice how the lists are nested.
- Complete outline, adding properly indented Roman numeral list items to the 2nd and 3rd main points.
- Save the file as olist2.htm and display in the browser. When you are satisfied with your work, save and close.
Exercise 5: Create a Definition List
- Open template.htm.
- In the title element, add the title: A Definition List
- Between the body tags, type the following, indenting as illustrated:
<dl >
<dt>HTML</dt>
<dd>HTML stands for HyperText Markup Language</dd>
<dt>Element</dt>
<dd>An <u>element</u> is made up of two tags.</dd>
<dt>Attribute</dt>
<dd>An <i>attribute</i> describes an element’s characteristics.</dd>
<dt>Value</dt>
<dd>A <b>value</b> identifies a specific characteristic.</dd>
</dl>
- Examine the coding, and notice elements are arranged.
- Save the file as dlist.htm and display in the browser to see the result. When you are satisfied with your work, save and close.
Exercise 6: Redesign the Link Section and Add List-links to your Home Page
- Open your file index.htm.
- Create a definition list element to contain the entire link section.
- Change each category paragraph element to a definition term element.
- Change each link paragraph to a definition definition element.
- In the Links Pages section, add five new <dd> elements.
- Link each to one of your list files, using the page title for the link text.
- Add the title=" " attribute to each, using the filename of the page.
- Properly indent your definition list.
- Save and preview, testing the links, and making any adjustments needed.
- Publish your new files, as well as your updated index file to your folder of the class Share file.
- Open the index file in the new location and test your links.
|