Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a page header in Bootstrap 4?

Since the .page-header class has been deprecated in Bootstrap 4, how can someone create a page header with the same style as Bootstrap 3 .page-header class?

like image 803
pgmank Avatar asked Apr 07 '18 13:04

pgmank


People also ask

How do I add a heading in Bootstrap?

Step 1: Include Bootstrap and jQuery CDN into the <head> tag before all other stylesheets to load our CSS. Step 2: Add <div> tag in the HTML body with class container. Step 3: To use a page header, wrap your heading in a <div> with a class of . page-header.

Which of the following is used to create page header in Bootstrap?

Bootstrap Jumbotron and Page Header.

Which class is used to add header in the page?

Page header is used to add appropriate spacing around the headings on a page.


2 Answers

According to the migration docs, the Bootstrap 4 utility classes should be used instead:

<div class="pb-2 mt-4 mb-2 border-bottom">       Page header </div> 

https://codeply.com/go/20jBKvMkHx

  • pb-2 - padding bottom 2 spacer units
  • mt-4 - margin top 4 spacer units
  • mb-2 - margin bottom 2 spacer units
  • border-bottom - border-bottom: 1px solid rgb(222, 226, 230)
like image 163
Zim Avatar answered Sep 23 '22 22:09

Zim


To my understanding, there isn't a direct replacement in bootstrap 4 for the bootstrap 3 .page-header.

However the CSS for the bootstrap 3 .page-header is simply:

padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eee; 

So you could create your own class in your css file:

.page-header {   padding-bottom: 9px;   margin: 40px 0 20px;   border-bottom: 1px solid #eee; } 
like image 29
TidyDev Avatar answered Sep 21 '22 22:09

TidyDev