Jump to content
  • 0

смена backgrounda при наведении


Mary_RND
 Share

Question

Есть таблица, в ней надо сделать чтобы при наведенние на строку она меняла цвет, методом td:hover делаеться ячейка, а вот к tr такой метод не проходит((

Подскажите как можно реализовать это через стили?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Заварка, желательно в css чтобы было

Проблема в том, что и другие не воспринимают tr:hover

я про этот костыль читала, но нормально его примера не нашла видать(

может идет не дружба со стилями?

html

  <table class="table" cellspacing="0">
<tbody>
<tr class="title">
<td>DF</td>
<td>DF</td>
<td>DF</td>
<td>DF</td>
<td>DF</td>
</tr>
<tr>
<td>GD</td>
<td>FGH</td>
<td>FGH </td>
<td>FH</td>
<td>hj </td>
<td>j</td>
</tr>
</tbody>
</table>

css

.table {
display:block;
position: relative;
width: 100%;
_width: 82%;
margin-bottom: 40px;
margin-top: 80px;
.margin-top: 10px;
_margin-top: 280px;
}

.table tbody tr {
border-bottom: 1px solid #807763;
border-right: 1px solid #807763;
background: #948a73;
}

.table tbody tr:hover {
border-bottom: 1px solid #807763;
border-right: 1px solid #807763;
background: #E1CD9E;
}

.table tbody td {
vertical-align: middle;
text-align: center;
font-size: 13px;
padding: 12px 5px 7px 5px;
border-bottom: 1px solid #807763;
border-right: 1px solid #807763;
background: #948a73;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy