Are there any ways in CSS to give outlines to text with different colors ? I want to highlight some parts of my text to make it more intuitive – like the names, links, etc. Changing the link colors etc. are common nowadays, so I want something new.
Share
There is an experimental webkit property called
text-strokein CSS3, I’ve been trying to get this to work for some time but have been unsuccessful so far.What I have done instead is used the already supported
text-shadowproperty (supported in Chrome, Firefox, Opera, and IE 9 I believe).Use four shadows to simulate a stroked text:
I have made a demo for you here
And a hovered example is available here
As Jason C has mentioned in the comments, the
text-shadowCSS property is now supported by all major browsers, with the exception of Opera Mini. Where this solution will work for backwards compatibility (not really an issue regarding browsers that auto-update) I believe thetext-strokeCSS should be used.