type (HTML attribute)

Spec
Depr. Version
Yes HTML 2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

type=" { circle | disc | square } "

Description

The type attribute allows the developer to apply some basic alternative styling to the bullet point that accompanies each list item.

This attribute is now deprecated, and is highly presentational in its nature. The desired visual effects can all be achieved with CSS and, as such, this attribute shouldn’t be used—it’s presented here for informational purposes only.

Example

This example shows type applied to the navigation block we saw earlier:

<ul type="circle">
  <li><a href="/">Home</a></li>
  <li><a href="/about/">About Us</a></li>
  <li><a href="/portfolio/">Portfolio</a></li>
  <li><a href="/clients/">Clients</a></li>
  <li><a href="/contact/">Contact Us</a></li>
</ul>

This code would render as shown in Figure 1.

Figure 1. An unordered list with type="circle" unordered list with list glyph type of circle

Here’s the same list, using a type value of "square":

<ul type="square">
  <li><a href="/">Home</a></li>
  <li><a href="/about/">About Us</a></li>
  <li><a href="/portfolio/">Portfolio</a></li>
  <li><a href="/clients/">Clients</a></li>
  <li><a href="/contact/">Contact Us</a></li>
</ul>

This code would render as shown in Figure 2.

Figure 2. An unordered list with type="square" unordered list with list glyph type of circle

Value

The options are "disc" (the browser default: a filled circle), "circle" (an outline of a circle that’s not filled in), and "square" (a filled square, not an outline).

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

Good support is provided for the type attribute. However, given that it’s a deprecated attribute whose effects can be achieved—and massively improved upon—using CSS (for example, you can use background imagery of your choosing, rather than picking from a small selection of basic glyphs), you can avoid using this attribute altogether.

User-contributed notes

There are no comments yet.

Related Products