Difference between revisions of "HTML:Lists"

From mi-linux
Jump to navigationJump to search
(New page: ''This page has been written by Cara Hughes (0615410).'' == Lists == In HTML you can create lists. These are a list of items, such as links. The two main types are Ordered and Unordered....)
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Main Page]] >> [[4CC002|Website fundamentals]] >> [[4CC002Workbook|Workbook]] >> [[HTML]] >> Lists
 +
 
''This page has been written by Cara Hughes (0615410).''
 
''This page has been written by Cara Hughes (0615410).''
  
 
== Lists ==
 
== Lists ==
  
In HTML you can create lists. These are a list of items, such as links. The two main types are Ordered and Unordered.
+
In HTML you can create lists. The three main types are Ordered, Unordered and Definition.
 +
 
 +
Every list must have a list item, such as a link, image or paragraphs. Lists can be nested into other lists, too.
 +
 
 +
Browsers use lists to detirmine how to render and display content on a page. All HTML is used for content, and CSS is used to control the style.
  
=== What is an Ordered list? ===
+
== Ordered lists ==
  
 
An Ordered list is a list with an order such as a recipe or a step-by-step guide. The items are listed with numbers.
 
An Ordered list is a list with an order such as a recipe or a step-by-step guide. The items are listed with numbers.
  
=== What is an Unordered list? ===
+
To create an ordered list, you need this tag:
 +
 
 +
<nowiki> <OL> </nowiki>
 +
 
 +
For each list item, you need this tag:
 +
 
 +
<nowiki> <LI> </nowiki>
 +
 
 +
An ordered list is coded like this:
  
An Unordered list is a list with a no specific structure, such as a list of names or a shopping list. The items are listed with bullet points.
+
<nowiki>
 +
  <OL>
 +
    <LI> Pour ingredients into bowl </LI>
 +
    <LI> Mix ingredients </LI>
 +
    <LI> Bake in oven </LI>
 +
  </OL>
 +
</nowiki>
  
== Coding a list ==
+
== Unordered lists ==
  
The coding stucture for lists are reasonably straight-forward. To create a list you need these tags:
+
An unordered list is a list with a no specific structure, such as a list of names or a shopping list. Navigational menus use unordered lists.  
  
<nowiki> <UL> or <OL> </nowiki>
+
The items are listed with bullet points. Unless they have been specified using CSS, most browers render or display bullet points with the default circle. With CSS you can choose what bullet point to use and even include your own image.
  
If you are creating an unordered list you need to use
+
To create an unordered list, you need this tag:
<nowiki> <UL> </nowiki>
 
  
and for an ordered list you need
+
  <nowiki> <UL> </nowiki>
  <nowiki> <OL> </nowiki>
 
  
For each item in the list, you need:
+
For each list item, you need this tag:
  
  <nowiki> <LI> </LI> </nowiki>
+
  <nowiki> <LI> </nowiki>
  
This is what an unordered list could look like:
+
An unordered list is coded like this:
  
 
  <nowiki>  
 
  <nowiki>  
 
   <UL>
 
   <UL>
     <LI> Keyboard </LI>
+
     <LI> Cat </LI>
     <LI> Mouse </LI>
+
     <LI> Dog </LI>
     <LI> Speakers </LI>
+
     <LI> Fish </LI>
 
   </UL>
 
   </UL>
 
  </nowiki>
 
  </nowiki>
  
An ordered list could look like:
+
== What is a Definition list? ==
 +
 
 +
A definition list is '''not''' a list of items. As the name suggests, they define or explain an item in a list.
 +
 
 +
Each item in the list is called a ''Term'', and each description or explaination is called a ''Definition'', like in a dictionary.Like in the other lists, you can use paragraphs, links or images for each item.
  
  <nowiki>
+
To start a definition list, you need the following tag:
   <OL>
+
 
     <LI> Empty ingredients into bowl </LI>
