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>

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

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>
</ul><br>

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

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>

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

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>
</ol><br>

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

Also, see this CSS tutorial, Define Custom List-item Markers, Bullets for UL, OL Lists:
coursesweb.net/css/define-custom-list-item-markers-bullets-ul-ol


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>
</ol><br>

- 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>
</ol>
• 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>

<ol>
 <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>
 </ul>
 </li>
 <li>Another list item</li>
</ol>

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

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which meta tag provides a short description of the page?
<meta content="..."> <meta description="..."> <meta http-equiv="...">
<meta name="description" content="70-160 characters that describes the content of the page" />
Which CSS property is used to stop the wrapping effect of the "float"?
clear text-align position
#some_id {
  clear: both;
}
Click on the method which gets an array with all the elements in the document that have a specified tag name.
getElementsByName() getElementById() getElementsByTagName()
var divs = document.getElementsByTagName("div");
var nr_divs = divs.length;
alert(nr_divs);
Indicate the PHP function which returns the number of elements in array.
is_[) count() strlen()
$arr =[7, 8, "abc", 10);
$nri = count($arr);
echo $nri;        // 4
HTML Lists - UL, OL

Last accessed pages

  1. Get Attribute (ID, Class, Name, Title, Src) with jQuery (74439)
  2. Node.js Move and Copy file (28290)
  3. AJAX with POST and PHP (18849)
  4. JQZoom Image Magnifier (12975)
  5. Change CSS file with jQuery (5381)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (201)
  2. Read Excel file data in PHP - PhpExcelReader (66)
  3. The Mastery of Love (56)
  4. PHP Unzipper - Extract Zip, Rar Archives (51)
  5. Working with MySQL Database (34)
Chat
Chat or leave a message for the other users
Full screenInchide