.center-block - Centers any element - HTML CSS Bootstrap Class List

HTML CSS examples for Bootstrap Class List:center-block

Description

.center-block - Centers any element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head><!--from w ww.java 2  s  . c  o m-->
<body>

<div class="container">
  <h2>Example</h2>
  <div class="center-block" style="background-color:yellow;width:200px;">This div will be centered.</div>
</div>

</body>
</html>

Related Tutorials