css stretching background image sprite technique -


i have div styling, , width dynamic.

<style> #mydiv {     background-image: url('http://icons.iconarchive.com/icons/manda-pie/chocolate/icons-390.jpg');     background-repeat: no-repeat;     border: 1px solid red;     width: 50%;     height: 200px;     background-position: -0px -0px;     -moz-background-size: 448px 368px;     background-size: 448px 368px; } </style> <div id="mydiv"></div> 

you see div stretches if stretch browser window. how make background image stretched right same way div does? fiddle

http://jsfiddle.net/3dsgn/106/

use -moz-background-size:100% 100%; background-size: 100% 100%;


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -