CodesJava

Easy learning with example program codes

ul HTML

HTML <ul> Tag

As the name itself suggests, all the list items are marked with bullets by default in a Bulleted List. It is popularly known as HTML Unordered List and hence starts with the <ul> tag. The list items in an HTML Unordered List starts with the <li> tag.

Tag specific Attributes:

AttributeValueUses
compactcompactUsed to indicate that the list will be displayed smaller than normal.Not supported in HTML5.
typedisc

square

circle

Used to indicate the type of marker to be used in the list.Not supported in HTML5.

Global Attributes:

The HTML Global attributes are supported by the HTML <ul> tag.

Event Attributes:

The HTML Event attributes are supported by the HTML <ul> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera and Safari.

Example: Type “disc”

<!DOCTYPE html>
<html>
<body>
<h2>HTML Unordered List or Bulleted List</h2>
<ul>
  <li>Name</li>
  <li>Age</li>
  <li>Address</li>
</ul>  
</body>
</html>

Output:

Explanation:

In the above example, we created an unordered or bulleted list of the default type in HTML containing three items.

Example: Type “circle”

<!DOCTYPE html>
<html>
<body>
<h2>HTML Unordered List or Bulleted List</h2>
<ul type = "circle">
  <li>Name</li>
  <li>Age</li>
  <li>Address</li>
</ul>  
</body>
</html>

Output:

Explanation:

In the above example, we created an unordered or bulleted list of the type “circle” in HTML containing three items.

Example: Type “square”

<!DOCTYPE html>
<html>
<body>
<h2>HTML Unordered List or Bulleted List</h2>
<ul type = "square">
  <li>Name</li>
  <li>Age</li>
  <li>Address</li>
</ul>  
</body>
</html>

Output:

Explanation:

In the above example, we created an unordered or bulleted list of the type “square” in HTML containing three items.

Example: Type “none”

<!DOCTYPE html>
<html>
<body>
<h2>HTML Unordered List or Bulleted List</h2>
<ul type = "none">
  <li>Name</li>
  <li>Age</li>
  <li>Address</li>
</ul>  
</body>
</html>

Output:

Explanation:

In the above example, we created an unordered or bulleted list without any marking in HTML containing three items.

Please follow and like us:
error
Posted in HTML   









Copyright © 2019 CodesJava DMCA.com Protection Status