Here is one way, if both el-a and el-b have a common parent:
.el-a a {
background-color: yellow;
}
.el-b a {
background-color: lightblue;
opacity: 0;
}
.parent a {
display: block;
overflow: hidden;
}
.parent:hover .el-a a {
opacity: 0
}
.parent:hover .el-b a {
opacity: 1
}
<div class="parent">
<div class="el-a">
<a href="#">1</a>
</div>
<div class="el-b">
<a href="#">2</a>
</div>
</div>
You didn't specify if you wanted the area that el-a was taking to collapse or not, so I didn't make it collapse, but that can be done as well. Also, it would be easier if either el-a and el-b were the same dimensions, or el-b occurs before el-a.