How to set the border width in css

青灯夜游
Release: 2023-01-05 16:10:26
Original
11550 people have browsed it

In CSS, you can use the border-width attribute to set the width of the border. The syntax format is "border-width: keyword | value with length unit;"; among them, the keyword can be thin (thin) border), medium (medium border), thick (thick border).

How to set the border width in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

css sets the width of the border

     

一些文本。

一些文本。

一些文本。

Copy after login

Rendering:

How to set the border width in css

Description:

The "border-width" attribute will not work if used alone. You must first use the "border-style" attribute to set the border.

css border-width property

The border-width property sets the width of the four borders of an element.

Attribute value:

Value Description
thin Define thin borders.
medium Default. Define a medium border.
thick Define a thick border.
length Allows you to customize the width of the border.

The border-width attribute can have one to four values.

Example:

border-width:thin medium thick 10px;
Copy after login
  • The upper border is a thin border

  • The right border is a medium border

  • The lower border is a thick border

  • The left border is a 10px wide border

border-width:thin medium thick;
Copy after login
  • The upper border It’s a thin border

  • The right and left borders are medium borders

  • The bottom border is a thick border

border-width:thin medium;
Copy after login
  • The upper and lower borders are thin borders

  • The right and left borders are medium borders

border-width:thin;
Copy after login
  • All 4 borders are thin borders

(Learning video sharing:css video tutorial)

The above is the detailed content of How to set the border width in css. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!