Overwrite first-Child css

Asked

Viewed 21 times

0

Good morning, I’m working with bootstrap cards and I need to replace the header border Radius, but when I try to modify it with css I can’t because of the :first-Child you have in the bootstrap class, someone knows how to Overwrite this property?

Inspected bootstrap element

.card-header:first-child {
  border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
}
  • !important overwrite

  • worked out, vlw man!!

  • 1

    Constructive criticism: "subscribe" is to write below. "Overwrite" is to write above.

1 answer

1

problem solving:

.card-header{
border-radius: 20px !important;

}

  • Is the only solution? What points should I consider in my application before I use blindly the !important? What do I get out of it, and especially what do I lose out of it? Can I change this property at another point in the application to overwrite the !important?

  • Took me in what I needed

  • I certainly did; my intention was to try to make you question something before using it as a solution. Using the !important in CSS is extremely complicated and probably in all cases unnecessary. It breaks the main feature of CSS: the cascading hierarchy. I advise you to seek the answers of the above questions if you no longer know them, but it is at your discretion.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.