Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS: giving precedence to class applied to TR over styling applied TD (tables)

Is there a way for the class applied to the TR element of a table to override the styling applied to the TD?

td {
    border: 1px dotted #d6d6d6;
}

.tr {
    border-bottom: 1px solid #ff0000 important;
}

In the above CSS code, what should I do so that the .tr class (applied to certain TR elements) overrides the td styling?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Here’s the corrected CSS code to override the styling applied to the td:

td {
    border: 1px dotted #d6d6d6;
}

.tr td {
    border-bottom: 1px solid #ff0000 !important;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading