--
--
You received this because you are subscribed to the "Design the Web with CSS" at Google groups.
To post: css-d...@googlegroups.com
To unsubscribe: css-design-...@googlegroups.com
Hi...
I have been researching some css rules, and came up with na alternative to style list bullets, without adding any new HTML element.
See the trick:
ul {
padding: 0;
list-style-type: none;
counter-reset: my-list; /* start a counter */
}
ul li:before {
/* keep the counter left of the list but right aligned
may not be needed if you don't mind about alignment */
display: block;
float: left;
width: 30px;
padding: 0 10px 0 0;
text-align: right;
/* add as many styles as needed */
font-weight: bold;
color: red;
content: counter(my-list) ". "; /* add the counter, or bullets, or anything */
counter-increment: my-list /* increment the counter */
}
All about generated content and counters in CSS can be found at http://www.w3.org/TR/CSS2/generate.html.
__
Paulo Diovani Gonçalves