Home >Web Front-end >CSS Tutorial >How to use CSS font-weight

How to use CSS font-weight

php中世界最好的语言
php中世界最好的语言Original
2017-11-22 13:24:072314browse

If we need to bold a section of font, what other methods are available besides the H tag mentioned last time? Today I will teach you how to use CSS to operate font-weight

CSS bolding here refers to controlling the bolding of objects through DIV CSS.

Use CSSAttributesWord

font-weight

Object value: from 100 to 900, the most commonly used font-weight value is bold

font-weight parameter:

normal: normal font. Equivalent to number 400. Declaring this value will cancel any previous setting

bold : Bold. Equivalent to number 700. Also equivalent to the role of b object

bolder: IE5+ Extra bold

lighter: IE5+ Thin

number: IE5+ 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

For detailed basic bolding knowledge, please go to the font-weight manual in the CSS manual.

Html regular bold tags

In the past, HTML tags that directly bolded objects were as follows:

a4b561c25d9afb9ac8dc4d70affff4190d36329ec37a2cc24d42c7229b69747a or 8e99a69fbe029cd4e2b854e244eab1432c56e50b17e5e355312705a6be86163fBoth have the same effect.

Bold example, the code is as follows:

 <strong>我被加粗</strong><br />
<b>我也被加粗了</b><br/>

I have not been bolded

CSS bold basic skills example

CSS code:

.yangshi1{ font-weight:bold}

.yangshi2{ font-weight:800}

Div html code:

cd7260c2b86df858e081586b9d2136aeI am bolded54bdf357c58b8a65c66d7c19c8e4d114df250b2156c434f3390392d09b1c9563

b82e518ac1fea9cf8e593ad21df90db2I am also bolded54bdf357c58b8a65c66d7c19c8e4d114df250b2156c434f3390392d09b1c9563

I have not been bolded

CSS bolding result demonstration:

Here, CSS is used to control bold text to bold objects. Therefore, you can generally use this method to bold text objects and titles.

Summary and recommendation:

1. To directly bold objects in HTML, you can use a4b561c25d9afb9ac8dc4d70affff419 or 8e99a69fbe029cd4e2b854e244eab143 to bold them

2 . To use CSS to bold objects, you can use font-weight:bold to achieve bolding.

There are so many ways to operate font-weight in CSS. Friends in need can save it. Please also continue to pay attention to other updates on this site.

Related reading:

How to clear floats in CSS


Use CSS to operate borders Tips


How to set the link style using CSS

The above is the detailed content of How to use CSS font-weight. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn