Well, it turns out that I put a text that says "off" in red, and that when you pass the pointer over it says "turn on" in yellow. However, my question is: what do I do so that when I press the text of "off" it changes to "on" in green color and stays that way until I press again to turn it off? I already tried the process with which the buttons are made but it turns out to be different, also try another hover but it did not work (I do not know how it works). It should be noted that everything goes inside a table:
.contenido .tabla-contenido table {
position: static;
margin-top: 30px;
color: black;
font-size: 15px;
border-radius: 8px;
}
.contenido .tabla-contenido table p:before {
content: "APAGADO";
color: #c1877a;
}
.contenido .tabla-contenido table p:hover:before {
content: "ENCENDER";
color: #f4d742;
transition: color 0.1s linear 0.1s;
}
<html>
<section class="contenido">
<div class="tabla-contenido">
<center>
<table>
<tr>
<td>APARATO</td>
<td>ENCENDIDO/APAGADO</td>
</tr>
<tr>
<td>LAMPARA</td>
<td><a href="#"><p class="APAGADO"></p></a></td>
</tr>
<tr>
<td>LUCES</td>
<td><a href="#"><p class="APAGADO"></p></a></td>
</tr>
<tr>
<td>TV</td>
<td><a href="#"><p class="APAGADO"></p></a></td>
</tr>
<tr>
<td>VENTILADOR</td>
<td><a href="#"><p class="APAGADO"></p></a></td>
</tr>
<tr>
<td>EQUIPO DE SONIDO</td>
<td><a href="#"><p class="APAGADO"></p></a></td>
</tr>
</table>
</center>
</div>
</section>
</html>