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

Full-screen drag upload component based on Vue3

This article mainly introduces the full-screen dr...

Create a custom system tray indicator for your tasks on Linux

System tray icons are still a magical feature tod...

Solve the margin: top collapse problem in CCS

The HTML structure is as follows: The CCS structu...

Advantages and Problems of XHTML CSS Website Design

XHTML is the standard website design language cur...

A brief discussion on the perfect adaptation solution for Vue mobile terminal

Preface: Based on a recent medical mobile project...

How to collect Nginx logs using Filebeat

Nginx logs can be used to analyze user address lo...

The latest virtual machine VMware 14 installation tutorial

First, I will give you the VMware 14 activation c...

Detailed explanation of the pitfalls of Apache domain name configuration

I have never used apache. After I started working...

Detailed explanation of single-row function code of date type in MySQL

Date-type single-row functions in MySQL: CURDATE(...

How to use provide to implement state management in Vue3

Table of contents Preface How to implement Vuex f...

What is JavaScript anti-shake and throttling

Table of contents 1. Function debounce 1. What is...

The complete implementation process of Sudoku using JavaScript

Table of contents Preface How to solve Sudoku Fil...

How to quickly clean up billions of data in MySQL database

Today I received a disk alarm exception. The 50G ...

The principle and application of MySQL connection query

Overview One of the most powerful features of MyS...