Represents the aspect-ratio
CSS property.
Represents the aspect-ratio
CSS property.
The AspectRatio
property is used to define the aspect ratio of an element. It is a nullable float, meaning it can be set to a specific ratio or left unset (null). When set, it maintains the specified width-to-height ratio of the element.
// Example of setting the AspectRatio property BaseStyles styles = new BaseStyles(); styles.AspectRatio = 16f / 9f; // Sets the aspect ratio to 16:9 // Example of clearing the AspectRatio property styles.AspectRatio = null; // Removes the aspect ratio constraint