material design lite - Images in cards -


why images cards component being used background instead of image fill media portion of card? cant use image tag instead?

i trying use mdl framework make tumblr template having trouble implementing card component images posts since tumblr uses image tags

please explain why mdl using images backgrounds card component

nothing holding using img tag. see this example.

however using images background of divs has advantages:

  1. right clicking on image not allow download image
  2. you have more flexibility in terms of responsiveness (e.g. using background-size: cover fill div). update: though can set 100% on width/height adapt image, cover keeps aspect ratio , in general provides better results.
  3. since image background don't need set position absolute let other elements inside div positioned on image (as case in of mdl examples)

Comments