当我调整浏览器的大小时使用引导程序,背景中的图片缩小,背景颜色不变。Bootstrap CSS/HTML background image resize
这里是链接到网站,其中包含HTML代码:http://codedifferently.com/crest.html
这里是CSS代码,我用:
@charset "UTF-8";
/* CSS Document */
/* Move down content because we have a fixed navbar that is 50px tall */
body {
padding-top: 0px;
padding-bottom: 20px;
}
div.jumbotron {
background-image: url('img/chicago2.jpg');
background-color: #3FF;
background-size: 100%;
height: 500px;
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
}
div.navbar navbar-default navbar-static-top" role="navigation {
border: 0px;
}
当你说背景颜色不缩水时,你的意思是你的图像背后的蓝色? – 2014-10-05 00:05:08
是的,你有什么建议我应该如何调整这个?我希望它看起来像这个网站:http://www.crestonsolutions.com/ 它是用wordpress构建的,但它需要永久加载。这是一个静态网站,所以我认为使用HTML和CSS重建它会更好。 – cbandara 2014-10-05 00:09:56
更改背景大小:100%到背景大小:封面;在div.jumbotron – 2014-10-05 00:15:48