How to use CSS font-weight

php中世界最好的语言
Release: 2017-11-22 13:24:07
Original
2267 people have browsed it

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:

or < /strong>Both have the same effect.

Bold example, the code is as follows:

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

I have not been bolded

CSS bold basic skills example

CSS code:

.yangshi1{ font-weight:bold}

.yangshi2{ font-weight:800}

Div html code:

I am bolded

I am also bolded

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 or 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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template