JSFiddle - React, Tailwind, and code Playground
by crowjonah
HTML
<script src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
<div class="wrap"></div>
CSS
body {
background: black;
}
.wrap {
width: 200px;
height: 200px;
position: absolute;
background-color: white;
background-image: url(http://californiatortilla.com/caltort/wp-content/uploads/2012/11/Steak-taco1.jpg);
background-attachment: fixed;
background-position: 0 0;
background-size: 200px 116px;
background-repeat: no-repeat;
}
p {
position: absolute;
left: 0;
bottom: 0;
font-weight: bold;
width: 100%;
text-align: center;
}
JavaScript
var wrap = $('.wrap');
var bgsize = '';
if (Modernizr.backgroundsize) {
bgsize = '<p>Supports background-size</p>';
} else { bgsize = '<p>Does not support background-size</p>'; }
wrap.append(bgsize);