/    Sign up×
Community /Pin to ProfileBookmark

Text shadows and other CSS effects

Does anybody know how to create text shadows and other cool effects using CSS?

Is this possible?

PS: I’ve searched the forum and found no answers. Sorry if this is a repost.

to post a comment
CSS

10 Comments(s)

Copy linkTweet thisAlerts:
@Lone_ReactionAug 24.2005 — I don't think it is possible now... in a few years it will be!


http://www.w3.org/TR/2003/CR-css3-text-20030514/#text-shadows
Copy linkTweet thisAlerts:
@gimbrasauthorAug 24.2005 — Sorry I had this in my notebook, it can be done! ?
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;!-- Text Shadow --&gt;
&lt;p style="Filter: Shadow(Color:#FF00FF, direction=90); font-size:18px;
color=#000000;
width=100"&gt;Disco Night&lt;/p&gt;


&lt;/body&gt;


But only IE shows this effect
Copy linkTweet thisAlerts:
@the_treeAug 24.2005 — That's not CSS though, it's just some proprietry rubbish.
Copy linkTweet thisAlerts:
@SiddanAug 24.2005 — That's not CSS though, it's just some proprietry rubbish.[/QUOTE]

Well that can be put inside a css file and you can make nice text displays without having to use images. So rubbish I think not. More rubbish that FF doesn´t support it... but that is my opinion
Copy linkTweet thisAlerts:
@NogDogAug 24.2005 — It is possible to create a drop shadow effect with CSS as below, but due to the repetitive text in the HTML markup, it's probably better to just create the desired text effect as a graphic image and insert it into your document via an IMG tag.
[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
<title>Page title</title>
<style type="text/css">
<!--
body {
margin: 0;
padding: 10px;
font: medium arial, sans-serif;
}
#shadow1, #shadow2, #top {
font-size: xx-large;
font-weight: bold;
position: absolute;
margin: 0;
padding: 0;
}
#shadow1 {
top: 10px;
left: 15px;
color: gray;
}
#shadow2 {
top: 9px;
left: 14px;
color: silver;
}
#top {
top: 8px;
left: 13px;
color: #6cf;
}
#main {
position: absolute;
top: 3em;
}
-->
</style>
</head>
<body>
<p id="shadow2">This Is a Test</p>
<p id="shadow1">This Is a Test</p>
<p id="top">This Is a Test</p>
<div id="main">
<h3>Rest of text follows here.</h3>
<p>Yadda, yadda, yadda...</p>
</div>
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@NogDogAug 24.2005 — Well that can be put inside a css file and you can make nice text displays without having to use images. So rubbish I think not. More rubbish that FF doesn´t support it... but that is my opinion[/QUOTE]
It is not anywhere in the w3.org CSS2 specification. It is a proprietary filter created by M$ for IE. There is a drop shadow effect in the proposed CSS3 standard, but that version has not yet been finalized, and who knows how long it will take for browsers to implement it once it is? (All we can count on is for IE to be the last of the major browsers to support it. ? )
Copy linkTweet thisAlerts:
@pathfinder74Mar 01.2008 — Old thread ressurection time. I'm trying to figure this out now.

Is it possible?

If so how far back do the browser versions support it?
Copy linkTweet thisAlerts:
@WebJoelMar 01.2008 — ...Is it possible?[/quote] That depends upon how hard your're willing to work on making it so: this works & validates just fine:

<div style="position:relative; width:480px; height:60px; border:1px solid red;">

<h1 style="position:absolute; top:10px; left:10px; color:red;">Some fairly kewl-looking Header text</h1>

<h1 style="position:absolute; top:11px; left:9px; color:yellow;">Some fairly kewl-looking Header text</h1>

<h1 style="position:absolute; top:12px; left:8px; color:black;">Some fairly kewl-looking Header text</h1>

</div>[/QUOTE]
Bearing in mind that 'drop-shadows' on any text is purely presentational ("eye-candy"), I don't get too worried over it.
Copy linkTweet thisAlerts:
@pathfinder74Mar 02.2008 — How would you put that to an external style sheet?
Copy linkTweet thisAlerts:
@drhowarddrfineMar 02.2008 — Safari supports the CSS property 'text-shadow' and Opera 9.5 does, I think.

As stated above, don't use proprietary junk made up by IE that only works on IE.
×

Success!

Help @gimbras spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...