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?
This article records the creation of a USB boot d...
//grammar: @media mediatype and | not | only (med...
Recently, when using select query in a project, I...
Apache Tika is a library for file type detection ...
There is a picture in a big box. When you put the...
mysql basic data types Overview of common MySQL d...
Table of contents Nesting Parent-child component ...
Preface: During database operation and maintenanc...
1. Install less dependency: npm install less less...
lead Some common triangles on web pages can be dr...
Download the official website Choose the version ...
Table of contents Master-Master Synchronization S...
1. Arrange CSS in alphabetical order Not in alphab...
Recently, I need to do a small verification exper...
Table of contents The role of foreign keys mysql ...