+
<nowiki> <DL> </nowiki>
     <LI> Mix </LI>
+
 
    <LI> Bake for 30 minutes </LI>
+
For each term in the list, you need this tag:
   </OL>
+
 
 +
<nowiki> <DT> </nowiki>
 +
 
 +
And for the definition for each term, you need this tag:
 +
 
 +
<nowiki> <DD> </nowiki>
 +
 
 +
An example of code for a definition list is:
 +
 
 +
  <nowiki>  
 +
   <DL>
 +
     <DT> HTML </DT>
 +
      <DD> Hypertext Markup Language </DD>
 +
     <DT> CSS </DT>
 +
      <DD> Cascading Style Sheets </DD>
 +
   </DL>
 
  </nowiki>
 
  </nowiki>
  
 +
== Attributes and Values ==
 +
 +
You can use these attributes in a list:
 +
 +
<nowiki> type </nowiki>
 +
 +
This attribute lets you choose the style of the bullet points. The values are disc, circle, square, 1, A, a, I, i . For an ordered list, you can only choose numbers.
 +
 +
<nowiki> start </nowiki>
 +
 +
In an ordered list, this attribute lets you specify what number to start counting from.
 +
 +
== Practising with lists ==
  
''This section has been written by Cara Hughes (0615410).''
+
I found that practising writing shopping and to-do lists in HTML code helped me remember. When you can do them, try styling them with CSS. It's amazing what you can do!

Latest revision as of 16:01, 12 July 2011

Main Page >> Website fundamentals >> Workbook >> HTML >> Lists

This page has been written by Cara Hughes (0615410).

Lists

In HTML you can create lists. The three main types are Ordered, Unordered and Definition.

Every list must have a list item, such as a link, image or paragraphs. Lists can be nested into other lists, too.

Browsers use lists to detirmine how to render and display content on a page. All HTML is used for content, and CSS is used to control the style.

Ordered lists

An Ordered list is a list with an order such as a recipe or a step-by-step guide. The items are listed with numbers.

To create an ordered list, you need this tag:

 <OL> 

For each list item, you need this tag:

 <LI> 

An ordered list is coded like this:

 
   <OL>
     <LI> Pour ingredients into bowl </LI>
     <LI> Mix ingredients </LI>
     <LI> Bake in oven </LI>
   </OL>
 

Unordered lists

An unordered list is a list with a no specific structure, such as a list of names or a shopping list. Navigational menus use unordered lists.

The items are listed with bullet points. Unless they have been specified using CSS, most browers render or display bullet points with the default circle. With CSS you can choose what bullet point to use and even include your own image.

To create an unordered list, you need this tag:

 <UL> 

For each list item, you need this tag:

 <LI> 

An unordered list is coded like this:

 
   <UL>
     <LI> Cat </LI>
     <LI> Dog </LI>
     <LI> Fish </LI>
   </UL>
 

What is a Definition list?

A definition list is not a list of items. As the name suggests, they define or explain an item in a list.

Each item in the list is called a Term, and each description or explaination is called a Definition, like in a dictionary.Like in the other lists, you can use paragraphs, links or images for each item.

To start a definition list, you need the following tag:

 <DL> 

For each term in the list, you need this tag:

 <DT> 

And for the definition for each term, you need this tag:

 <DD> 

An example of code for a definition list is:

 
   <DL>
     <DT> HTML </DT>
       <DD> Hypertext Markup Language </DD>
     <DT> CSS </DT>
       <DD> Cascading Style Sheets </DD>
   </DL>
 

Attributes and Values

You can use these attributes in a list:

 type 

This attribute lets you choose the style of the bullet points. The values are disc, circle, square, 1, A, a, I, i . For an ordered list, you can only choose numbers.

 start 

In an ordered list, this attribute lets you specify what number to start counting from.

Practising with lists

I found that practising writing shopping and to-do lists in HTML code helped me remember. When you can do them, try styling them with CSS. It's amazing what you can do!