How to set the transparency of the border in css

青灯夜游
Release: 2023-01-05 16:12:48
Original
16237 people have browsed it

In css, you can set the border transparency through the border-color attribute and the RGBA() function. Just add the "border-color: rgba (red, green, blue, transparency value)" style to the border element. border-color can set the border color, and RGBA() can set the color transparency.

How to set the transparency of the border in css

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

css sets the transparency of the border

In css, the border transparency can be set through the border-color attribute and the RGBA() function.

Code example:



    
        
        
    
测试文本,透明度0.1
测试文本,透明度0.5
测试文本,透明度0.8
测试文本,透明度1.0
Copy after login

Rendering:

How to set the transparency of the border in css

##Description:

border-color attribute can Set the border color, and the RGBA() function can set the color transparency.

RGBA means (Red-Green-Blue-Alpha) which is an extension of RGB to include the "alpha" channel, which allows you to set transparency on color values.

Syntax:


rgba(R,G,B,A);
Copy after login
Introduction to the values ​​in rgba():


  • R: red value. Positive integer (0~255)

  • G: green value. Positive integer (0~255)

  • B: Blue value. Positive integer (0~255)

  • A: Transparency. The value is between 0 and 1

(Learning video sharing:

css video tutorial)

The above is the detailed content of How to set the transparency of the border in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!