I have 27 hyperlink elements in a container div. The hyperlinks are the alphabet letters like this:
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ALL
The div is the width of the page. Right now, I have a class on the anchor tags that sets left and right padding to 3px
, so that I have spacing in between the pipes. But the problem is the letters float to the left and I am left with a bunch of white space to the right of the letters. How could I achieve spacing the letters (i.e. padding), so that letters expand to width of container div? I am thinking the padding would be dynamic in such a way that it is set based on width of container div.
<style type="text/css">
.container { width:100%; }
.alphabetLinks { padding: 0px 3px; }
</style>
<html>
<div class="container">
<a class="alphabetLinks">A</a>
|
<a class="alphabetLinks">B</a>
|
</html>
UPDATE: solution must support IE9 and above.