简体   繁体   中英

How to use h-100 in bootstrap 4

I have a sidebar in admin panel. And I try for this sidebar height be 100%, but I did not solve my problem.

<html class="h-100">
<head>
    <title>Admin</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body class="h-100">
    <div class="row h-100">
    <div class="col-md-2 h-100 bg-dark" id="sidebar"></div>
    <div class="col-md-10"></div>
    </div>
</body>
</html>

add this to your style sheet

#sidebar{
  height:100vh;
}

Full Code

<html>
<head>
    <title>Admin</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
    <div class="row">
    <div class="col-md-2 bg-dark" id="sidebar"></div>
    <div class="col-md-10"></div>
    </div>
</body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM