Reputation: 46479
I'm stuck and have no idea how to achieve following task. I searched the web, but have found nothing similar.
This is a text effect I want to achieve:
As you can see it has multiple colours (brown through the middle and white at the edges.) Is it possible to achieve something like this entirely in css and html (if it is please point me at right direction) or is it only achievable by using graphics?
Upvotes: 2
Views: 156
Reputation: 27405
this appears to only have webkit support at this time (FF/IE has no text-fill-color
property)
h1{
font-size:40px;
font-weight:bold;
font-family:Helvetica,Arial,sans-serif;
margin:0;
padding:0;
float:left;
background:-webkit-linear-gradient(-60deg, #ffffff 0%,#ffffff 25%,#000000 25%,#000000 75%,#ffffff 75%,#ffffff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
this is based on @Blowsie's answer from a similar post
Upvotes: 6
Reputation: 33238
You can use image and CSS property background-clip: text
to achieve something similar
http://trentwalton.com/2010/03/24/css3-background-clip-text/
It is still in development and works only on webkit
You could combine it together with css gradients
http://gradients.glrzad.com/
Upvotes: 1
Reputation: 9314
I've never tested this myself but I'm near 100% sure this will work.
h1{
content:'Hello';//this isn't needed but it's your content I'm guessing
mask-image:linear-gradient(45deg, #FFFFFF 0%, #FFFFFF 20%, #000000 20%, #000000 80%, #FFFFFF 80%, #FFFFFF 100%);//WW3
}
Using the webkit
extensions respectively.
Upvotes: 1