css3 - max width of css backgroudn image and background color -


i have css class has ground image. want fix background's image's max width 1024px , use background color render browser extends beyond that. there way can that?

right now, have

background-size: cover; 

and, distorts image height beyond 1024px.

.imageform { width: 100%; display: inline-block; background: url("http://i.imgur.com/fpmyvio.jpg") no-repeat; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; background-color: #000; 

}

jsfiddle: http://jsfiddle.net/fwkqos0c/8/

you have change

background-size:1024px; 

and ypu missed

background-repeat: no-repeat; 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -