How to make this vertical line go between columns in one piece? - html

I am trying to get this red line exactly between the columns, precisely to make it stand between Lorem ipsum's and paragraphs. The problem is that it should be one long line that goes through the page, but this one breaks because of the new row. Is there a better way to do it maybe..?
Here's the current state: http://codepen.io/anon/pen/WReerM
.content--border {
border-right: 2px solid red;
}
<div class="container content">
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum</p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor!</p>
</div>
</div>
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum 2</p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor! Lorem ipsum dolor sit
amet, consectetur adipisicing elit. A asperiores, quisquam illo animi eaque repudiandae excepturi tenetur, vel laudantium quas corporis explicabo laborum non minus dolor temporibus nesciunt vero. Id!
</p>
</div>
</div>
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum 3</p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor!</p>
</div>
</div>
</div>

The easiest way is to move content--border class to col-md-7 instead of col-md-3.

You can move the border to the left edge of col-md-7 instead.
.content--border {
border-left: 2px solid red;
}
Also can put it in a media query so it disappears on smaller screens:
#media screen and (min-width: 992px) {
.content--border {
border-left: 2px solid red;
}
}
Demo here

Move the border to the left of your other column:
.content--border {
border-left: 2px solid red;
}
see my working codepen:
http://codepen.io/egerrard/pen/pRzzRx

HTML:
<div class="container content">
<div class="row">
<div class="col-md-3">
<p>Lorem ipsum</p>
</div>
<div class="col-md-7 content--border">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor!</p>
</div>
</div>
<div class="row">
<div class="col-md-3 ">
<p>Lorem ipsum 2</p>
</div>
<div class="col-md-7 content--border">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor! Lorem ipsum dolor sit
amet, consectetur adipisicing elit. A asperiores, quisquam illo animi eaque repudiandae excepturi tenetur, vel laudantium quas corporis explicabo laborum non minus dolor temporibus nesciunt vero. Id!
</p>
</div>
</div>
<div class="row">
<div class="col-md-3">
<p>Lorem ipsum 3</p>
</div>
<div class="col-md-7 content--border">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor!</p>
</div>
</div>
</div>
CSS:
.content--border {
border-left: 2px solid red;
}

You can use :before pseudo element of parent element (.container) to draw this line. This will allow to have straight line without any breaks irrespective of content length in both columns.
Note: Please see the demo in full page mode.
Necessary CSS:
.container {
position: relative;
}
#media (min-width: 992px) {
.container:before {
position: absolute;
margin-left: -2px;
background: red;
display: block;
content: '';
width: 2px;
bottom: 0;
left: 25%;
top: 0;
}
}
#import url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css");
.container {
position: relative;
}
#media (min-width: 992px) {
.container:before {
position: absolute;
margin-left: -2px;
background: red;
display: block;
content: '';
width: 2px;
bottom: 0;
left: 25%;
top: 0;
}
}
<div class="container content">
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum</p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor!</p>
</div>
</div>
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum 2</p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor! Lorem ipsum dolor sit
amet, consectetur adipisicing elit. A asperiores, quisquam illo animi eaque repudiandae excepturi tenetur, vel laudantium quas corporis explicabo laborum non minus dolor temporibus nesciunt vero. Id!
</p>
</div>
</div>
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum 3</p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis facere assumenda magni dolor velit ullam deleniti tempora! Officia quo laboriosam dicta, animi ipsam expedita quasi magnam velit eligendi similique, dolor!</p>
</div>
<div class="row">
<div class="col-md-3 content--border">
<p>Lorem ipsum 3 Lorem ipsum 3 Lorem ipsum 3 Lorem ipsum 3 </p>
</div>
<div class="col-md-7">
<p>Lorem ipsum dolor sit amet,</p>
</div>
</div>
</div>

it would be easier to make a div element and place it between them with absolute positioning, give the div a height and manipulate using its margin or the top left property and position it where you want, also encase it all in a div...

Related

HTML Flex item width changes with increase in number of items [duplicate]

