It can be done with CSS
pure% using a container for the links and at the moment you do hover
the second link appears:
div {
width: 100px; /* contenedor */
}
.esconder {
visibility: hidden; /* esconde el segundo <a> */
}
div:hover > .esconder {
visibility: visible;
}
<div>
<a href="#1">Editar</a>
<a class="esconder" href="#2" class="color"><i class="material-icons">delete</i></a>
</div>
EDIT:
A different and simpler solution since it was the first solution later duplicated .
We use the selector +
adjacent, which selects the next element which is just behind in the code HTML
and without needing a container.
The second link is shown only if we are on top of the first one.
a {
float: left;
padding-right: 5px;
}
a:hover { color: red; }
.esconder { display: none; }
.mostrar:hover + .esconder,
.esconder:hover {
display: inline-block;
}
<a class="mostrar" href="#1">Editar</a>
<a class="esconder" href="#2" class="color"><i class="material-icons">delete</i></a>