- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Bootstrap class center-block
Use class center-block to set an element to center.
You can try to run the following code to implement the center-block class
Example
<!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 = "pull-right" style = "width:100px; background-color:gray; color: white;"> Float to right </div> <div class = "row"> <div class = "center-block" style = "width:200px; background-color:#ccc; color: white;"> Example for center-block </div> </div> </body> </html>
- Related Articles
- Bootstrap .btn-block class
- Bootstrap 4 .d-block class
- Bootstrap 4 .justify-content-*-center class
- d-*-block class in Bootstrap 4
- Center tabs in Bootstrap
- Center any element in Bootstrap
- How to align block elements to the center?
- Bootstrap block level help text
- Set element to center with Bootstrap
- Create block level button with Bootstrap
- Create a block level button with Bootstrap
- Create a block element with Bootstrap 4
- Bootstrap well class
- Bootstrap progress class
- Bootstrap .card class

Advertisements