Html Course

In HTML you can create various types of lists: unordered (UL), ordered (OL).
These HTML lists are block-level elements.

Unordered Lists - UL

An unordered list (also called 'bulleted list') starts with a <ul> tag and ends with </ul>.
Within the list, each item is added between <li> and </li> tag.
The list items are marked with bullets.

- Example:
<h4>Example UL</h4>

 <li>HTML course</li>
 <li>CSS Course</li>
 <li>PHP - MySQL</li>

You can set three different types of bullets: disc, circle, and square. They are defined with the list-style-type CSS property, in style.
• 'disc' is the default bullet type, so you don't need to specify it.

- Example:
<h4>Example UL - circle, square</h4>

With 'circle' type:
<ul style='list-style-type:circle'>
 <li>HTML course</li>
 <li>CSS Course</li>
 <li>PHP - MySQL</li>

With 'square' type:
<ul style='list-style-type:square'>
 <li>HTML course</li>
 <li>CSS Course</li>
 <li>PHP - MySQL</li>

Ordered Lists - OL

An ordered list (also called 'numbered list') is a block element that begins with an <ol> tag and ends with </ol>, it displays the lists with numeric order.
The content for lists is added between <li> and </li>.
The default type of numbered list uses standard numbers.

- Example:
<h4>Example OL</h4>

 <li>HTML lessons</li>
 <li>Ajax tutorials</li>
 <li>JavaScript course</li>

Types of OL lists

You can specify different types of numbering by adding the type attribute to the <ol> tag, as described in the following list:

- Example:
<h4>Example OL with type</h4>

<ol type='a'>
<li>List item 1 ...</li>
<li>List item 2 ...</li>
<li>List item 3 ...</li>

- Another list, type='I':
<ol type='I'>
<li>List item 1 ...</li>
<li>List item 2 ...</li>
<li>List item 3 ...</li>

Also, see this CSS tutorial, Define Custom List-item Markers, Bullets for UL, OL Lists:

The start and reversed attributes

By default, HTML starts each numbered list with 1 or the equivalent in the numbering scheme used (i, I , a , A).
To change the starting number, add the start attribute to the <ol> tag, and specify the appropriate number.
The numerotation of the lists can be reversed with the reversed attribute.

In the next example there are two ordered lists, with different types, start and reversed:
<h4>Example OL with start and reversed</h4>

OL with start='3'
<ol start='3'>
<li>List item 1 ...</li>
<li>List item 2 ...</li>
<li>List item 3 ...</li>

- Another list: type='i', start='3' and reversed:
<ol type='i' start='3' reversed>
<li>List item 1 ...</li>
<li>List item 2 ...</li>
<li>List item 3 ...</li>
• The <li> tag is a block-level element, you can add within it any type of content, <p>, <div>, <ul>, or other block-level elements.
Example: <li> with paragraph, and nested list:
<h4>Example nested list</h4>

 <li><p>Here is a paragraph<br />
 A new line in the paragraph.</p></li>
 <li>HTML lessons:
 <ul type='square'>
 <li>Adding images</li>
 <li>DIV and SPAN</li>
 <li>Another list item</li>

Note, all he content of the nested <ul> ... </ul> is added within a <li> </li>.

Daily Test with Code Example

Which type of <input> creates input fields that should contain a numeric value?
type="text" type="number" type="date"
<input type="number" name="points" min="5" max="80" />
Which CSS property allows to change the transparency of an element?
font-style opacity color
#id {
  filter:alpha(opacity=40);    /* for IE */
Click on the function that formats a number to specified number of characters.
toPrecision() exp() toFixed()
var num = 12.34567;
alert( num.toPrecision(3) );       // 12.3
Which function randomizes the order of the elements into an array?
natsort() shuffle() sort()
$lang =[10=>"PHP", 20=>"JavaScript", "site"=>"");
var_export($lang);     // array (0=>"", 1=>"PHP", 2=>"JavaScript")
HTML Lists - UL, OL

Last accessed pages

  1. PHP Script Website Mini-Traffic (5099)
  2. Bind Tool and Control Points (3457)
  3. Convert BBCode to HTML and HTML to BBCode with JavaScript (6640)
  4. EasyPhpThumbnail Class (1494)
  5. Ajax-PHP Chat Script (45256)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (233)
  2. PHP-MySQL free course, online tutorials PHP MySQL code (158)
  3. Read Excel file data in PHP - PhpExcelReader (147)
  4. querySelector and querySelectorAll (105)
  5. Wake Up! (101)