Example code for implementing 3D text hover effect using CSS3

Example code for implementing 3D text hover effect using CSS3

This article introduces the sample code of CSS3 to achieve the effect of 3D text hover change, which is shared with you as follows:

html

<h1 class="hover-text-3d" data-text="w3cbest.com">W3CBEST.COM</h1>

CSS

.hover-text-3d {
    font-size: 7em;
}
.hover-text-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    -webkit-text-fill-color: #fff;
    text-fill-color: #fff;
}
.hover-text-3d:before {
    position: absolute;
    overflow: hidden;
    width: 0;
    content: attr(data-text);
    -webkit-transition: 2s;
    -o-transition: 2s;
    transition: 2s;
    -webkit-text-fill-color: #aaf0d1;
    text-fill-color: #aaf0d1;
    -webkit-text-stroke-width: 2px;
    text-stroke-width: 2px;
    -webkit-text-stroke-color: #aaf0d1;
    text-stroke-color: #aaf0d1;
    -webkit-filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, .8));
    -o-filter:drop-shadow(5px 5px 5px rgba(0, 0, 0, .8));
    filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, .8));
}
.hover-text-3d:hover:before {
    width: 100%;
}

View the effect

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  WML tag summary

>>:  Docker file storage path, modify port mapping operation mode

Recommend

The main differences between MySQL 4.1/5.0/5.1/5.5/5.6

Some command differences between versions: show i...

MySQL Optimization Summary - Total Number of Query Entries

1. COUNT(*) and COUNT(COL) COUNT(*) usually perfo...

How to optimize MySQL query speed

In the previous chapters, we introduced how to ch...

Docker installation tomcat dubbo-admin instance skills

1. Download the tomcat image docker pull tomcat:8...

Analysis of the Poor Performance Caused by Large Offset of LIMIT in MySQL Query

Preface We all know that MySQL query uses the sel...

Introduction to user management under Linux system

Table of contents 1. The significance of users an...

JavaScript custom calendar effect

This article shares the specific code of JavaScri...

Tips on setting HTML table borders

For many people who are new to HTML, table <ta...

Implementation of React star rating component

The requirement is to pass in the rating data for...

Steps of an excellent registration process

For a website, it is the most basic function. So l...

Detailed explanation of MySQL InnoDB secondary index sorting example

Sorting Problem I recently read "45 Lectures...

In-depth explanation of slots and filters in Vue

Table of contents Slots What are slots? Slot Cont...

Pure CSS drop-down menu

Achieve results Implementation Code html <div ...

How to set up jar application startup on CentOS7

Pitfalls encountered during project deployment Wh...