Images as Bullet Characters

Some people opt to create their own bullet characters for bulleted lists instead of using the characters that browsers provide. To do this, you need to place the bullet graphic with an <img /> element and follow it with a list item:

<img src="bullet.gif" width="12" height="12" alt="*">XHTML<br />
<img src="bullet.gif" width="12" height="12" alt="*">XML<br />
<img src="bullet.gif" width="12" height="12" alt="*">Java<br />
<img src="bullet.gif" width="12" height="12" alt="*">JavaScript<br />

					

Tip

Using an asterisk (*) as the value of your alt attribute gives users with nongraphical browsers a bullet-like character in front of each list item.

Several things should be noted about this code:

  • You must have a separate ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.