reenadak

2018-11-22-centering horizontally and vertically

Nov 22nd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.69 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3.   <head>
  4.     <!-- Required meta tags -->
  5.     <meta charset="utf-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7.  
  8.     <!-- Bootstrap CSS -->
  9.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  10.  
  11. <style type="text/css">
  12.     html, body{ height: 100%; }    
  13.     #tv { height: 100%; display: flex; text-align: center; align-items: center; }    
  14.     #tv-screen { width: 100%; }
  15. </style>
  16.  
  17.     <title>Hello, world!</title>
  18.   </head>
  19.   <body>
  20.  
  21.     <section id="tv">
  22.         <div id="tv-screen">
  23.             <div class="display-3">Mukesh Dak</div>
  24.             This is to demonstrate horizontal and vertical centering in Bootstrap 4.1.3
  25.             <br>Centering is responsive and is irrespective of content size.
  26.         </div>
  27.     </section>
  28.  
  29.  
  30.     <!-- Optional JavaScript -->
  31.     <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  32.     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  33.     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  34.     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  35.   </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment