as comment. you need to add this css on .attractionContainer , because this container is containing your content (row).
if you want the “What it’s supposed to look like”.
you need to remove padding css
html,body{
background-color: #EE870D;
width:100%;
height:100%;
}
.padding{
padding: 0px ;
}
/* remove class or this css */
.padding img{
width:100%;
}
.attractionPad{
background-color: #8FBA51;
}
.attraction{
color:blue;
list-style:none;
}
.events li, .attraction li{
margin: 10px 0 50px 0;
}
.attractionContainer{
background-color: #fff;
}
for a full-page responsive, centered behavior, the code below:
html,
body {
background-color: #EE870D;
width: 100%;
height: 100%;
}
.padding {
padding: 80px 0;
}
.padding img {
width: 100%;
}
.attractionPad {
background-color: #8FBA51;
}
.attraction {
color: blue;
list-style: none;
}
.events li,
.attraction li {
margin: 10px 0 50px 0;
}
.attractionContainer {
background: #fff;
height: 100vh;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<div class=" attractionPad">
<div class="container attractionContainer d-flex">
<div class="row align-self-center">
<div class="col-sm-6 ">
<img class="img-fluid" src="https://www.akberiqbal.com/Jumbo.jpg">
</div>
<div class="col-sm-6">
<ul class="attraction">
<li>
<h3>Ninja Course</h3>
</li>
<li>
<h3>Indoor Bounce Arena</h3>
</li>
<li>
<h3>Mechanical Wipeout Challenge</h3>
</li>
<li>
<h3>Ziplining Fun</h3>
</li>
</ul>
</div>
</div>
</div>
</div>
I’m trying to use bootstrap and make a section look like this: What it’s supposed to look like
The problem I have is the white block in the middle on top of the green background. If I add an extra class to the outermost div (padding), nothing shows up, but if I add it to any of the other divs it only encompasses the photo (not there sorry) and the text instead of 100% height of the padding. I’ve tried z-index: 999 with width of 80% and height 100%, but it kinda screws up the background.
I’m not sure what to do. Any help would be appreciated. Thank you.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link href="index.css" rel="stylesheet"/>
</head>
<body>
<div class="padding attractionPad">
<div class="container attractionContainer">
<div class="row">
<div class="col-sm-6">
<img src ="img2.png">
</div>
<div class="col-sm-6">
<ul class="attraction">
<li><h3>Ninja Course</h3></li>
<li><h3>Indoor Bounce Arena</h3></li>
<li><h3>Mechanical Wipeout Challenge</h3></li>
<li><h3>Ziplining Fun</h3></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
html,body{
background-color: #EE870D;
width:100%;
height:100%;
}
.padding{
padding: 80px 0;
}
.padding img{
width:100%;
}
.attractionPad{
background-color: #8FBA51;
}
.attraction{
color:blue;
list-style:none;
}
.events li, .attraction li{
margin: 10px 0 50px 0;
}
https://jsfiddle.net/4agbp8tf/2/
I’ve tried that, but all it does is kinda pads the picture + words. It’ll never get to 100% of the background height.
Oh my. I didn’t see that. Thank you so much!