make an image size down to accommodate screen size
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
}
.imgbox {
display: grid;
height: 100%;
}
.center-fit {
max-width: 100%;
max-height: 100vh;
margin: auto;
}
</style>
</head>
<body>
<div class="imgbox">
<img class="center-fit" src='pic.png'>
</div>
</body>
</html>
Also in CSS:
- Jquery .css
- wrapper html
- textarea placeholder
- css id selector
- rem in css
- add a border to a div css
- css overwriting styles
- comment out css
- diable focus button css
- textarea scale to content
- css selected color
- image rotate css
- css align center vertical and horizontal
- css all caps
- css system default font
- css onclick change color
- css translate3d
- font weight css
- scss gradient mixin
- media query change button text
- typescript not supporting scss
- xcrun: error: SDK "iphoneos" cannot be located
- HOW TO REDUCE BACKGROUND IMAGE SIZE IN CSS
- general sibling selector