Bob
Bob

Reputation: 207

Elements are not showing up in the wrapper, they're below

I have a wrapper div set with a background color of white but all of my elements are showing up underneath the wrapper even though I have them set inside of it. I think it may have to do with the css of the slider I'm using but I'm not sure what to look for.

/*MY CSS*/
#content-wrapper {
	padding-top: 4em;
	width: 90%;
	margin-left: auto;
	margin-right: auto;
	background-color: #fff;
}
#left-block {
	width: 49%;
}
#right-block {
	float: right;
	width: 45%;
}
#block-one, #block-two {
	width: 100%;
	height: 12em;
	background-color: black;
	vertical-align: top;
    	margin-bottom: 10px;
}

/*SLIDER CSS*/
.bx-wrapper {
	position: relative;
	margin: 0 0 60px;
	padding: 0;
	*zoom: 1;
	width: 100%;
	float: left;
}

.bx-wrapper img {
	max-width: 100%;
	display: block;
}
.bx-wrapper .bx-viewport {
	-moz-box-shadow: 0 0 5px #ccc;
	-webkit-box-shadow: 0 0 5px #ccc;
	box-shadow: 0 0 5px #ccc;
	border:  5px solid #fff;
	left: -5px;
	background: #fff;
	
	/*fix other elements on the page moving (on Chrome)*/
	-webkit-transform: translatez(0);
	-moz-transform: translatez(0);
    	-ms-transform: translatez(0);
    	-o-transform: translatez(0);
    	transform: translatez(0);
}

.bx-wrapper .bx-pager,
.bx-wrapper .bx-controls-auto {
	position: absolute;
	bottom: -30px;
	width: 100%;
}
<div id="content-wrapper">
	<div id="left-block">
		<ul class="bxslider">
  			<li><img src="../images/slider/test-slide-1.svg" /></li>
  			<li><img src="../images/slider/test-slide-2.svg" /></li>
  			<li><img src="../images/slider/test-slide-3.svg" /></li>
		</ul>
	</div>
	<div id="right-block">
		<div id="block-one"></div>
		<div id="block-two"></div>
	</div>
</div>

Upvotes: 0

Views: 169

Answers (1)

Fahad Hasan
Fahad Hasan

Reputation: 10506

You need to specify float: left; property for #left-block inside the CSS.

/*MY CSS*/
#content-wrapper {
	padding-top: 4em;
	width: 90%;
	margin-left: auto;
	margin-right: auto;
	background-color: #fff;
}
#left-block {
	width: 49%;
    float: left;
}
#right-block {
	float: right;
	width: 45%;
}
#block-one, #block-two {
	width: 100%;
	height: 12em;
	background-color: black;
	vertical-align: top;
    	margin-bottom: 10px;
}

/*SLIDER CSS*/
.bx-wrapper {
	position: relative;
	margin: 0 0 60px;
	padding: 0;
	*zoom: 1;
	width: 100%;
	float: left;
}

.bx-wrapper img {
	max-width: 100%;
	display: block;
}
.bx-wrapper .bx-viewport {
	-moz-box-shadow: 0 0 5px #ccc;
	-webkit-box-shadow: 0 0 5px #ccc;
	box-shadow: 0 0 5px #ccc;
	border:  5px solid #fff;
	left: -5px;
	background: #fff;
	
	/*fix other elements on the page moving (on Chrome)*/
	-webkit-transform: translatez(0);
	-moz-transform: translatez(0);
    	-ms-transform: translatez(0);
    	-o-transform: translatez(0);
    	transform: translatez(0);
}

.bx-wrapper .bx-pager,
.bx-wrapper .bx-controls-auto {
	position: absolute;
	bottom: -30px;
	width: 100%;
}
<div id="content-wrapper">
	<div id="left-block">
		<ul class="bxslider">
  			<li><img src="../images/slider/test-slide-1.svg" /></li>
  			<li><img src="../images/slider/test-slide-2.svg" /></li>
  			<li><img src="../images/slider/test-slide-3.svg" /></li>
		</ul>
	</div>
	<div id="right-block">
		<div id="block-one"></div>
		<div id="block-two"></div>
	</div>
</div>

Upvotes: 2

Related Questions