How to access with CSS first row of the table with different tr class name.
Date |
Solution 1:
#right .head td:first-child{
border-top-left-radius: 10px;
}
#right .head td:last-child {
border-top-right-radius: 10px;
}
Solution 2:
You can take it further by doing.
#right tr:first-child td:first-child {
background-color: red;
}
Selecting the first tr and then the first td.
Solution 3:
use pseudo class :first-child
to get the first element.
Like:
#right .head td:first-child {
border-top-left-radius: 10px;
}
#right .head td:last-child {
border-top-right-radius: 10px;
}
Solution 4:
#right table tr.head td:first-child {
border-top-left-radius: 10px;
}
#right table tr.head td:last-child {
border-top-right-radius: 10px;
}
Post a Comment for "Set Css Style Only To First Row Of The Table"