CSS: bolding some text without changing its container's size

后端 未结 11 1144
生来不讨喜
生来不讨喜 2020-11-29 16:55

I have a horizontal navigation menu, which is basically just a

    with the elements set side-by-side. I do not define width, but simply use padding, bec
11条回答
  •  粉色の甜心
    2020-11-29 17:57

    I found that most fonts are the same size when you adjust letter spacing by 1px.

    a {
       letter-spacing: 1px;
    }
    
    a:hover {
       font-weight: bold;
       letter-spacing: 0px;
    }
    

    While this does change the regular font so that each letter has an extra pixel spacing. For menus the titles are so short it doesn't present as a problem.

提交回复
热议问题