I have a listing of social networking icons, which I know how to do, I'm not here to ask how to do it, but rather, a more correct way to minimize my work, if there is one.
My HTML looks like this:
<ul>
<li class="rodapeTitulos">Redes Sociais</li>
<li class="icoFB"></li>
<li class="icoTT"></li>
<li class="icoIns"></li>
<li class="icoPlu"></li>
<li class="icoPin"></li>
</ul>
My CSS:
.icoFB{
background-image: url("../imagens/fb.jpg");
background-repeat: no-repeat;
background-position: center 0;
width: 43px;
height: 43px;
float: left;
margin-right: 1px;
}
.icoFB:hover{background-position: center 43px;}
Okay, with this, the Facebook icon will change the position of the image with the Hover effect. Until then, I just do this same process for each of them, icoTT, icoIns ...
I would like to know if there is any easier way, maybe a class that stores the properties that will be repeated in all the divs, something like this:
.icoRodape{
background-repeat: no-repeat;
background-position: center 0;
width: 43px;
height: 43px;
float: left;
margin-right: 1px;
}
.icoRodape.icoFB{background-image: url("../imagens/fb.jpg");}
.icoRodape.icoTT{background-image: url("../imagens/tt.jpg");}
.icoRodape.icoIns{background-image: url("../imagens/inst.jpg");}
.icoRodape.icoPlu{background-image: url("../imagens/gpl.jpg");}
.icoRodape.icoPin{background-image: url("../imagens/pin.jpg");}
.icoRodape:hover{background-position: center 43px;}
Ok, this is not correct, just to give an even example. Is there any way to minimize my work and code?