Skip to content

Instantly share code, notes, and snippets.

@willprice76
Created June 24, 2014 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willprice76/5708187e91f5bff7d54d to your computer and use it in GitHub Desktop.
Save willprice76/5708187e91f5bff7d54d to your computer and use it in GitHub Desktop.
<h2>Full width image with aspect ratio of 3.3</h2>
@Html.Media(Model.Image, 3.3)
<h2>Half width image with default aspect ratio (1.62)</h2>
@Html.Media(Model.Image,"50%")
<h2>Fixed width image (150 px) with aspect ratio of 1</h2>
@Html.Media(Model.Image,"150px", 1)
<h2>Full width image with custom css class</h2>
@Html.Media(Model.Image,"100%","my-css-class")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment