Page-header bootstrap class is malfunctioning

I just started learning bootstrap and currently I'm working with bootstrap v5.2.0. I attempted to create a header with a line using the class="page-header" but the header line is not showing up. Can someone please clarify why?

<!doctype html>
<html lang="en>
  <head>
    <meta charset="utf-8>
    <meta name="viewport" content="width=device-width, initial-scale=1>
    <title>Bootstrap cheat sheet</title>
    <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c0a2afafb4b3b4b2a1b080f5eef2eef0">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous>
  </head>
  <body>
    <div class="container>
        <h1 class="page-header>Hello, world!<small>Secondary text</small></h1>
        <p class="lead>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Doloribus eligendi rem hic assumenda doloremque consequatur sunt, amet quasi ab. Qui iste tempora eaque molestias earum fugit, inventore quibusdam doloribus commodi.</p>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Iste laborum ipsam libero. Placeat rerum ad ipsam nostrum molestiae, omnis repellat accusamus error saepe deserunt dolorum officiis nam tempora recusandae veritatis!</p>
    </div>
   
    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f4969b9b808780869584b4c1dac6dac4">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous></script>
  </body>
</html>

Answer №1

The .page-header class was phased out in Bootstrap 4 and has been completely removed in Bootstrap 5.

According to Migrating to v4 - Bootstrap

The .page-header class was removed because all its styles can now be achieved using utilities.

The emphasis now is on utilizing utilities instead. You can now replicate the .page-header styles by using .pb-2 mt-4 mb-2 border-bottom. The beauty of these utilities lies in their flexibility for customization.

<!doctype html>
<html lang="en>

<head>
  <meta charset="utf-8>
  <meta name="viewport" content="width=device-width, initial-scale=1>
  <title>Bootstrap cheat sheet</title>
  <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f7959898838483859687b7c2d9c5d9c7">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous>
</head>

<body>
  <div class="container>
    <h1 class="pb-2 mt-4 mb-2 border-bottom>Hello, world!<small>Secondary text</small></h1>
    <p class="lead>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Doloribus eligendi rem hic assumenda doloremque consequatur sunt, amet quasi ab. Qui iste tempora eaque molestias earum fugit, inventore quibusdam doloribus commodi.</p>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Iste laborum ipsam libero. Placeat rerum ad ipsam nostrum molestiae, omnis repellat accusamus error saepe deserunt dolorum officiis nam tempora recusandae veritatis!</p>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f0d00001b1c1b1d0e1f2f5a415d415f">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous></script>
</body>

</html>

Answer №2

The class .page-header was removed from Bootstrap 4. For more information, you can visit https://getbootstrap.com/docs/4.6/migration/#typography. However, you can achieve a similar effect with the following CSS:

