Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customizing bold stuff with CSS

Tags:

css

font-style

I don't think my bold text in a webpage are bold enough, so I was wondering if there were any ways I could tweak bold text with CSS.

like image 310
wrongusername Avatar asked Aug 10 '26 09:08

wrongusername


2 Answers

with font-weight you can specify the «boldness» of your text with a higher number … but almost every browser does only display the text in the same «boldness» as without a specific number.

Alternatively you can use Bold- or Black-Styles of the Font itself, but most Internet-Users may not have installed this specific fonts.

see examples: http://clagnut.com/blog/2228/

like image 130
albuvee Avatar answered Aug 13 '26 12:08

albuvee


a workaround if the bold font does not really support bold style is to emulate boldness using css3 textshadows.

<span class="bold">some text goes here</span>

span.bold {
    text-shadow: 1px 0px 0px #000; /* the textcolor */
    padding-right: 1px;
    letter-spacing: 1px;
}

Adds 1px to the right and spaces the letters to make it looking nice again. You may also combine many "shadows" by putting them in comma list:

text-shadow: 1px 0px 0px #000, -1px 0px 0px #000, /*...*/ ; 
like image 29
Karl Adler Avatar answered Aug 13 '26 10:08

Karl Adler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!