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
A dynamic clock demo based on Canvas is provided ...
Table of contents Variable type and storage space...
The previous article has installed the docker ser...
Preface Sometimes when we view database data, we ...
Table of contents Preface Introduction ngram full...
After installing Redis on Linux, use Java to conn...
Docker tag detailed explanation The use of the do...
You can see that their visual effects are very bea...
Table of contents 1. Solution 2. MySQL character ...
This article describes how to use MySQL to export...
background All of the company's servers are p...
Vmware Installation Installing Packages Download ...
1. Spring boot does not support jsp jar package, ...
Table of contents Phenomenon Root Cause Analysis ...
Table of contents Using slots in Vue: slot Scoped...