Adding An Outline To Your Text Using the CSS3 text-stroke Property
March 3rd, 2010
In this tutorial I’ll show you how to add an outline, or stroke, to your text using the CSS3 text-stroke property.
Browser Support
Currently, these styles are only supported by Safari and Chrome.
Here’s What The CSS Looks Like
The first step is to declare a text color, I’ve picked red here. Next, we use the text-stroke property to assign a color (black) and weight (1px). For this example, I’ve created a class called .stroke.
.stroke {
color: #c00; /* text color */
-webkit-text-stroke: 1px #000; /* stroke color and weight */
}
Here’s What It Looks Like

Make sure you check out the Cardeo Minimal HTML Email Template.
The text-stroke Property Explained
Here’s a breakdown of the values for the text-stroke property.
- The first value is the stroke weight measured in pixels
- The second value is the stroke color
Using Transparency
If you’d like to make the text fill transparent, you can do so by using the text-fill-color property. For this example, I created a second class called .stroke-transparent.
.stroke-transparent {
-webkit-text-stroke: 1px #000;
-webkit-text-fill-color: transparent;
}
Here’s What It Looks Like

Support Files
That’s it, that’s all. Check out the Live Demo to see it in action, or Download the source files.
Print This Post
11 Comments on “Adding An Outline To Your Text Using the CSS3 text-stroke Property”
admin
Hi Marcos, thanks for that info. There isn’t a huge meaning behind the spelling of the name for me. The name came about from when my band was trying to think of a name a few years ago. Cardio was one that we decided not to go with but it stuck with me. I decided to change the spelling slightly to “cardeo” and run with that for my business/blog name.
March 11, 2010 » 4:19 pm
Printlover
Verily, there are very few people, nowadays anyway, thatworry about getting your text just right. GREAT ARTICLE SIR!
March 23, 2010 » 9:25 am
marcos assis
that’s nice! I’m happy in kind of sharing this name with you. it’s a nice job!
cheers!
April 5, 2010 » 3:05 pm
Padraig
Thank you for sharing your response, and offering some solutions.,lucy
May 20, 2010 » 6:05 pm
8 examples of stunning CSS3 text effects
[...] add an outline to text, and even better, use transparent text with a solid outline. View tutorial: http://www.cardeo.ca/2010/adding-an-outline-to-your-text-using-the-css3-text-stroke-propertyCSS textured text Ok, this isn’t new, and this isn’t CSS3, but this example is so great [...]
August 16, 2010 » 7:10 am
8 examples of stunning CSS3 text effects « Nap5teR
[...] Although this technique only works in webkit for now, I must admit that I really love it. You can add an outline to text, and even better, use transparent text with a solid outline. View tutorial: http://www.cardeo.ca/2010/adding-an-outline-to-your-text-using-the-css3-text-stroke-property [...]
August 17, 2010 » 12:16 pm
Sushama Thakur
Thanks for new concept. Is there any css available for same which support to firefox or IE.
August 18, 2010 » 2:27 am
Among many other things, CSS3 has lots of nice effects to enhance the typography of your website. In this article, I have compiled 8 extremely promising typography techniques done using CSS3. - - Tamil, movies, Religious Hindu Muslim christain Jain, Histo
[...] Although this technique only works in webkit for now, I must admit that I really love it. You can add an outline to text, and even better, use transparent text with a solid outline. View tutorial: http://www.cardeo.ca/2010/adding-an-outline-to-your-text-using-the-css3-text-stroke-property [...]
September 6, 2010 » 10:12 am








marcos assis
hi matt!
nice work yours.
i’m a brasilian (sorry about the language errors) control and automation engeneering student and a poet.
i have a blog named “cárdeo”. in portuguese it means a color from the “cardo” flower:
http://en.wikipedia.org/wiki/Thistle
that was how i came to your blog (googling). i’m very curious to know what means “cardeo” for you. i read that is a spanish village. is because of that?
thanks!
March 11, 2010 » 12:17 pm