Bootstrap 使引导按钮透明

nnsrf1az  于 2022-12-07  发布在  Bootstrap
关注(0)|答案(6)|浏览(240)

如何使按钮透明?我一直在尝试使用. btn-transparent,但似乎无法使其工作。按钮只是不断变灰。

<button type="button" class="btn btn-transparent">SEARCH</button>
hs1rzwqc

hs1rzwqc1#

将css设为.btn-primary-outline
例如:https://jsfiddle.net/472cxwg9/

piok6c0g

piok6c0g2#

用途

class="btn" and style="background-color:transparent"

而不是

class="btn btn-primary-outline"

结果

2w3kk1z5

2w3kk1z53#

您可以在Bootstrap 4中执行此操作,而无需任何内嵌样式

<button type="button" class="btn bg-transparent btn-outline-primary"></button>

mgdq6dx1

mgdq6dx14#

Bootstrap 4引入 * 按钮链接 * 样式:.btn-link
通过在保持按钮行为的同时使按钮看起来像链接来降低按钮的重要性

<button type="button" class="btn btn-link">Link</button>

.btn-link类将background-color设置为background-color: transparent;(按钮边框也是透明的border-color: transparent;)。

vbkedwbf

vbkedwbf5#

在bootstrap 3中,我添加了:

.btn-primary-outline {
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
}

收件人:

<div class="col-xs-3" style="margin-top: 25px;">
<button type="button" class="btn btn-primary-outline">
<span style="display: inline; font-size: 30px; color: #007bff;" class="material-icons save">
</span>&nbsp;
</button>
</div>
zvokhttg

zvokhttg6#

从Bootstrap 5开始,您可以使用以下任一项:

<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">Secondary</button>
<button type="button" class="btn btn-outline-success">Success</button>
<button type="button" class="btn btn-outline-danger">Danger</button>
<button type="button" class="btn btn-outline-warning">Warning</button>
<button type="button" class="btn btn-outline-info">Info</button>
<button type="button" class="btn btn-outline-light">Light</button>
<button type="button" class="btn btn-outline-dark">Dark</button>

文件:https://getbootstrap.com/docs/5.2/components/buttons/#outline-buttons

相关问题