I have a table with several rows and each row is divided into three columns, the amount is the least of it.
In the middle column I have some text, and in the columns on each side of that same row some Font Awesome icons.
I need the style font-weight: bold; applies to the entire row, including the icons, and not just the text.
How can I achieve this?
I add the code, you can also see it in CODEPEN
td {
padding: 10px 0;
border: 2px solid #000;
text-align: center;
cell-spacing: none;
}
tr:hover {
background-color: #ddd;
font-weight: bold;
}
.far:hover {
font-weight: bold;
}
<head>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
</head>
<body>
<table style="width:100%">
<tr>
<td width="10%"><i class="far fa-file-word"></i></td>
<td width="80%">Lorem Ipsum</td>
<td width="10%"><a href="#"><i class="far fa-arrow-alt-circle-down"></i></a></td>
</tr>
<tr>
<td width="10%"><i class="far fa-file-pdf"></i></td>
<td width="80%">Lorem Ipsum</td>
<td width="10%"><a href="#"><i class="far fa-arrow-alt-circle-down"></i></a></td>
</tr>
<tr>
<td width="10%"><i class="far fa-file-excel"></i></td>
<td width="80%">Lorem Ipsum</td>
<td width="10%"><a href="#"><i class="far fa-arrow-alt-circle-down"></i></a></td>
</tr>
</table>
</body>
I just played with the selector
tr:hover
for what you want:as you will see add
tr:hover td
andtr:hover td .fa
, by that I mean that when the mouse is above the row totd
and to the element that has the class.far
I put thefont-weight: bold;
.I hope it is what you are looking for.
This code can work for you, it is simple and fast, tell me how it works for you.
CHECK THE CODE HERE (CODEPEN)