您必须对button
元素使用以下属性以使其透明。
没有文字的透明按钮
button {
background: transparent;
border: none !important;
font-size:0;
}
带有可见文本的透明按钮
button {
background: transparent;
border: none !important;
}?
并使用绝对值position
定位元素。
例如
您在div下有button元素。position
在div上使用:relative和position
在按钮上使用:absolute可以将其定位在div中。