Keep up aspect ratio of a div with CSSAsk a question
You can give height in “vh” and width in “vw”. It will make your dive responsive as your screen size get smaller or wider. div will adjust itself according to window’s height & width.
Check this example: https://codepen.io/jitens/pen/MMrJRy
- 1What is the best way to align elements to vertically center in CSS
- 1css: how to increase one character font-size without increasing whole text line-height?
- 0CSS Grid container does not taking the width of its children
- 0How to keep a flex container all in one page without scroll
- 0Hover effect on div and image is not working in css
- 1How do I add a counter to show how many times a div element has been clicked?
- 0How to hide container div title when hovering inner elements?
- 0Make css animation smoothly loop forever
- 0How to avoid an image overflowing container in CSS Grid?
- 1Is it possible to make every second row in a CSS Grid to have different number of columns?
- 0How to change checkbox's border style in CSS?