Effect picture: html: <div class='site_bar'>Home</div> css: .site_bar{ background-image : linear-gradient(red,red); background-position : center bottom; background-size : 0 2px; background-repeat : no-repeat; //This attribute cannot be missing. transition : .3s; } .site_bar:hover{ background-size : 100% 2px; } Summarize The above is the pure CSS implementation of horizontal line animation (background-image) under the element introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: Some questions about hyperlinks
>>: JavaScript imitates Jingdong magnifying glass effect
1. Introduction Sometimes, after the web platform...
The relevant person in charge of Baidu Input Metho...
A word in advance: Suddenly I received a task to ...
Preface Sometimes when we view database data, we ...
1. Create a new virtual machine in VMware 15.5 1....
1. Create the MySQL database nacos_config 2. Sele...
We are all familiar with the tr command, which ca...
vue-element-admin import component encapsulation ...
Table of contents 1. mixin.scss 2. Single file us...
Table of contents What is MVCC MVCC Implementatio...
Table of contents Query Background 1. Like query ...
Table of contents 1. Vue installation Method 1: C...
Table of contents 1. Current limiting algorithm 2...
Table of contents Process Communication Bidirecti...
This status code provides information about the s...