Template:Text outline 2
This template uses the CSS -webkit-text-stroke
property, which can be Add a stroke style to the text. This template has some usage restrictions, see #restrictions.
Parameters
Parameters | Description | Default value |
---|---|---|
(1) | The text to be outlined, required | none |
text-color (2) | Use CSS color values like: red / #114514 / rgb(191, 98 , 10) / hsl(0deg, 100%, 50%) . See Help:List of colors. |
inherit |
outline-color (3) | Black | |
outline-width | Use CSS length, such as: 1px / 0.2em , etc. (the actual outline width is half of this value); or use thin , medium , thick keywords, from thin to thick. It is recommended to use em as the unit to maintain uniformity on each device. |
0.15em |
CSS | Extra CSS property. | None |
CSS2 | CSS properties applied only to the outline layer, overriding the CSS above. This parameter is used to solve the problem of "adding shadows directly using CSS parameters will cause double shadows". If unnecessary, adding shadows is not recommended, because the interaction between text-shadow and text-outline is not uniform between different browsers. There will be a very ghostly effect on Safari. |
None |
Example
enter | result |
---|---|
{{Text outline 2|Black text with a black border, it is better to use bold}} |
Black text with a black border, Might as well use boldBlack text with a black border, Might as well use bold |
{{Text outline 2|Use Anonymous Parameter|#FFF|#FF9595}} |
Use Anonymous ParameterUse Anonymous Parameter |
{{Text outline 2|Use Named Parameters|text-color=white|outline-width=0.1em}} |
Use Named ParametersUse Named Parameters |
{{Text outline 2|Use CSS|text-color=antiquewhite|outline-color=brown|CSS=font-size:1.5em}} |
Use CSSUse CSS |
Limited
- Because this template will copy the content of parameter 1 twice (one layer of outline, one layer of text. Otherwise, the effect is This way, the outline will cover the text, where the text is already set to white.), so:
- Do not use this template in {{title_replace}}. If this template is used in {{Title Replacement}}, the title on the title block will be duplicated. For example Special:Permalink/5354170, the title bar is displayed as "-{Ultramarine Hymn Ultramarine Hymn}-".
- Try to put this template inside other templates, such as
{{lj|{{text outline 2|...}}}}
, not>{{text outline 2|{{lj|…}}}}
, which can reduce the expanded length.
- Shadows render abnormally on Safari, try not to add shadows.
Related Templates
- {{Text outline}}
|