ComputersProgramming

How to make a bold font in CSS?

To make a bold font in CSS, you should use a number of standard commands. But you can use non-standard options, which give an interesting effect. Bold outline is used to highlight a strictly defined fragment of the text. CSS helps us to assign a font to any word combination or even a single letter. If you are still using HTML tags to achieve this effect, you need to reconsider your views on programming, because cascading style sheets give you more possibilities as a developer. We will talk about some of them in this article.

Assignment

The bold type CSS is assigned using a simple rule: font-weight. As a value, you can specify different combinations. For example, you can write a "font-weight: bold" property, which means a boldface. The standard value is "normal". In addition to keywords, you can use ordinary numbers. Conditional units range from 100 to 900, where 400 corresponds to the command "normal". And this means that if you set the value to less than 400, the font will lose its saturation, and if more, it will get a fat look. This allows you to manually adjust the outline.

In CSS, a bold font can be assigned based on the parent element. In cascading tables, there are two commands ("bolder" and "lighter"), which can increase or decrease the saturation of the outline. The values will vary depending on the parent element. The property "font-weight" can be written in a brief form - "font", where you can write down all the characteristics of the font.

goal

You can assign this CSS font to any HTML or XHTML element. The effect will be visible only if the tag contains text. In HTML, there is an analog of the "font-weight" property. If you put text between the 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 tag and the CSS bold font. But there are differences. The tag has its own meaning, it is used for really important information. A CSS property is just a decorative value used to decorate a text. Let this difference and is not felt when reading, but, as advised by the consortium of the World Wide Web, everything should stand in its place. This order in the code will increase the life of your pages. After all, it is not far off that time when browsers will learn to use another way of text visualization, where the semantic and decorative meaning will be highlighted. Do not forget about this when creating your own pages.

Conclusion

The existing bold font in CSS allows you to reduce the source code of the page. There is no need to use the tag. It's enough just to conclude the necessary text in a certain class. And if you need to cancel the boldface, you just need to fix one file with cascading tables. But do not forget that you can not abuse this property, because excessive use of various decorative techniques can spoil the text. It is advisable to use bold type only when it really is needed, for example, to highlight the headings or the name of a particular section.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.