I am trying to make a striped horizontal design with Bootstrap.
This is an example: http://getonepager.com
As seen it uses <section>
, inside which it has a div
with the .container
class (not .container-fluid
).
What I do not understand from that site, is the following:
- How were they able to make the section background colors/images cover the full width of the site? When I try a similar approach with background-image in css, it does not cover the full width of the page. This is from their css:
#features {
background-image: url(http://getonepager.com/wp-content/uploads/2015/07/bg1.png);
background-repeat: no-repeat;
background-size: contain;
background-color : #ffffff;
color : #727272;
}
- How come the background image does not zoom, when you zoom in and out of the page with your browser?
I have tried to pull it off with the following code, but no success:
<html>
<head>
<title>TODO supply a title</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<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>
<style>
.content{
padding:20px;
border: 1px solid #269abc;
}
[class*="col-"] {
padding-top:10px;
padding-bottom:10px;
border:1px solid #80aa00;
background:#d6ec94;
}
.fixed-width {
display:inline-block;
float:none;
width: 300px;
}
#one {
background-image: url(http://getonepager.com/wp-content/uploads/2015/07/bg1.png);
background-repeat: no-repeat;
background-size: contain;
background-color : #ffffff;
color : #727272;
font-size : 48px;
}
</style>
</head>
<body>
<section id="one">
<div class="container">
<div class="row text-center">
<div class="col-sm-4 fixed-width">
<div class="content">ONE</div>
</div>
<div class="col-sm-4 fixed-width">
<div class="content">ONE</div>
</div>
<div class="col-sm-4 fixed-width">
<div class="content">ONE</div>
</div>
</div>
</div>
</section>
</body>
</html>