在Bootsrap 4中使用btn-outline-light类设置浅灰色轮廓按钮。
要将其包含在网页上,请将其设置为<button>元素中的类,如以下代码片段所示-
<button type="button" class="btn btn-outline-light">
让我们看一个示例来实现btn-outline-light类-
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> </head> <body> <h2>Demo Button</h2> <p>Below is a light grayed outline button:</p> <button type="button" class="btn btn-outline-light"> Sample </button> </body> </html>