Template:Linear-gradient

From HorizonXI Wiki
Revision as of 04:50, 14 February 2023 by Garnet-HorizonXI (Fandom) (talk | contribs) (Created page with "<includeonly>background-image: -moz-linear-gradient({{{1|}}}, {{{2|}}}); background-image: -o-linear-gradient({{{1|}}}, {{{2|}}}); background-image: -webkit-linear-gradient({{{1|}}}, {{{2|}}}); background-image: linear-gradient({{#switch: {{{1|}}} | top = to bottom | bottom = to top | left = to right | right = to left | top left | left top = to bottom right | top right | right top = to bottom left | bottom left | left bottom = to top right | bottom right | right bottom =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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>

  1. start position – Mandatory. Specify a start point: left, top, right or bottom, or a combination of two of each, e.g. top left. This provides eight starting points.
  2. color – The first two colors are mandatory. You can define any number of additional colors, separated with commas.
  3. stop – Optional. You can specify a stop position for each color using a percentage (e.g. 45%) or pixels (e.g. 60px).

Examples

  • <div style="{{Linear-gradient|left|#ffdddd, #ddddff}}">Lorem ipsum...</div> will produce
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • <div style="{{Linear-gradient|left|#ffdddd, #ddffdd 50%, #ddddff}}">Lorem ipsum...</div> will produce
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • <div style="{{Linear-gradient|top|#ffdddd, #ddddff}}">Lorem ipsum...</div> will produce
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.