This question already has an answer here:
Why is a flex item limited to parent size?
(1 answer)
Closed 1 year ago.
I was trying to make a scrollable(in X direction) flexbox container to display cards but as the number of cards increase the width of cards decrease but I want the cards to be of equal width even though it overflows the body. I tried this also Full width flex items but didn't worked please help me
boyd{
overflow:hidden}
.container {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
overflow-x: scroll;
width: 100%;
}
.container .card {
padding: 10px;
border: 0.3px solid rgba(219, 214, 214, 0.801);
border-radius: 5px;
box-shadow: 1px 4px 8px 0px rgba(219, 214, 214, 0.801);
width: 18rem;
}
.card-head {
text-align: center;
}
.cardimg img {
width: 95%;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Practice Website</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="container">
<div class="card">
<div class="cardimg">
<img src="https://www.bayleafdigital.com/wp-content/uploads/2018/11/5-reasons-demo-software.jpg" alt="card image">
</div>
<div class="card-head">
Lorem ipsum dolor sit amet.
</div>
<div class="card-body">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil perferendis animi omnis eligendi ipsum maiores, rerum dolorum reiciendis quia ullam repellat praesentium nulla, at corrupti eveniet dignissimos culpa impedit voluptate?
</div>
</div>
<div class="card">
<div class="cardimg">
<img src="https://www.bayleafdigital.com/wp-content/uploads/2018/11/5-reasons-demo-software.jpg" alt="card image">
</div>
<div class="card-head">
Lorem ipsum dolor sit amet.
</div>
<div class="card-body">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil perferendis animi omnis eligendi ipsum maiores, rerum dolorum reiciendis quia ullam repellat praesentium nulla, at corrupti eveniet dignissimos culpa impedit voluptate?
</div>
</div>
<div class="card">
<div class="cardimg">
<img src="https://www.bayleafdigital.com/wp-content/uploads/2018/11/5-reasons-demo-software.jpg" alt="card image">
</div>
<div class="card-head">
Lorem ipsum dolor sit amet.
</div>
<div class="card-body">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil perferendis animi omnis eligendi ipsum maiores, rerum dolorum reiciendis quia ullam repellat praesentium nulla, at corrupti eveniet dignissimos culpa impedit voluptate?
</div>
</div>
<div class="card">
<div class="cardimg">
<img src="https://www.bayleafdigital.com/wp-content/uploads/2018/11/5-reasons-demo-software.jpg" alt="card image">
</div>
<div class="card-head">
Lorem ipsum dolor sit amet.
</div>
<div class="card-body">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil perferendis animi omnis eligendi ipsum maiores, rerum dolorum reiciendis quia ullam repellat praesentium nulla, at corrupti eveniet dignissimos culpa impedit voluptate?
</div>
</div>
<div class="card">
<div class="cardimg">
<img src="https://www.bayleafdigital.com/wp-content/uploads/2018/11/5-reasons-demo-software.jpg" alt="card image">
</div>
<div class="card-head">
Lorem ipsum dolor sit amet.
</div>
<div class="card-body">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil perferendis animi omnis eligendi ipsum maiores, rerum dolorum reiciendis quia ullam repellat praesentium nulla, at corrupti eveniet dignissimos culpa impedit voluptate?
</div>
</div>
</div>
<div class="mainbody">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eaque delectus excepturi quas, placeat voluptatibus quam similique magni in dicta eligendi ratione, amet quaerat debitis quo ipsum quasi. Numquam, eos veritatis?50
</div>
</body>
</html>
Try this:
.container .card {
flex-shrink: 0;
/* ... */
}
flex-shrink docs: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink

Section content goes out of page on adding cards

I tried to display information in form of cards. Each cards is inside ordered list li. On adding more card in form of li, the content goes out of page from top. How can I set the height to adjust automatically according to the number of cards.
Html code
<body>
<section>
<div class="leftBox">
<div class="content">
<h1>Events</h1>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae quia atque cupiditate commodi
nihil
cum? Autem rem voluptates aperiam. Est non dolor, unde quam laborum eveniet quidem doloribus
iure
ad!
</p>
</div>
</div>
<div class="events">
<ul>
<li>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere
deleniti corporis deserunt doloribus maxime.
</p>
View Details
</div>
<div style="clear: both;"></div>
</li>
<li>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere
deleniti corporis deserunt doloribus maxime.
</p>
View Details
</div>
<div style="clear: both;"></div>
</li>
</ul>
</div>
</section>
</body>
Corresponding CSS
body{
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
}
section{
width: 100%;
height: 100vh;
background: #323a45;
background-size: cover;
}
``
Can you please check the below code? Hope it will work for you. We have used display flex property to create cards element, it seems like you have used float element because of float it creates height alignment issue. We provide you two alignment structure so you can use any of according to your convenience.
Please refer to this link: https://jsfiddle.net/yudizsolutions/1vLqr6uo/2/
body {
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
}
section {
width: 100%;
height: 100vh;
/* background: #323a45;*/
background-size: cover;
}
ul {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
ul li {
width: 33.33%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.events.copy ul li {
display: block;
}
<body>
<section>
<div class="leftBox">
<div class="content">
<h1>Events</h1>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae quia atque cupiditate commodi nihil cum? Autem rem voluptates aperiam. Est non dolor, unde quam laborum eveniet quidem doloribus iure ad!
</p>
</div>
</div>
<div class="events">
<ul>
<li>
<div>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime.
</p>
</div>
</div>
View Details
</li>
<li>
<div>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime.
</p>
</div>
</div>
View Details
</li>
<li>
<div>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus
maxime.Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime.
</p>
</div>
</div>
View Details
</li>
</ul>
</div>
<div class="events copy">
<ul>
<li>
<div>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime.
</p>
</div>
</div>
View Details
</li>
<li>
<div>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime.
</p>
</div>
</div>
View Details
</li>
<li>
<div>
<div class="time">
<h2>2<br><span>April</span></h2>
</div>
<div class="details">
<h3>Celestial</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus
maxime.Lorem ipsum dolor sit, amet consectetur adipisicing elit. Inventore nam veritatis facere deleniti corporis deserunt doloribus maxime.
</p>
</div>
</div>
View Details
</li>
</ul>
</div>
</section>
</body>

Bootstrap nested layout (2 columns in one column)

I am trying to layout a grid in bootstrap that consists on the desktop of a full 12 column layout, inside that, there is a 8 column grid and a 4 column grid. the 8 column grid is filled with an image/text, the 4 column grid consists in its own of 2 elements below each other containting image/text.
on smaller breakpoint the layout should simply show 3 elements in same size below each other.
I fiddled around but I do not get it to work. Below you also find next to the html a sketch from what I am trying to achieve. Any hints? I do not feel this is possible out of the box with bootstrap 4.
<section>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-8">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui illo eaque libero, modi
porro iusto magni sint laboriosam eius. Fugiat non ad pariatur sit libero optio
doloremque molestiae harum! Rem!</p>
</div>
<div class="col-md-4">
<div class="row">
<div class="col-md-12">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illo
ratione blanditiis tempore tempora non. Neque adipisci maxime aspernatur voluptate
sunt non totam, temporibus provident necessitatibus distinctio impedit nobis aut at!
</div>
<div class="col-md-12">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illo
ratione blanditiis tempore tempora non. Neque adipisci maxime aspernatur voluptate
sunt non totam, temporibus provident necessitatibus distinctio impedit nobis aut at!
</div>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui illo eaque libero, modi
porro iusto magni sint laboriosam eius. Fugiat non ad pariatur sit libero optio
doloremque molestiae harum! Rem!</p>
</div>
</div>
</div>
</div>
</div>
</section>
As a sketch it looks like this:
You need to specify the smaller col width. You also had an extra unnecessary row and col wrapping it. Below is a working example of what you are looking for. col-12 class was added for any screen smaller than md
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-12 col-md-8">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui illo eaque libero, modi porro iusto magni sint laboriosam eius. Fugiat non ad pariatur sit libero optio doloremque molestiae harum! Rem!</p>
</div>
<div class="col-12 col-md-4">
<div class="row">
<div class="col-12">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illo ratione blanditiis tempore tempora non. Neque adipisci maxime aspernatur voluptate sunt non totam, temporibus provident necessitatibus distinctio impedit nobis aut at!
</div>
<div class="col-12">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illo ratione blanditiis tempore tempora non. Neque adipisci maxime aspernatur voluptate sunt non totam, temporibus provident necessitatibus distinctio impedit nobis aut at!
</div>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui illo eaque libero, modi porro iusto magni sint laboriosam eius. Fugiat non ad pariatur sit libero optio doloremque molestiae harum! Rem!</p>
</div>
</div>
</div>
Please try this snippet.
.row {
margin: 20px 0;
}
.col .card {
height: calc(100% - 10px);
}
.card{
margin-bottom: 10px;
}
.card img {
width: 100%;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col col-sm">
<div class="card">
<img class="card-img-top" src="https://source.unsplash.com/random/300x150" alt="Image">
<div class="card-body">
<p>Some text goes here Some text goes here Some text goes here</p>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="card">
<img class="card-img-top" src="https://source.unsplash.com/random/300x150" alt="Image">
<div class="card-body">
<p>Some text Some text goes here Some text goes here Some text goes here</p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="https://source.unsplash.com/random/300x150" alt="Image">
<div class="card-body">
<p>Some text Some text goes here Some text goes here Some text goes here</p>
</div>
</div>
</div>
</div>
</div>

Columns with content align keep last div aligned to bottom?

I have 3 columns with content and I managed to align the last div to bottom, by giving a fixed height to the column. Is there a better method since this won't work if someone will change the content, add more text or less text.
.column {
width: 33%;
float: left;
background: #ccc;
height: 350px;
position: relative;
}
.btn {
position: absolute;
left: 0;
right: 0;
bottom: 0;
text-align: center;
padding: 10px;
}
My Fiddle: Fiddle
Flexbox layout is a good solution.
The body element has row layout (it contains the 3 columns), each column has column layout (obvious). and inside the column the content grows to fill the space remaining.
I removed the absolute positioning from the .btn class, so it would take the space inside the coulmn.
body {
display: flex;
flex-direction: row;
}
.column {
width: 33%;
float: left;
background: #ccc;
min-height: 350px;
position: relative;
display: flex;
flex-direction: column;
}
.content {
flex-grow: 1;
padding: 0 5px;
}
.btn {
text-align: center;
padding: 10px;
}
<div class="column">
<div class="title">
<h2>Title 1</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
<div class="column">
<div class="title">
<h2>Title 2</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab? Lorem ipsum
dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
<div class="column">
<div class="title">
<h2>Title 3</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
If you need with fixed height for columns.
Here is the code
.column {
width: 33%;
float: left;
background: #ccc;
height: 350px;
position: relative;
}
.btn {
text-align: center;
padding: 10px;
}
.content{background:#f5f5f5;height:240px;overflow-x:hidden;overflow-y:auto;}
<div class="column">
<div class="title">
<h2>Title 1</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
<div class="column">
<div class="title">
<h2>Title 2</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
<div class="column">
<div class="title">
<h2>Title 3</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
Otherwise if you want to last div always bottom to above elements not as fixed.
Here is the code->
.column {
width: 33%;
float: left;
background: #ccc;
height: auto;
position: relative;
}
.btn {
text-align: center;
padding: 10px;
}
.content{background:#f5f5f5;}
<div class="column">
<div class="title">
<h2>Title 1</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
<div class="column">
<div class="title">
<h2>Title 2</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>
<div class="column">
<div class="title">
<h2>Title 3</h2>
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni iure repudiandae asperiores obcaecati accusantium, sapiente, tenetur dolores fugit omnis repellat dolorem iusto mollitia recusandae quidem perspiciatis dolore, ipsum suscipit ab?
</div>
<div class="btn">Click Me!</div>
</div>

Add box-shadow to a Boostrap Column

I want to add a shadow to a Bootstrap column, in order to create a thing similar to the image attached.
I need this shadow to overlap images, other divs backgrounds, and everything in general.
What I want :
And here is my code: https://codepen.io/alejandring/pen/oLKArO`
<div class="sidebar-logo">
<img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/sidebar-logo.png"></img>
</div>
<h1 id="titleh1">explore barcelona</h1>
<hr>
<div id="menu-wrapper">
<ul id="double">
<li>top ten</li>
<li>hotels</li>
<li>features</li>
<li>eat & drink</li>
</ul>
</div>
<div id="spotlight">
<div style="text-align:center;">
<p>Explore Spain</p>
<hr>
<p>Explore Europe</p>
</div>
</div>
</div>
<!--End Of Sidebar-->
<div id="main" class="col-sm-8">
<div class="row">
<div class="col-md-12" style="padding: 0px 0px 0px 0px;">
<div id="header">
<h1>La Sagrada Familia</h1>
<div class="menu">
<span id="map">FACTS</span>
<span id="facts">MAP</span>
</div>
</div>
</div>
</div>
<!--<div class="shadow"></div>-->
<!--Enf of Header-->
<div class="col-md-4">
<div class="weblist">
<div><span class="numbered">1</span></div>
<div><h2>Lorem ipsum dolor sit ametumque quos est harum architecto?</h2></div>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quia quam ullam dolore ut optio error voluptas aliquam dolorum vitae eos sint ea vel veritatis possimus iure perferendis molestiae est.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, ea, id officia atque placeat aut laudantium eveniet eius ex sequi impedit iste inventore sapiente veritatis rerum iure nesciunt facere autem!</p>
</div>
<div class="col-md-4">
<div class="weblist">
<div><span class="numbered">1</span></div>
<div><h2>Lorem ipsum dolor sit ametumque quos est harum architecto?</h2></div>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quia quam ullam dolore ut optio error voluptas aliquam dolorum vitae eos sint ea vel veritatis possimus iure perferendis molestiae est.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, ea, id officia atque placeat aut laudantium eveniet eius ex sequi impedit iste inventore sapiente veritatis rerum iure nesciunt facere autem!</p>
</div>
<div class="col-md-4">
<div class="weblist">
<div><span class="numbered">1</span></div>
<div><h2>Lorem ipsum dolor sit ametumque quos est harum architecto?</h2></div>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quia quam ullam dolore ut optio error voluptas aliquam dolorum vitae eos sint ea vel veritatis possimus iure perferendis molestiae est.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, ea, id officia atque placeat aut laudantium eveniet eius ex sequi impedit iste inventore sapiente veritatis rerum iure nesciunt facere autem!</p>
</div>
<!--End Of WebList-->
<div class="row">
<div class="col-md-12" id="facts">
<h2>Facts</h2>
<div class="row">
<div class="col-md-6"><img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/imageholder.jpg" class="img-responsive"></div>
<div class="col-md-6">
<h3>Lorem ipsum dolor sit ametumque quos est harum architecto?</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, tempora vel aliquid. Veritatis, perferendis, sapiente, in ratione nemo soluta suscipit dolor doloribus veniam ipsam molestias molestiae a quisquam amet temporibus.</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Lorem ipsum dolor sit ametumque quos est harum architecto?</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, tempora vel aliquid. Veritatis, perferendis, sapiente, in ratione nemo soluta suscipit dolor doloribus veniam ipsam molestias molestiae a quisquam amet temporibus.</p>
</div>
<div class="col-md-6"><img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/imageholder.jpg" class="img-responsive"></div>
</div>
<div class="row">
<div class="col-md-6"><img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/imageholder.jpg" class="img-responsive"></div>
<div class="col-md-6">
<h3>Lorem ipsum dolor sit ametumque quos est harum architecto?</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, tempora vel aliquid. Veritatis, perferendis, sapiente, in ratione nemo soluta suscipit dolor doloribus veniam ipsam molestias molestiae a quisquam amet temporibus.</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Lorem ipsum dolor sit ametumque quos est harum architecto?</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, tempora vel aliquid. Veritatis, perferendis, sapiente, in ratione nemo soluta suscipit dolor doloribus veniam ipsam molestias molestiae a quisquam amet temporibus.</p>
</div>
<div class="col-md-6"><img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/imageholder.jpg" class="img-responsive"></div>
</div>
</div>
</div>
<!--Enf Of Fats-->
<div class="row" id="fast-facts">
<div class="col-md-9">
<div class="google-maps">
<iframe src="https://www.google.com/maps/embed/v1/place?key=AIzaSyBlsDqeDCPYRgIj1Dpbv_VbLf14wUw4E10
&q=La+Barceloneta,Barcelona+ES" width="551" height="376" frameborder="0" style="border:0"></iframe>
</div>
<!--End Of G-MAPS-->
</div>
<div class="col-md-3">
<h2>Fast Facts</h2>
<ul>
<li><span>Map and Address</span></li>
<li><span>Website</span></li>
<li><span>Online Tickets</span></li>
<li><span>Time Needed: 1 - 2 hours</span></li>
</ul>
<img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/sficon.jpg" class="img-responsive"></img>
</div>
<div class="col-md-12"><h3><span>►</span> Other Barcelona Top 10 Attractions Near La Sagrada Familia Are Marked In Yellow</h3></div>
</div>
<!--Enf Of Fast-Facts-->
<div class="row" id="visiting-tips">
<div class="col-md-12">
<h2>More Visiting Tips</h2>
<ul>
<li>Ensure you buy the entrance ticket and tower access online, the lines can get very long!</li>
<li>Don't reach before the time on your ticket, they won't let you earlier.</li>
<li>A small museum underneath tells the long history of building a basilica. Go if you have the time.</li>
<li>The towers have a great view across Barcelona.</li>
</ul>
</div>
</div>
<!--End Of Visiting Tips-->
<div class="row" id="related-links">
<div class="row">
<div class="col-md-12">
<h2>Related Links</h2>
</div>
</div>
<div class="row" style="padding-left:45px; padding-right:45px;">
<div class="col-md-3">
<img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/city.jpg" class="img-responsive"></img>
<h3>City</h3>
</div>
<div class="col-md-3">
<img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/fivestarshotel.jpg" class="img-responsive"></img>
<h3>Five Stars Hotels</h3>
</div>
<div class="col-md-3">
<img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/attractions.jpg" class="img-responsive"></img>
<h3>Attractions</h3>
</div>
<div class="col-md-3">
<img src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/zoos.jpg" class="img-responsive"></img>
<h3>Zoos</h3>
</div>
</div>
</div>
<!--End Of Related Links-->
<div class="row" id="reviews">
<div class="col-md-12">
<h2>Review And Feedback Of La Sagrada Familia</h2>
<section>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Temporibus, neque, eligendi, suscipit, aut nisi laborum nostrum ad autem deserunt modi commodi ducimus libero fuga voluptate itaque accusamus officia voluptatem quas.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni, vel, dicta saepe iusto aut suscipit voluptatum magnam maiores nulla molestiae odio rerum sapiente dolorum! In distinctio quae adipisci libero nobis.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, officiis ipsum adipisci numquam temporibus quibusdam expedita esse animi? Cum, pariatur temporibus magnam sunt voluptates nihil facilis quas saepe? Quaerat, eum.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, architecto beatae et asperiores eos sit quos perspiciatis numquam quod saepe natus labore quisquam vitae omnis laborum aut facere dolor at.</p>
</section>
</div>
</div>
<!--End Of Review-->
<div class="row" id="quick-links">
<div class="col-md-3">
<h2>Destinations</h2>
<ul>
<li>Barcelona</li>
<li>Madrid</li>
<li>Seville</li>
</ul>
</div>
<div class="col-md-3">
<h2>Top 10</h2>
<ul>
<li>Top 10 Things To Do in Barcelona</li>
<li>Top 10 Things To Do in Madrid</li>
<li>Top 10 Things To Do in Seville</li>
</ul>
</div>
<div class="col-md-3">
<h2>Eat & Drink</h2>
<ul>
<li>Barcelona Eat & Drinks</li>
<li>Madrid Eat & Drinks</li>
<li>Seville Eat & Drinks</li>
</ul>
</div>
<div class="col-md-3">
<h2>Hotels</h2>
<ul>
<li>Barcelona Hotels</li>
<li>Madrid Hotels</li>
<li>Seville Hotels</li>
</ul>
</div>
</div>
<!--End Of Quick-Links -->
<div class="row" id="footer">
<div class="col-md-2">
<img alt="PegNRope" src="https://peg-n-rope-alejandroarias.c9users.io/v1/images/logo.png" width="123px" height="33px">
</div>
<div class="col-md-7">
<ul>
<li>PEGNROPE</li>
<li>CONTACT US</li>
<li>PRIVACY</li>
</ul>
</div>
<div class="col-md-3"><p>PegNRope - Hotels, Experiences and Activities</p></div>
</div>
</div>
<!--End of Main Page-->
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
</script>`
Add this style to your CSS file, and edit it as your need:
div#sidebar {
-webkit-box-shadow: 3px 3px 25px 4px rgba(0,0,0,0.5);
-moz-box-shadow: 3px 3px 25px 4px rgba(0,0,0,0.5);
box-shadow: 3px 3px 25px 4px rgba(0,0,0,0.5);
}