I want to add a bottom: value to my div where the value will vary be based on the browser window aspect ratio.
Is there a way to get the current aspect ratio width /height of my browser window in CSS?
.loading-animation{
bottom: ?
}
CodePudding user response:
You should use vh, vw
viewport-height and viewport-width respectively. The content will adjust itself depending on the screen.
CodePudding user response:
You can use the aspect-radio property in CSS.
That property auto size the elements in reference about you screen size.