search
HomeWeb Front-endHTML TutorialPure CSS3 text effect recommendation_html/css_WEB-ITnose

I have studied several text effects implemented in pure CSS before, such as "CSS Text Stripe Shadow Animation" and "Responsive Cream Three-dimensional Character Effect". Today we will study several text effects, mainly using text- Several unique features of shadow and webkit kernels achieve effects.

Click here to study online and click here to download collections.

Effect 1-3D text effect


Our html file looks like this. In order to better display the effect, we have added editable attributes.

<div contenteditable="true" class="text effect01">前端开发whqet</div>
In the css file, we first look at the global settings

body{  background-color: #666;}@import url(http://fonts.googleapis.com/css?family=Dosis:500,800);.text {    font-family:"微软雅黑", "Dosis", sans-serif;    font-size: 80px;    text-align: center;    font-weight: bold;    line-height:200px;    text-transform:uppercase;    position: relative;}
Then there is the exclusive CSS for effect one, which is very simple. Just use text-shadow to achieve the three-dimensional character effect

.effect01{    background-color: #333;    color:#fefefe;    text-shadow:    0px 1px 0px #c0c0c0,    0px 2px 0px #b0b0b0,    0px 3px 0px #a0a0a0,    0px 4px 0px #909090,    0px 5px 10px rgba(0, 0, 0, 0.6);}

Effect 2-long tail effect


html file Still the same

<div contenteditable="true" class="text effect02">前端开发whqet</div>
The text-shadow is offset a little more, the color becomes simpler, and the long tail effect comes.

.effect02{  color:#333;  background-color: #ddd;  text-shadow:    1px -1px 0 #767676,     -1px 2px 1px #737272,     -2px 4px 1px #767474,     -3px 6px 1px #787777,     -4px 8px 1px #7b7a7a,     -5px 10px 1px #7f7d7d,     -6px 12px 1px #828181,     -7px 14px 1px #868585,     -8px 16px 1px #8b8a89,     -9px 18px 1px #8f8e8d,     -10px 20px 1px #949392,     -11px 22px 1px #999897,     -12px 24px 1px #9e9c9c,     -13px 26px 1px #a3a1a1,     -14px 28px 1px #a8a6a6,     -15px 30px 1px #adabab,     -16px 32px 1px #b2b1b0,     -17px 34px 1px #b7b6b5,    -18px 36px 1px #bcbbba,     -19px 38px 1px #c1bfbf,     -20px 40px 1px #c6c4c4,     -21px 42px 1px #cbc9c8,     -22px 44px 1px #cfcdcd;}

Effect 3-Inner Shadow


html file

<div contenteditable="true" class="text effect03">前端开发whqet</div>
css file

.effect03{  color: #202020;  background-color: #2d2d2d;  text-shadow:     -1px -1px 1px #111111,    2px 2px 1px #363636;}

Effect 4-twill stroke effect


html file

<div contenteditable="true" class="text effect04">前端开发whqet</div>
css file, use linear-gradient to set striped background for div, only in Implementation of displaying background on text (-webkit-background-clip: text;), transparent text color (-webkit-text-fill-color: transparent;) and text stroke (-webkit-text-stroke: 2px #111;) .

.effect04{  background-color: #333;  background-image:      linear-gradient(        45deg,        transparent 45%,        hsla(48,20%,90%,1) 45%,        hsla(48,20%,90%,1) 55%,        transparent 0        );    background-size: .05em .05em;  -webkit-background-clip: text;  -webkit-text-fill-color: transparent;  -webkit-text-stroke: 2px #111;}

Effect Five - Text Stripe Animation


html file

<div data-text="前端开发whqet" class="text effect05">前端开发whqet</div>
css file, using :before pseudo-object Displays and animates stripes.

.effect05{    color:#DC554F;    background-color:#27ae60;    z-index: 3;}.effect05:before{    content:attr(data-text);      width:100%;    line-height:200px;    opacity: .5;    position: absolute;    top:2px;    left:5px;    background-image:        linear-gradient(          45deg,          transparent 45%,          hsla(48,20%,90%,1) 45%,          hsla(48,20%,90%,1) 55%,          transparent 0          );     z-index:-1;    background-size: .05em .05em;      -webkit-background-clip: text;    -webkit-text-fill-color: transparent;     animation: shadowGo 20s linear infinite; }@keyframes shadowGo{       0% {background-position: 0 0}      0% {background-position: -100% 100%}}; 

Effect Six - Stroke Text


html file

<div contenteditable="true" class="text effect06">前端开发whqet</div>
css file

.effect06 {    -webkit-text-fill-color: transparent;    -webkit-text-stroke: 2px #d6d6d6;    background: url(http://www.pencilscoop.com/demos/CSS_Text_Effects/images/galaxy.jpg);    background-size: cover;}

Effect 7 - Mask text


html file

<div contenteditable="true" class="text effect07">前端开发whqet</div>
css file

.effect07 {    background: url(http://www.pencilscoop.com/demos/CSS_Text_Effects/images/galaxy.jpg) #333;    -webkit-background-clip: text;    -webkit-text-fill-color: transparent;    background-size: cover;    animation: 10s infinite linear animate;}.effect07:before {    content:"";    width:100%;    height:100%;    position: absolute;    left:0;    top:0;    background-color: #999;    z-index: -1;}@keyframes animate {    0% {        background-position:0;    }    100% {        background-position:-1000px 0;    }}

Effect eight-3D glare effect


html file

<div class="text effect08">  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>  <h1 id="前端开发whqet">前端开发whqet</h1>
</div>
css file

.effect08 {    color:#fff;    transform-origin:center bottom;    transform-style:preserve-3d;    transition:all 1s;    cursor: pointer;}.effect08:hover {    transform:rotate3d(1, 0, 0, 40deg);}.effect08 h1 {    position: absolute;    left:0;    right:0;    margin:auto;    text-shadow:0 0 10px rgba(0, 0, 100, .5);}@for $n from 1 to 8 {    .effect08 h1:nth-child(#{$n}) {        transform:translateZ(4px*$n);    }}

That's it.

--------------------------------------------- --------------------------

Front-end development whqet, pay attention to web front-end development and share related resources.
-------------------------------------------------- ------------------

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
What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML in Action: Examples of Website StructureHTML in Action: Examples of Website StructureMay 05, 2025 am 12:03 AM

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

HTML's Purpose: Enabling Web Browsers to Display ContentHTML's Purpose: Enabling Web Browsers to Display ContentMay 03, 2025 am 12:03 AM

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

Explain the importance of using consistent coding style for HTML tags and attributes.Explain the importance of using consistent coding style for HTML tags and attributes.May 01, 2025 am 12:01 AM

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

How to implement multi-project carousel in Bootstrap 4?How to implement multi-project carousel in Bootstrap 4?Apr 30, 2025 pm 03:24 PM

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

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

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.