Ratio
Leave feedback
On this page
Represents a “ratio” CSS data type, which is used for describing aspect ratios in media queries and for raster images by denoting the proportion between two unitless values called “numerator” and “denominator”. Immutable struct.
public struct Ratio : ICloneable, ICssDataType, IEquatable<Ratio>
| Name | Description |
|---|---|
| Denominator { get; } | Returns a denominator of this ratio |
| IsDefault { get; } | Determines whether this ratio has default value or is a “1/1” (Single) |
| Numerator { get; } | Returns a numerator of this ratio |
| Name | Description |
|---|---|
| static Create(ushort, ushort) | Creates and returns one Ratio instance from specified numerator and denominator |
| Calculate() | Calculates and returns this ratio as a single floating point number |
| Clone() | Returns a full copy of this ratio |
| override Equals(object) | Determines whether this instance is equal with specified uncasted object, which presumably is another “Ratio” instance |
| Equals(Ratio) | Determines whether this instance is equal with specified “Ratio” instance |
| override GetHashCode() | Returns a hashcode for this instance, which cannot be changed during its lifetime |
| GetInverseRatio() | Generates and returns an inverse (reciprocal) ratio for this ratio |
| SerializeDefault() | Serializes this ratio to the string and returns it |
| override ToString() | Returns a string representation of this ratio; same as “SerializeDefault()” |
| operator == | Compares two ratios and returns a boolean indicating if the two do match. |
| operator != | Compares two ratios and returns a boolean indicating if the two do not match. |
| Name | Description |
|---|---|
| static readonly Single | Single default ratio 1/1 |
https://developer.mozilla.org/en-US/docs/Web/CSS/ratio
- interface ICssDataType
- namespace GroupDocs.Editor.HtmlCss.Css.DataTypes
- assembly GroupDocs.Editor
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.