Topic: Card header background title

dee718 free asked 3 years ago


Hey,

Is it possible to change the background colour of a card header only?

So for example in the code below I want to change the background colour where it says "Featured" to grey and the rest of the card should have a white background.

<div class="card text-center">
  <div class="card-header">Featured</div>
  <div class="card-body">
    <h5 class="card-title">Special title treatment</h5>
    <p class="card-text">
      With supporting text below as a natural lead-in to additional content.
    </p>
    <a href="#" class="btn btn-primary">Button</a>
  </div>
  <div class="card-footer text-muted">2 days ago</div>
</div>

Thanks in advance


Dawid Wajszczuk staff answered 3 years ago


Hi,

Yes, it is possible. Just add style="background-color: your color;" to <div class="card-header">. Here is the snippet with this solution https://mdbootstrap.com/snippets/standard/d-wajszczuk/3122227#html-tab-view.

Keep coding,
Dawid



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.7.1
  • Device: Laptop
  • Browser: Chrome
  • OS: Mac OS 11.0.1
  • Provided sample code: No
  • Provided link: No
Tags