![]() ![]() Radial gradient full#Legend Full support Full support No support No support See implementation notes. Prefixed Prefixed Implemented with the vendor prefix: -o. Each shape is a single color determined by the color on the gradient ray it intersects. Percentage-based color-stop positions are relative to the intersection between the ending shape and this gradient ray, which represents 100%. The ending shape may be either a circle or an ellipse.Ĭolor-stop points are positioned on a virtual gradient ray that extends horizontally from the center towards the right. Radial gradient series#To create a smooth gradient, the radial-gradient() function draws a series of concentric shapes radiating out from the center to the ending shape (and potentially beyond). Composition of a radial gradientĪ radial gradient is defined by a center point, an ending shape, and two or more color-stop points. For this reason, radial-gradient() won't work on background-color and other properties that use the data type. ![]() To create a radial gradient that repeats so as to fill its container, use the repeating-radial-gradient() function instead.īecause s belong to the data type, they can only be used where s can be used. Its concrete size will match the size of the element it applies to. DescriptionĪs with any gradient, a radial gradient has no intrinsic dimensions i.e., it has no natural or preferred size, nor a preferred ratio. If omitted, the midpoint of the color transition is the midpoint between two color stops. The length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. Th color-hint is an interpolation hint defining how the gradient progresses between adjacent color stops. Including two stop positions is equivalent to declaring two color stops with the same color at the two positions. Percentage values in between are linearly positioned on the gradient ray. ![]() A percentage of 0%, or a length of 0, represents the center of the gradient the value 100% represents the intersection of the ending shape with the virtual gradient ray. A color-stop's value, followed by an one or two optional stop positions (either a or a along the gradient's axis). Use the standard keywords only, as some implementations have already dropped those older variants. Note: Early implementations of this function included other keywords ( cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively. The default value, the gradient's ending shape is sized so that it exactly meets the farthest corner of the box from its center. Similar to closest-side, except the ending shape is sized to meet the side of the box farthest from its center (or vertical and horizontal sides). The gradient's ending shape is sized so that it exactly meets the closest corner of the box from its center. The gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the vertical and horizontal sides closest to the center (for ellipses). A keyword describing how big the ending shape must be. The value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). Radial-gradient(circle at center, red 0, blue, green 100%) Values The position of the gradient, interpreted in the same way as background-position or transform-origin. Starting red, changing to blue, and finishing green */ Syntax /* A gradient at the center of its container, If you'd like to contribute to the interactive examples project, please clone and send us a pull request. The source for this interactive example is stored in a GitHub repository. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |