Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to achieve shadows with text using CSS?

Tags:

html

css

How can I manipulate text with shadows in CSS to achieve an effect like the “30 Free Vector Icons” text below?

enter image description here

like image 470
rafek Avatar asked Dec 22 '22 03:12

rafek


2 Answers

try this :

HTML :

<div style="background:#ccccc;"><h1 class="myshadow">Cool text</h1></div>

CSS :

    h1.myshadow{
            color: #C8C8C8;
            letter-spacing: 2px;
            text-shadow: 1px 1px white, -1px -1px #444;
    }

CSS property you need to use is text-shadow

More info : http://www.w3schools.com/cssref/css3_pr_text-shadow.asp

like image 65
SuN Avatar answered Jan 02 '23 14:01

SuN


There is the text-shadow property, which is reasonably well-supported outside of Internet Explorer. IE’s Glow filter provides a kind of similar effect.

Safari and Chrome also have -webkit-text-stroke, but that’s not supported anywhere else.

like image 22
Paul D. Waite Avatar answered Jan 02 '23 14:01

Paul D. Waite