Reputation: 305
In a ul li list , how to make an alternate li bold. Like shown in the image.
Thanks
Upvotes: 2
Views: 170
Reputation: 6996
You can do something like this
ul li:nth-child(odd)
{
font-weight:bold;
}
Note:If you want to start from first li element then use odd if you want to start from second element then use even as alexn suggests in his answer.
Upvotes: 3
Reputation: 58962
Use the nth-child(even) pseudo selector:
li:nth-child(even) {
font-weight: bold;
}
Use odd or even depending on whether you want the first one bold.
Demo on jsfiddle.
Upvotes: 7