Remove the button border style, the background is completely transparent, showing the background color or background image

scenes to be used

We often need a button (button) to be placed together with text, and a video or picture to be placed underneath. This is what I discovered when I was writing the uniapp sharing function. uni.share can only take effect when written on the button, so this blog post appeared. For example, as shown in the figure below:
insert image description here
insert image description here

upper code

js code

//js代码
.button {
    
    
	background: rgba(0, 0, 0, 0);//设置背景色
}

button::after {
    
    
	border: none;//去除边框
}

html code

<button class="button">按钮</button>

Guess you like

Origin blog.csdn.net/qq_51463650/article/details/128099991