I have a div with some text inside and a border.
<div><span>This is my div</span></div>
When I hover on that div, I want the font to be bold.
div{
border: 1px solid black;
display:inline-block;
padding:20px;
}
span{
padding:20px;
}
div:hover{
font-weight:bold;
}
This makes my div a bit wider - which causes an annoying flicker.
Example on JSFiddle
How can I resolve this problem?
EDIT:
The div's width has to grow with content, but not with weight.