3
What I wish to do
I want to create a menu and for each link I want to apply an effect "Hover". When the user hovers the mouse will be shown strokes to the sides of the link.
Image Example
Follows here as I am trying to do. When I hover over "home" I wish those 2 lines to appear on the side. I tried to use the <hr>
or <span>
and did not succeed.
What I’ve already tried
<li>
<a href="" title="Home"><p><span>__</span>home</p></a>
</li>
I tried to put the span tag next to the p, but the paragraph occupies 100 of the width, so it was on another line, so I tried to put that span next to the paragraph, then it gets glued, but it looks good on the "floor".
Update
<li>
<a href="" title="Home">
<div class="traco"></div>
<div class="textoMenu">home</div>
<div class="traco"></div>
</li>
<li>
<a href="" title="Empresa">
<div class="traco"></div>
<div class="textoMenu">a empresa</div>
<div class="traco"></div>
</li>
CSS
.traco {
width: 20px;
height: 1px;
background-color: transparent;
float: left;
margin-top: 8px;
}
.textoMenu{
.colorFonte(@corTodasLetras);
text-align: center;
font-family: Georgia;
font-size: 14px;
.marginReduzida(0,10px);
float: left;
}
Now I just need to find a way to center these links.
You can create these strokes by setting
height
andwidth
and leave asdisplay:none
, then when you pass the mouse, only color.classe:hover {display:block}
. if you have something you have already done in JSFIDDLE only reply.– Felipe Viero Goulart
Welcome to SO-PT, Allan, could post the code of what you have tried to do, so we can help you more easily.
– Fernando Leal
@Felipestoker I have tried to do so, but using span, and it did not work. Pro span I needed to insert something inside the tag for these properties to be applied.
– Allan Ramos
Try
.classe:hover span
then.– Felipe Viero Goulart
@Felipestoker put a display:block and it looked like this: http://imagizer.imageshack.us/v2/150x100q90/537/iA8Cww.jpg
– Allan Ramos
Got it, posted an answer, look, if it helps.
– Felipe Viero Goulart