隐藏性引导程序类


使用类 .sr-only 隐藏一个元素,使其对于除屏幕阅读器之外的所有设备都不可见。

你可以尝试运行以下代码来实现隐藏引导程序 -

示例

现场演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "row" style = "padding: 91px 100px 19px 50px;">
         <form class = "form-inline" role = "form">
            <div class = "form-group">
               <label class = "sr-only" for = "email">Email address</label>
               <input type = "email" class = "form-control" placeholder = "Enter email">
            </div>
            <div class = "form-group">
               <label class = "sr-only" for = "pass">Password</label>
               <input type = "password" class = "form-control" placeholder = "Password">
            </div>
         </form>
      </div>
   </body>
</html>

更新于:12-Jun-2020

357 浏览量

开启你的职业生涯

完成课程,获得认证

开始吧
广告