font-weight:blod跳動如何處理

來源:互聯網
上載者:User
這次給大家帶來font-weight:blod跳動如何處理,處理font-weight:blod跳動的注意事項有哪些,下面就是實戰案例,一起來看一下。

需求:實現滑鼠移至上方在連結上時,連結字型加粗的功能。

實現方式1:

a:hover{font-weight:blod}

結果滑鼠移至上方的時候,頁面會有跳動的現象。因為改變字型的時候改變了元素的大小,所以引起了頁面的重排,所以會有跳動的現象。

實現方式2:

a:hover{text-shadow: 1px 0 0 currentColor;}

效果對比:

相信看了本文案例你已經掌握了方法,更多精彩請關注php中文網其它相關文章!

推薦閱讀:

css3的動畫序列animation

CSS怪異盒模型和標準盒模型如何使用

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.