私の質問は、ブートストラップのヘッダーの全幅と高さの背景イメージをhttp://demo.evenfly.com/view?theme=SantaGo
のように設定するにはどうすればいいですか(アニメーションは期待していません。このような画面に)?私は終わりブートストラップのヘッダーの全幅の背景イメージを設定する
body{
margin:0;
padding:0;
width:100%;
}
#jumboid{
width:100% ;
}
.bg-image {
position: relative;
}
.bg-image img {
display: block;
width: 100%;
max-width: 1200px; /* corresponds to max height of 450px */
margin: 0 auto;
}
header{
width:100%;
height:100%;
height:calc(100% - 1px);
background-image:url('a.jpg');
background-size:cover;
}
:これは私がこれまでに行ったことある
、
https://codepen.io/anon/pen/reYRBo
HTML:
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="sltac.css">
</head>
<body>
<header>
<div class="row">
<div class="bg-image" id="jumboid">
<img src="http://www.visitnorwich.co.uk/assets/Uploads/Events-images/Theatre-generic.jpg" class="img-responsive" alt="Cinque Terre" width="100%" height="40%" back>
</div>
</header>
</body>
</html>
CSS経験(私はフルページのスクリーンショットを取る場合)
何か件までスケーリングされた画像の背景を維持するためにwan't? http://www.bootply.com/108614 – Stuart
私は次のCSSがあなたの必要条件を満たすと思う。あなたは他のCSSを書く必要はありません。 本文{ マージン:0; パディング:0; } – Batman
@Stuartはい、私は前にそれを試しましたが、画像は反応しません:/ – Kaw123