Forum Moderators: not2easy
<div class="links">
<a href="apage.html">Text</a><br />
<a href="apage.html">Text</a><br />
<a href="apage.html">Text</a></div>
Is there a way to make it like a list, with bullets using CSS without having to change the html code at all.
I know I can use a background image like this.
.links a {
padding-left: 15px;
background: url("bullet.gif") no-repeat;
}
But I was wondering if there is a way to do this without using an image.
Not without making the links an actual list in HTML, without a background image, the bowser has no way of knowing what this element is.
If you were able to change the HTML however, you could use an unordered list, example below...
<ul>
<li><a href="apage.html">Text</a></li>
<li><a href="apage.html">Text</a></li>
<li><a href="apage.html">Text</a></li>
</ul>
ul {
list-style: none;
}
li {
padding-left: 15px;
background: url(nice-bullet.gif} 0 50% no-repeat;
}
All that said, you can add display:list-item; to the styles for those anchors and they will display as a bulleted list (although your control over it is more limited than an actual, semantically marked up list)...
.links a{display:list-item;}
cEM