To make bold in CSS, use a number of standard commands. But you can use non-standard options that give an interesting effect. Bold face is used to highlight a strictly defined fragment of text. CSS helps us to assign such a font to any phrase or even a single letter. If you still use HTML tags to achieve this effect, you need to rethink your views on programming, because cascading style sheets give you as a developer more options. We will talk about some of them in this article.
Assignment
You assign CSS bold font using a simple rule: font-weight. You can specify various combinations as a value. For example, you can write the “font-weight: bold” property, which means bold. The default value is "normal". In addition to keywords, you can use regular numbers. Conventional units range from 100 to 900, where 400 corresponds to the "normal" command. And this means that if you set the value to less than 400, then the font will lose its saturation, and if more, it will become bold. This allows you to manually adjust the style.
In CSS, bold can be assigned based on the parent element. In cascading tables, there are two commands (“bolder” and “lighter”) that can increase or decrease the saturation of the style. Values will change depending on the parent element. The font-weight property can be written in short form - font, where all font characteristics can be written.
goal
You can assign such a CSS font to any HTML or XHTML element. The effect will be visible only if the tag contains text. HTML has an analogue to the font-weight property. If you place text between the <strong> tags, it will become more saturated. Its property is completely identical to the value of "bold". Some developers do not see the difference between the <strong> tag and CSS bold. But there are differences. The tag has its own semantic load, it is used for really important information. And the CSS property is just a decorative value used to decorate text. Let this difference not be felt when reading, but, as the World Wide Web consortium advises , everything should be in place. This code order will increase the life of your pages. After all, not far off is the time when browsers will learn to use another way of visualizing text, where semantic and decorative meaning will stand out. Do not forget about this when creating your pages.
Conclusion
The bold font in CSS reduces the page source. After all, there is no need to use the <strong> tag. Just wrap the text you need in a particular class. And if you need to cancel the bold style, you just need to fix one file with cascading tables. But do not forget that you should not abuse this property, since excessive use of various decorative techniques can ruin the text. It is advisable to use bold only when it is really needed, for example, to highlight headings or the name of a particular section.