Whats the best way to do this?

Recommended Answers

All 3 Replies

What i have right now is :

<div id="alphabetlist"> <a class="alphabetlist">A B C D E F G H I J K L M M O Q R S T U V W X Y Z </a></div>

And I know that is wrong, because I cant add anchors to each letter like this.

What I was thinking I should do is:

<div id="alphabetlist">
<div> <a class="alphabetlist">A </a></div>
<div> <a class="alphabetlist">B </a></div>
<div> <a class="alphabetlist">C </a></div>
</div>

And then add the anchors

Yes something like that. If you are using a PHP file you could create a loop, that should make it easier.

There are two real easy ways you can do this; utilizing CSS:

ol {
list-style-type: upper-alpha;
}

Or inline in your HTML (using the CSS method is the more appropriate way however):

<ol type="A">
<li>foo</li>
<li>bar</li>
</ol>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.