.page-header {
    padding-bottom: 9px;
    margin: 40px 0 20px;
    border-bottom: 1px solid #eee;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to access the front camera on both Android and iOS devices in order to capture a photo using Vue.J

I am currently developing a PWA Vue.Js application and I am trying to implement a feature that allows users to take a picture with the front camera on their mobile devices. Although I have managed to write code that works on my desktop browser, I have bee ...

Utilizing jQuery to dynamically load CSS files on a webpage

For my website, I have implemented 4 different .css files to handle various screen resolutions. Here is the innovative jquery code I've developed to dynamically load these files based on the width of the screen. <link id="size-stylesheet" rel="st ...

Why isn't the float left property working as expected?

Why won't my image float to the left? I'm using a class called align-left with float: left but it's not working. You can see the live version at - (check out the review grid halfway down under the heading 'High customer satisfaction r ...

Setting up automatic filtering for additional dropdown lists in Laravel is a useful feature that can enhance user

Hello! I am working with an application form and I would like to implement a feature where other dropdown lists automatically update based on the selection made in a previous dropdown. Specifically, I am looking to add a new dropdown list called "Country" ...

Tips for deleting all content within a designated html tag (including the tag itself)

Imagine you are dealing with a string like this: text = """<p>Bla bla bla.</p><p>Blo blo blo<a href="http://www.example.com">bli bli</a>.</p><p>blu blu<br> <span style="font-size: x-small;"><br> ...

What is the best way to invoke a jQuery function with a dynamic ID?

I am a newcomer to JQuery and need assistance with calling a function on click for an image with a dynamic ID. While I have come across posts about calling a function using the ID, I am struggling to find one that addresses working with a dynamic ID. Is i ...

I am required to filter out any child elements from a find() operation

HTML: <ul> <li class="listExpandTrigger"><h3>2010 - present</h3></li> <li class="listCollapseTrigger"><h3>2010 - present</h3></li> <li> <ul class="volumeList"> <l ...

Having trouble accessing the ID of a list item using jQuery?

Can you please help me figure out why the code below is not passing the list element ID to ajax correctly: Here's the HTML: <ul id="tree"> <li><a id="1">Finance</a></li> <li><a id="2">ACC& ...

A tutorial on how to create the appearance of disabled buttons that look the same as enabled buttons through the use

My button includes a text field that is constantly disabled. I would like for the text field to appear as bright as it does when the button is enabled. After disabling the button, they both appear dimmer compared to others and the text field follows suit ...

Modifying the weight of fonts in TVML components

Currently, I'm in the process of developing a TVML app specifically for the Apple TV. Lately, I've been experimenting with making some style adjustments to various elements within the app. Following the guidance provided in the TVML documentatio ...

Toggle the visibility of a div element and smoothly scroll to it on the page

Upon clicking the form, my goal is to show or hide it and scroll down to view the form. The current code I have in place seems to work after the first click. However, on the initial click, it shows the form but fails to scroll down. Any insights on what I ...

Generating an .html document from a log file

Looking for a way to transform log files into easily accessible .html files that can be viewed by anyone? Check out the script I've been working on: #!/bin/bash ## This handy script converts log files into HTML format, allowing optional GREP search ...

Refresh a function following modifications to an array (such as exchanging values)

Looking to re-render a function after swapping array values, but the useEffect hook is not triggering it. I need assistance with this as I plan to integrate this code into my main project. Below are the JSX and CSS files attached. In App.js, I am creating ...

Comprehending the Syntax of the ExtJS Framework

I have recently inherited a project utilizing Sencha's ExtJS framework without any handover or documentation. As I navigate through the code, I find myself trying to decipher certain syntax and exploring resources tailored for newcomers to this specif ...

Using jQuery to position an element above an ID

I'm currently working on a unique portfolio gallery for my website, but I've encountered a problem. What I'm aiming for is to create a gallery that will slide up when a thumbnail is clicked, without loading all images on the page at once. T ...

AMP: Switch CSS Style

When creating an amp template, I included a button that toggles the visibility of an amp-sidebar. The code for the button is as follows: <button class="button .closed icon" on='tap:sidebar1.toggle'></button> The side-bar toggles suc ...

Guide to setting up jQuery Mobile with bower

For my project, I'm interested in utilizing jquery-mobile through bower. In order to do so, I need to execute npm install and grunt consecutively within the bower_components/jquery-mobile directory to access the minified .js and .css files. This pro ...

The code is not executing properly in the javascript function

Hello there! I've created a basic login form with JavaScript validation, but for some reason, the code below isn't functioning properly. Here is my HTML and JS code: <head> <script type="text/javascript"> function ha ...

What is the process for transferring information from HTML to Python and then receiving the output in HTML?

I am completely unfamiliar with the connection between HTML and Python, so I am reaching out for some assistance. I hope that someone here can lend me a hand. Currently, my HTML is hosted on an Apache server, and I access the website using the address "". ...

Instructions on converting text to a Float value and displaying the calculated result in a separate div

I am attempting to extract a string from a div, clear its content, then retrieve the actual price from ".skuBestPrice", remove any special characters, perform calculations to convert it into a floating point number, and display this number in the div ".tot ...