search
HomeWeb Front-endHTML TutorialCSS3鼠标悬停图片动画_html/css_WEB-ITnose

 

 

鼠标放到图片上后:

demo地址:demo

 

div:

 1     <div class="wai"> 2         <a href="#"> 3             <div class="spinner"></div> 4             <div class="img"> 5                 <img src="/static/imghwm/default1.png"  data-src="images/example.png"  class="lazy" alt="img"> 6             </div> 7             <div class="info"> 8                 <div class="info-back"> 9                     <h3 id="Heading-here">Heading here</h3>10                     <p>Description goes here</p>11                 </div>12             </div>13         </a>14     </div>

 

css:

  1         .wai{  2             height: 220px;  3             position: relative;  4             width: 220px;  5         }  6         .wai * {  7             box-sizing: border-box;  8         }  9  10         /*圆形边框*/ 11         .wai .spinner{ 12             border-color: #e53aec #74b9d2 #74b9d2 #e234ec; /*上右下左的边框颜色*/ 13             border-image: none; 14             border-radius: 50%; 15             border-style: solid; 16             border-width: 10px; 17             height: 230px; 18             transition: all 0.8s ease-in-out 0s; 19             width: 230px; 20         } 21  22         /*图片*/ 23         .wai .img::before { 24             display: none; 25             border-radius: 50%; 26             box-shadow: 0 0 0 16px rgba(255, 255, 255, 0.6) inset, 0 1px 2px rgba(0, 0, 0, 0.3); 27             content: ""; 28             height: 100%; 29             position: absolute; 30             transition: all 0.35s ease-in-out 0s; 31             width: 100%; 32         } 33         .wai .img { 34             border-radius: 50%; 35             bottom: 0; 36             height: auto; 37             left: 10px; 38             position: absolute; 39             right: 0; 40             top: 10px; 41             width: auto; 42             vertical-align: middle; 43         } 44         .wai .img img { 45             border-radius: 50%; 46             height: 100%; 47             width: 100%; 48  49         } 50  51  52         /*下方文字的设置*/ 53  54         .wai .info { 55             background: rgba(0, 0, 0, 0.6) none repeat scroll 0 0; 56             bottom: 0; 57             left: 10px; 58             opacity: 0; 59             right: 0; 60             top: 10px; 61             transition: all 0.8s ease-in-out 0s; 62         } 63         .info { 64             backface-visibility: hidden; 65             border-radius: 50%; 66             bottom: 0; 67             left: 0px; 68             position: absolute; 69             right: 0; 70             text-align: center; 71             top: 0px; 72         } 73         .wai .info p { 74             color: #bbb; 75             padding: 10px 5px; 76             font-style: italic; 77             margin: 0 30px; 78             font-size: 12px; 79             border-top: 1px solid rgba(255, 255, 255, 0.5); 80         } 81         .wai .info h3 { 82             color: #fff; 83             text-transform: uppercase; 84             position: relative; 85             letter-spacing: 2px; 86             font-size: 22px; 87             margin: 0 30px; 88             padding: 55px 0 0 0; 89             height: 110px; 90             text-shadow: 0 0 1px white, 0 1px 2px rgba(0, 0, 0, 0.3); 91         } 92  93         /*hover后的动作---*/ 94         .wai a:hover { 95             text-decoration: none; 96         } 97         .wai a:hover .spinner { 98             -webkit-transform: rotate(180deg); 99             -moz-transform: rotate(180deg);100             -ms-transform: rotate(180deg);101             -o-transform: rotate(180deg);102             transform: rotate(180deg);103         }104 105         .wai a:hover .info {106             opacity: 1;107         }

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Are the HTML tags and elements the same thing?Are the HTML tags and elements the same thing?Apr 28, 2025 pm 05:44 PM

The article explains that HTML tags are syntax markers used to define elements, while elements are complete units including tags and content. They work together to structure webpages.Character count: 159

What is the significance of <head> and <body> tag in HTML?What is the significance of <head> and <body> tag in HTML?Apr 28, 2025 pm 05:43 PM

The article discusses the roles of <head> and <body> tags in HTML, their impact on user experience, and SEO implications. Proper structuring enhances website functionality and search engine optimization.

What is the difference between <strong>, <b> tags and <em>, <i> tags?What is the difference between <strong>, <b> tags and <em>, <i> tags?Apr 28, 2025 pm 05:42 PM

The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.

Please explain how to indicate the character set being used by a document in HTML?Please explain how to indicate the character set being used by a document in HTML?Apr 28, 2025 pm 05:41 PM

Article discusses specifying character encoding in HTML, focusing on UTF-8. Main issue: ensuring correct display of text, preventing garbled characters, and enhancing SEO and accessibility.

What are the various formatting tags in HTML?What are the various formatting tags in HTML?Apr 28, 2025 pm 05:39 PM

The article discusses various HTML formatting tags used for structuring and styling web content, emphasizing their effects on text appearance and the importance of semantic tags for accessibility and SEO.

What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?Apr 28, 2025 pm 05:39 PM

The article discusses the differences between HTML's 'id' and 'class' attributes, focusing on their uniqueness, purpose, CSS syntax, and specificity. It explains how their use impacts webpage styling and functionality, and provides best practices for

What is the 'class' attribute in HTML?What is the 'class' attribute in HTML?Apr 28, 2025 pm 05:37 PM

The article explains the HTML 'class' attribute's role in grouping elements for styling and JavaScript manipulation, contrasting it with the unique 'id' attribute.

What are different types of lists in HTML?What are different types of lists in HTML?Apr 28, 2025 pm 05:36 PM

Article discusses HTML list types: ordered (<ol>), unordered (<ul>), and description (<dl>). Focuses on creating and styling lists to enhance website design.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!