A.M.A.N. Trove • Ambuscade • Dynamis Divergence • Geas Fete • High-Tier Battlefields • Master Trials • Monthly Campaigns • Odyssey • Omen • Skirmish • Sortie • Unity • Vagary | The Voracious Resurgence |
Prime Weapons • Ultimate Weapons • Ultimate Augments • Abjurations iL119 • JSE Necks • Divergence Augments • Escutcheons | |
Reforged Armor Artifact: +1 • iL109 • iL119/+2/+3 Relic: +1/+2 • iL109 • iL119/+2/+3 Empyrean: +1/+2 • iL109 • iL119/+2/+3 |
Guides • Crafting • Trusts • Apex Monsters |
Template:Linear-gradient
Usage
Use within a CSS style tag. The template uses the background-image
property.
<div style="{{linear-gradient | start position | #color [stop], #color [stop][, #color [stop], ...] }}">Lorem ipsum...</div>
start position
– Mandatrory. Specify a start point:left
,top
,right
orbottom
, or a combination of two of each, e.g.top left
. This provides eight starting points.color
– The first two colors are mandatory. You can define any number of additional colors, separated with commas.stop
– Optional. You can specify a stop position for each color using a percentage (e.g. 45%) or pixels (e.g. 60px).
Technical notes
The template does not assign a default background-color, and therefor does not provide an automatic fallback for browsers that do not support gradients. To provide a fallback, always specify a background color in front of the template.
This template uses the new CSS3 properties for linear gradients: -moz-linear-gradient
, -o-linear-gradient
, -webkit-linear-gradient
and linear-gradient
It does not use the legacy -webkit-gradient
property due to its deviating parameter format. This means that this template does not work in Safari versions below 5.1 and Google Chrome versions below 10.
Examples
<div style="{{linear-gradient|left|#ffdddd, #ddddff}}">Lorem ipsum...</div>
will produce
<div style="{{linear-gradient|left|#ffdddd, #ddffdd 50%, #ddddff}}">Lorem ipsum...</div>
will produce
<div style="{{linear-gradient|top|#ffdddd, #ddddff}}">Lorem ipsum...</div>
will produce
Technical notes
This template uses the new CSS3 properties for linear gradients: -moz-linear-gradient
, -o-linear-gradient
and -webkit-linear-gradient
. It no longer use the legacy -webkit-gradient
property due to it's deviating parameter format. This means that this template does not work in Safari versions below 5.1 and Google Chrome versions below 10.
Considerations
Above examples use contrasting colors to show the effect more clearly. It is best to use subtle differences in color to enhance the appearance, rather than radically change it. This also minimizes the effects between browsers that do and do not support gradients.