With CSS, you can design your text in many possible ways. You can add different colors, shadows, underlines or style it in a number of ways. In this post, you will be looking at different methods by which outline, or text stroke, can be added to text.
We will be covering two methods by which you can add outlines to your text. There is a third one also, but currently it is not supported by any browser.
Using text-stroke property
The text-stroke
property adds stroke to your text. It can be used to change the width and color of the text. This property is only supported by WebKit-based browsers and that too on using the -webkit-
prefix.
HTML
CSS
-webkit-text-stroke-width
and -webkit-text-stroke-color
specifies the width and the color of the stroke respectively. These are the two longhand properties for the shorthand property -webkit-text-stroke
which specifies both the stroke color and the width at one go. Thus, the above CSS code is equivalent to the one shown below.
Select your text and go to Type Create Outlines or press Ctrl/Cmd+Shift + O. You can also right-click on the text and select the same option. What creating outlines means is that your text is converted into its constituent vector paths. They can be opened on any computer without the need to have the font you’ve used installed on it. 3.4 Outline Text. 2/16/2021; 10 minutes to read; In this article. The outline text can be displayed visually, as shown in the figure titled 'Outline text' in section 3.1.The records used to construct the outline text are found inside the SlideListWithTextContainer record (section 2.4.14.3) contained within the DocumentContainer record (section 2.4.1).The child-record hierarchy of the. The OUTLINETEXTMETRIC structure contains metrics describing a TrueType font. MP4 trimmer to get rid of useless parts MP4 joiner to create a big movie Video editing software - best, free, easy to use Crop YouTube video to spread it on social media Trim YouTube video to make it shorter Video editor for MAC MP4 Cutter to show only significant moments Video editor for PC - no setup, never give up Free month subscription: you can really get rid of payment.
CSS
This text has stroke
You won't be able to see the above text if your browser does not support the text-stroke
property, because it has a white font color. In order to make the text visible in all these browsers, give it any text color other than the background color so that it becomes visible in all the browsers which do not support this property and use the -webkit-text-fill-color
property to override the text color in all WebKit-based browsers.
HTML
CSS
The text stroke will not be visible for some browsers
The above text will appear black in all the browsers which do not support the text-transform
property. For browsers which support this property, -webkit-text-fill-color
overrode the black text color to make it white.
Now, let's come to another method which can be used to add oulines to your text.
Using text-shadow property
Since text-stroke
doesn't have much browser support, you can use the text-shadow
property which has comparatively large support from browsers.
HTML
CSS
Stroke using text shadow
In the above demo, four text shadows (top-right, bottom-right, bottom-left and top-left) are given setting the blur radius 0. This effect is similar to that generated by the first method.
This method has an added advantage. We can adjust the horizontal and vertical shadows according to what suits the text. Adding a little blur radius will also give it a better look as in the following demo.
HTML
CSS
Stroke with blur radius
A drawback of using text shadows is that if you give the shadow length greater than 1px, then you may see discontinuous stroke.
More with text stroke
You can combine the text-stroke
and the text-shadow
properties to give another great effect.
HTML
CSS
Text Stroke
HTML
CSS
Text Stroke
Text Stroke
The above demo gives the effect of a thin white colored line following the path of the text for the first text and a curvy bold look for the second text. This can be achieved by just increasing the stroke width.
Have a look at some more text stroke effects
HTML
CSS
Text Stroke
Text Stroke
Outline Text Gimp
Text Stroke
These were some cool effects which you can add to your text using the above properties. You can come up with more beautiful text stroke effects by combining and altering the values of different properties like color, blur radius, stroke width and so on.
Browser Support
As discussed earlier, the text-stroke
property is supported with the -webkit-
prefix by the WebKit-based browsers. This is supported by Chrome, Safari, Opera and Android. On the other hand, text-shadow
is supported by almost all the browsers.
Outline Text In Gimp
There is also a third property text-outline
for adding outline to text, but currently it is not supported by any browser.
Create Outline In Word
Conclusion
Outline Text Cad
A slight touch of stroke can give a vibrant look to your text. Although text-stroke
serves the purpose by uniformly adding a smooth outline, I prefer using text-shadow
due to its good browser support. The latter is not intended for adding outlines, but is a very good CSS hack that gives you the effect you are looking for. Moreover, you can give blur effect with shadows which can add depth to your layout. Although text-shadow
does not give good results if the shadow length is greater than 1px, you can always use a combination of text-shadow
and text-stroke
.