Fresco
Fresco

Reputation: 299

CSS Select and style bold text within a pre element

I am reading the Java Tutorials Online, and sometimes you can find snippets of code declared with the pre tag. These snippets include plain text and some of it is in bold. I can't really differentiate normal text from bold text, so I'm using my browser's Stylish extension to create a CSS style that will modify the page's look and feel replacing the original. My goal is to change the color of the bold text inside the pre element to a color slightly different than black, like a very dark blue. What CSS selector can I use to select only bold text in a pre tag. Thanks!

Upvotes: 1

Views: 6396

Answers (1)

Fresco
Fresco

Reputation: 299

To select bold text within the pre element you need to write the following CSS rule:

pre b{
    color:blue;
}

Upvotes: 2

Related Questions