|
10 | 10 | <link rel="stylesheet" href="css/bootstrap.min.css">
|
11 | 11 | <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
|
12 | 12 | integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
| 13 | + <style> |
| 14 | + .sticky-top1 { |
| 15 | + position: -webkit-sticky; |
| 16 | + position: sticky; |
| 17 | + top: 0; |
| 18 | + z-index: 1020; |
| 19 | + } |
| 20 | + .sticky-top2 { |
| 21 | + position: -webkit-sticky; |
| 22 | + position: sticky; |
| 23 | + top: 54px; |
| 24 | + z-index: 1020; |
| 25 | + } |
| 26 | + </style> |
13 | 27 | <title>Hello, boostrap!</title>
|
14 | 28 | </head>
|
15 | 29 |
|
16 | 30 | <body>
|
| 31 | + <div class="container-fluid bg-success" style="height: 250px;"></div> |
| 32 | + <nav class="navbar navbar-light bg-light sticky-top1"> |
| 33 | + <form class="form-inline"> |
| 34 | + <div class="input-group"> |
| 35 | + <div class="input-group-prepend"> |
| 36 | + <span class="input-group-text" id="basic-addon1">@</span> |
| 37 | + </div> |
| 38 | + <input type="text" class="form-control" placeholder="Username" aria-label="Username" |
| 39 | + aria-describedby="basic-addon1"> |
| 40 | + </div> |
| 41 | + </form> |
| 42 | + </nav> |
| 43 | + <div class="container-fluid bg-success" style="height: 250px;"></div> |
| 44 | + <nav class="navbar navbar-dark bg-dark sticky-top2"> |
| 45 | + <form class="form-inline"> |
| 46 | + <div class="input-group"> |
| 47 | + <div class="input-group-prepend"> |
| 48 | + <span class="input-group-text" id="basic-addon1">@</span> |
| 49 | + </div> |
| 50 | + <input type="text" class="form-control" placeholder="Username" aria-label="Username" |
| 51 | + aria-describedby="basic-addon1"> |
| 52 | + </div> |
| 53 | + </form> |
| 54 | + </nav> |
| 55 | + <div class="container-fluid bg-danger" style="height: 2500px;"></div> |
17 | 56 |
|
18 | 57 | <!-- Optional JavaScript -->
|
19 | 58 | <!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
|
0 commit comments