Horje
keep aspect ratio of image css Code Example
keep aspect ratio of image css
img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}
css keep image ratio
img {
  object-fit: cover;
  width: 100px;
  height:100px;
}
css keep aspect ratio image
.image-full {
    background: url(...some image...) no-repeat;
    background-size: cover;
    background-position: center center;
}
html image keep aspect ratio
Don't set height AND width. Use one or the other and the correct aspect ratio will be maintained.




Css

Related
css font size important Code Example css font size important Code Example
mirror text css Code Example mirror text css Code Example
backwards text css Code Example backwards text css Code Example
css grid align Code Example css grid align Code Example
how many fonts can i add in a css font-face Code Example how many fonts can i add in a css font-face Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11