Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

example for object fit in css

<section>
  <h2>object-fit: fill</h2>
  <img class="fill" src="mdn_logo_only_color.png" alt="MDN Logo">

  <img class="fill narrow" src="mdn_logo_only_color.png" alt="MDN Logo">

  <h2>object-fit: contain</h2>
  <img class="contain" src="mdn_logo_only_color.png" alt="MDN Logo">

  <img class="contain narrow" src="mdn_logo_only_color.png" alt="MDN Logo">

  <h2>object-fit: cover</h2>
  <img class="cover" src="mdn_logo_only_color.png" alt="MDN Logo">

  <img class="cover narrow" src="mdn_logo_only_color.png" alt="MDN Logo">

  <h2>object-fit: none</h2>
  <img class="none" src="mdn_logo_only_color.png" alt="MDN Logo">

  <img class="none narrow" src="mdn_logo_only_color.png" alt="MDN Logo">

  <h2>object-fit: scale-down</h2>
  <img class="scale-down" src="mdn_logo_only_color.png" alt="MDN Logo">

  <img class="scale-down narrow" src="mdn_logo_only_color.png" alt="MDN Logo">
</section>
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #object #fit #css
ADD COMMENT
Topic
Name
4+1 =