Home > Back-end >  How to change P tags text color inside a div?
How to change P tags text color inside a div?

Time:04-28

I want to change the P tags text color of the card-header section but it is not working for some unknown reason

dashboard.html

  <div >
    <div >
      <div >
        <p>Account: 2002384</p>
      </div>
      <div >
        <div >
        <p>Balance: $44,930.20</p>
      </div>
      </div>
    </div>

styledashboard.css

.card-header{
     color: #0c5460;
}

.card-header p{
     color: #0c5460;
}


.card-header .p{
     color: #0c5460;
}

p .card-header{
     color: #0c5460;
}

None of them work

CodePudding user response:

.card-header p {
     color: #0c5460;
}

.card-body p {
      color: red;
}
 <div >
    <div >
      <div >
        <p>Account: 2002384</p>
      </div>
      <div >
        <div >
        <p>Balance: $44,930.20</p>
      </div>
      </div>
    </div>

CodePudding user response:

Edit your css to something like this.

.card > p{
     color: #0c5460;
}

.card > span {
     color: #0c5460;
}

.row > p { 
    color: #0c5460;
 }
 <div >
    <div >
      <p>Account: 2002384</p>
        <span>Account: 2002384</span>
      </div>
      <div >
        <div >
        <p>Balance: $44,930.20</p>
      </div>
      </div>
    </div>

  • Related