How to set background color and transparency in Vue

How to set background color and transparency in Vue

Background color and transparency settings

As shown above, if it is the first picture, you need to add a gray background and white "Cover" word in the upper left corner, and the background color needs to be transparent.

First, you need to know the rgba() function.

The rgba() function uses the superposition of red (R), green (G), blue (B), and transparency (A) to generate a variety of colors.

RGBA stands for Red, Green, Blue, Alpha (English: Red, Green, Blue, Alpha).

  • Red (R) An integer between 0 and 255, representing the red component of the color. .
  • Green (G) An integer between 0 and 255 representing the green component of the color.
  • Blue (B) An integer between 0 and 255, representing the blue component of the color.
  • Transparency (A) takes values ​​between 0 and 1, representing transparency. The smaller the value, the higher the transparency.

Here is the Vue code:

First, set the parent element position: relative; then set the child element position: absolute; adjust the position by setting left, right, top, and bottom, and then set the background color background: rgba (34,34,34,0.5);

Set the background color of the button to transparent

Use when setting the style

background-color: unset 

3.1.0 sets the background color

There is no background color set for login

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Vue implements background color change operation
  • How to set background color for a single page in Vue-cli
  • How to set background image in Vue project
  • Vue implements sample code for clicking a button to switch the background color
  • An example of changing the background color of input according to value in Vue

<<:  MySQL cross-database transaction XA operation example

>>:  How to modify the mysql table partitioning program

Recommend

Practical record of handling MySQL automatic shutdown problems

I recently helped someone with a project and the ...

HTML table tag tutorial (27): cell background image attribute BACKGROUND

We can set a background image for the cell, and w...

How to deploy zabbix_agent in docker

zabbix_agent deployment: Recommendation: zabbix_a...

Ant designing vue table to achieve a complete example of scalable columns

Perfect solution to the scalable column problem o...

Solve the conflict between docker and vmware

1. Docker startup problem: Problem Solved: You ne...

Docker meets Intellij IDEA, Java development improves productivity tenfold

Table of contents 1. Preparation before developme...

Detailed explanation of common commands in MySQL 8.0+

Enable remote access Enable remote access rights ...

Teach you how to deploy Vue project with Docker

1.Write in front: As a lightweight virtualization...

The hottest trends in web design UI in 2013 The most popular UI designs

Time flies, and in just six days, 2013 will becom...

21 MySQL standardization and optimization best practices!

Preface Every good habit is a treasure. This arti...

MySql Installer 8.0.18 Visual Installation Tutorial with Pictures and Text

Table of contents 1. MySQL 8.0.18 installation 2....

Five ways to implement inheritance in js

Borrowing Constructors The basic idea of ​​this t...