Effect To implement HTML, first prepare a clean HTML page and write the nodes: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="styleSheet" type="text/css" href="./style.css" /> </head> <body> <div> <section class="card"> <div class="card-top"> Was this page helpful? </div> <div class="card-bottom"> <div title="👍"> YES </div> <div title="👎"> NO </div> </div> </section> </div> </body> </html> CSS Create a body { margin: 0; padding: 0; /* Switch between horizontal and vertical screens on mobile*/ -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; /* Rendering optimization */ -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-size: 15px; } * { box-sizing: border-box; font-family: "Fira Code", Hack, Consolas; } :root { --color: #ff4081 } section { margin: 0; padding: 0; } .card { font-size: inherit; position: fixed; right: 0; bottom: 0; background-color: var(--color); border-radius: 4px 4px 0 0; box-shadow: 0 16px 60px 0 rgba(86, 91, 115, 0.2); opacity: 0.5; transform: translateX(-20px) translate(103px, 27px) rotate(35deg); transition: all 400ms cubic-bezier(0.26, 0.6, 0.4, 1.54); } .card:hover { opacity: 1; transform: translate(0, 0) rotate(0deg) translateX(-20px); } .card-top { height: 50px; line-height: 50px; padding: 0 1rem; text-align: center; user-select: none; color: #fff; } .card-bottom { display: flex; background-color: #fff; justify-content: space-evenly; } .card-bottom div { padding: 1rem; cursor: pointer; font-weight: 700; text-transform:uppercase; text-decoration: none ; color: var(--color); transition: all .2s linear; } .card-bottom div:hover { text-shadow: 0 1px 1px var(--color); letter-spacing: 1px; } Two animations:
Animation process: Note that Summarize This is the end of this article about how to use CSS to create a small like card effect in the lower right corner of a web page (example code). For more related CSS content about the small like card effect in the lower right corner of a web page, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: How to prevent Flash from covering HTML div elements
>>: Is it easy to encapsulate a pop-up component using Vue3?
1. Download the corresponding installation file f...
1. This afternoon, due to the requirements of the...
The logs in MySQL include: error log, binary log,...
Public name of the page: #wrapper - - The outer e...
As a front-end novice, I tinkered with the front-e...
Nginx does not support nested if statements, nor ...
Table of contents Preface optimization Extract va...
Copy code The code is as follows: <form method...
Table of contents Preface What is a filter How to...
Table of contents 1. Phenomenon 2. Solution 3. Su...
What is "Sticky Footer" The so-called &...
Here's the thing: Everyone knows about "...
1. Source of the problem A friend @水米田 asked me a...
Introduction to XHTML tags <br />Perhaps you...
The information on Baidu is so diverse that it...