It's no surprise that the CSS isn't cooperating, but I'm hoping you can grasp the concept. There are two lists and my aim is to style the first letter of the first a
in the initial ul
. In this instance, it would be the B in Beauty Salons. Is it possible to achieve this using CSS without altering the HTML code?
CSS:
.tab-pane .category-headings ul:first-of-type a:first-of-type::first-letter {
margin-right: 1px;
padding: 0px 5px;
background-color: #666;
color: #fff;
font-weight: bold;
}
HTML:
<div class="tab-pane" id="b">
<div class="container-fluid category-headings">
<div class="row-fluid">
<div class="span11 offset1">
<div class="row-fluid">
<div class="span4">
<ul class="unstyled">
<li><a href="./beauty-salons-and-therapy/">Beauty Salons & Therapy</a>
</li>
<li><a href="./blinds/">Blinds</a>
</li>
</ul>
</div>
<div class="span4">
<ul class="unstyled">
<li><a href="./book-binders/">Book Binders</a>
</li>
<li><a href="./bookkeeping-services/">Bookkeeping Services</a>
</li>
</ul>
</div>
<div class="span4">
<ul class="unstyled">
<li><a href="./builders/">Builders</a>
</li>
<li><a href="./building-plans/">Building Plans</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
FIDDLE: http://jsfiddle.net/a4644b8h/2/