sr-only Bootstrap 类


使用 .sr-only 类隐藏仅对屏幕阅读器可见的所有设备中的一个元素。

你可以尝试运行以下代码来实现 sr-only Bootstrap −

实例

实时演示

<!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-6-2020

357 浏览量

启动你的 职业生涯

完成课程获得认证

立即开始
广告