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
Table of contents 1. Embed CSS styles directly in...
Preface This article mainly introduces the releva...
Problem Description When VMware Workstation creat...
Displaying and interpreting information about you...
1. Introduction It has been supported since versi...
Table of contents 1. Block scope 1.1. let replace...
Installation Steps 1. Install Redis Download the ...
Lottie is an open source animation library for iO...
1. The Chinese garbled characters appear in MySQL...
Specific method: 1. Open Command Prompt 2. Enter ...
Unicode is a character encoding scheme developed ...
constraint Constraints ensure data integrity and ...
Preface meta is an auxiliary tag in the head area...
When the img src value is empty, two requests are ...
Create table & create index create table tbl1...