You can do this with an inline SVG background, using only CSS and no javascript.
.background {
// Draw an SVG top left to bottom right
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' preserveAspectRatio='none' viewBox='0 0 10 10'> <path d='M0 0 L0 10 L10 10' fill='red' /></svg>");
background-repeat:no-repeat;
background-position:center center;
//scale it
background-size: 100% 100%, auto;
}
See my fiddle:
http://jsfiddle.net/3GWw2/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…