twitter bootstrap - CSS background image - responsive image that scales without depending on image size -


im trying background image scales whole image without depending on size of picture , fits screens showing same. got work butafter changed picture doesent work anymore. oh , im using bootstrap 3.

heres css:

.bg {      background-image: url(http://pikahinaukset.wpengine.com/wp-  content/uploads/2015/06/coverphoto-e1433360465261.jpg);     background-position: center center;     background-repeat: no-repeat;     background-attachment: fixed;     background-size: cover;     background: url(http://pikahinaukset.wpengine.com/wp-content/uploads/2015/06/coverphoto-e1433360465261.jpg) center center cover no-repeat fixed;     -webkit-box-shadow: 0 8px 6px -6px black;     -moz-box-shadow: 0 8px 6px -6px black;     box-shadow: 0 8px 6px -6px black;  } 

edited:

heres html http://jsfiddle.net/jw7l2s3y/

you doing redundant: background center , stuff doing background-image, background-repeat , that. doing same thing background: . remove 1 of them , think working fine anyways.

working jsfiddle here

.bg {     background-position: center center;     background-repeat: no-repeat;     background-attachment: fixed;     background-size: cover;     background-image: url(http://pikahinaukset.wpengine.com/wp-content/uploads/2015/06/coverphoto-e1433360465261.jpg) ;     -webkit-box-shadow: 0 8px 6px -6px black;     -moz-box-shadow: 0 8px 6px -6px black;     box-shadow: 0 8px 6px -6px black;  } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -