Turn 3 CSS classes into one

Asked

Viewed 60 times

1

I have these three classes css, and I wonder if it is possible to turn into one, it would be used in panel grid of Primefaces

.panelGridCenter {
    margin: 0 auto;
}

.gridNoBackground tr{
    background: transparent;
    background-color: transparent;
}

.noBorders tr, .noBorders td {
    border: none !important;
    border-spacing: 0px !important;   
}

I’m in doubt how to do that panel grid align to the center and remove the background color and edges from it in a single css.

Thank you

  • 1

    Voce would like to write all the code in just one class, or would like to set in the panelgrid component a class and write the css for tr and td from this classname who set?

  • @Michelsimões would like to apply in a single class those three classes understands.

1 answer

1


If your doubt is to set one className to the component panelgrid and from there implement the CSS instructions for TR and TD panel, can do as follows, setting the classname to panelgrid:

.meuPanel{
     margin: 0 auto;
 }
.meuPanel tr{
      background: transparent;
    background-color: transparent;   
}
.meuPanel tr td{
     border: none !important;
     border-spacing: 0px !important;    
}

If Voce wants to apply the three classes to the same object can do separated by space:

className="classUm classDois classTres"
  • There’s no way I can create in the CSS a single class does not?

  • places all attributes within the same class and tests.

  • 1

    Unfortunately not for sure, I’ve tried this before but what you propose is right.

  • gives a splha in the answer then...

Browser other questions tagged

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