3
I have a table and I want each cell to be highlighted when the mouse is over.
However, it is not working. It should be considered that I am using bootstrap
as a basis for page styles and therefore I believe it is conflict between my css
and that of bootstrap
.
The table is defined as follows::
<table class="table table-bordered">
<tr>
<td align="center" class="info_table"><div onclick="invDir(0);" id="gpio0">-</div></td>
<td align="center" class="info_table"><div id="gpio1">-</div></td>
<td align="center" class="info_table"><div id="gpio2">-</div></td>
<td align="center" class="info_table"><div id="gpio3">-</div></td>
<td align="center" class="info_table"><div id="gpio4">-</div></td>
...
I defined the class info_table
to highlight and prevent the value from being selected.
And this is the css
of info_table
:
.info_table
{
width: 5%;
color: #d44637;
font-weight: bold;
cursor: pointer;
background-color: #fff;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.info_table : hover
{
background-color: #f1c40f;
}
The problem is that simply the hover
doesn’t work.
OBS: The contents of div's
gpio* is dynamically loaded.
Your code has spaces here?
.info_table : hover
- cannot have, must be.info_table:hover
– Sergio
@Sergio is right, that’s exactly the problem. http://jsfiddle.net/LrXcz/
– bfavaretto
@Sergio posts an answer :)
– Paulo Roberto Rosa
@Pauloroberto, I’ll wait for Lucas' answer, I’m not sure that’s the only problem. boostrap is like a firewall, sometimes it’s hard to do what you want :)
– Sergio
@Sergio was the same space. Post your answer.
– Lucas Lima
Avoid using spaces between classes ex: figure.foto_caption:Hover OBS:(In some browsers it didn’t work in my code)
– Marcelo Cristofer