how to make only jumbotron background image dark - html

i have jumbotron with a background image , i put a
-webkit-filter: brightness(30%); on the background image, but this effect also affects all other images and text in the jumbotron, i am trying to make only the background image dull, and all other text and images bright, can anyone please assist me
.jumbotron {
background-image: url("apartment.jpg");
height: 500px;
width: 100%;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
-webkit-filter: brightness(30%);
}
img#sub {
padding: 5px;
border: solid 1px #EFEFEF;
height: 100%;
width: 100%;
}
img.hover-shadow {
transition: 0.3s;
}
.hover-shadow:hover {
border: solid 1px #CCC;
-moz-box-shadow: 1px 1px 5px #999;
-webkit-box-shadow: 1px 1px 5px #999;
box-shadow: 1px 1px 5px #999;
}
<section>
<h2 class="section-title" style="word-wrap:break-word;"> <span id="section32"> </span> APARTMENTS</h2>
<div align="center">
<img id="divider" src="divide1.png">
</div>
<br></br>
<div class="jumbotron">
<h2 style="text-align:center">Apartments</h2>
<div align="center" class="container-fluid" id="ab">
<div id="sub" class="column">
<img id="sub" src="8.jpg" style="width:70%" onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
</div>
<div id="sub" class="column">
<img id="sub" src="10.jpg" style="width:70%" onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
</div>
</div>
</div>
</section>
below is an image showing the dark effect all over
image

Is this what you are looking for? Instead of styling the background image container, I added a :before pseudo element to it, and set it to have a black overlay with an opacity of 50% using rgba.
.jumbotron{background-image: url("http://placekitten.com/1000/700");
height: 500px;
width: 100%;
background-position: center center;background-repeat: no-repeat;background-size: cover;
position: relative;
}
.column {
display: inline-block;
margin: 5px;
}
img.subImg {
padding: 5px;
border: solid 1px #EFEFEF;
height: 100%;
width: 100%;
position: relative;
z-index: 10;
width: 300px;
}
.jumbotron:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.5);
}
img.hover-shadow {
transition: 0.3s;
}
.hover-shadow:hover {
border: solid 1px #CCC;
-moz-box-shadow: 1px 1px 5px #999;
-webkit-box-shadow: 1px 1px 5px #999;
box-shadow: 1px 1px 5px #999;
}
<section >
<h2 class="section-title" style="word-wrap:break-word;" > <span
id="section32" > </span> APARTMENTS</h2>
<div align="center">
<img id="divider" src="divide1.png" >
</div>
<div class="jumbotron">
<h2 style="text-align:center">Apartments</h2>
<div align="center" class="container-fluid" id="ab">
<div id="sub1" class="column">
<img class="subImg" src="http://placekitten.com/500/300"
onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
</div>
<div id="sub2" class="column">
<img class="subImg" src="http://placekitten.com/500/300"
onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
</div>
</div>
</div>
</section>

How about overlapping background-image
background-image:
linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)) ,
url("Your URL");
.jumbotron {
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)), url("https://upload.wikimedia.org/wikipedia/commons/3/38/Tampa_FL_Sulphur_Springs_Tower_tall_pano01.jpg");
height: 500px;
width: 100%;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
-webkit-filter: brightness(100%);
}
.jumbotron img {
-webkit-filter: none;
}
img#sub {
padding: 5px;
border: solid 1px #efefef;
height: 100%;
width: 100%;
}
img.hover-shadow {
transition: 0.3s;
}
.hover-shadow:hover {
border: solid 1px #ccc;
-moz-box-shadow: 1px 1px 5px #999;
-webkit-box-shadow: 1px 1px 5px #999;
box-shadow: 1px 1px 5px #999;
}
.column {
position: relative;
}
.img-out {
position: relative;
}
.img-text {
position: absolute;
top: calc(45% - 24px);
right: 0;
bottom: 0;
left: 0;
font-size: 24px;
vertical-align: middle;
color: red;
font-weight: 900;
}
<section>
<h2 class="section-title" style="word-wrap:break-word;"> <span id="section32"> </span> APARTMENTS</h2>
<div align="center">
<img id="divider" src="http://www.gettyimages.in/gi-resources/images/Homepage/Hero/US/MAR2016/prestige-587705839_full.jpg">
</div>
<br></br>
<div class="jumbotron">
<h2 style="text-align:center">Apartments</h2>
<div align="center" class="container-fluid" id="ab">
<div id="sub" class="column">
<div class="img-out">
<img id="sub" src="https://html5box.com/html5lightbox/images/lakeandballoon.jpg" style="width:70%" onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
</div>
<div class="img-text">
<p>TEXT 1</p>
</div>
</div>
<div id="sub" class="column">
<div class="img-out">
<img id="sub" src="http://eskipaper.com/images/image-2.jpg" style="width:70%" onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
</div>
<div class="img-text">
<p>TEXT 1</p>
</div>
</div>
</div>
</div>
</section>

Try this.
background-image: rgba(0, 0, 0, 0.4), url("apartment.jpg");
background-image can take multiple values.

Related

How do I prevent 3 overlapping images in HTML, CSS?

I am trying to create 3 cards that stand at the bottom of the webpage but the 3 cards are overlapping. Can you help me find my mistake please? :)
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.144);
transition: 0.3s;
border-radius: 13px;
width: 320px;
height: 455px;
cursor: pointer;
position: absolute;
margin-left: 4%;
bottom: 10px;
margin-right: 4%;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.397);
}
.container {
padding: 2px 16px;
font-family: 'Rubik', sans-serif;
cursor: pointer;
}
.row {
display: flex;
}
.row::after {
content: "";
clear: both;
display: table;
}
<div class="row">
<div class="card">
<img src="resources/images/Front1.png" style="width: 100%;" height="320px">
<div class="container">
<h3><b>Create checklists</b></h3>
<p>Make your own customizable checklist to remain happy and healthy</p>
</div>
</div>
<div class="card">
<img src="resources/images/Front2.jpeg" style="width: 100%;">
<div class="container">
<h3><b>Take notes</b></h3>
<p>Write your own notes with fun, colourful tools</p>
</div>
</div>
<div class="card">
<img src="resources/images/Front3.jpeg" style="width: 100%;" height="320px">
<div class="container">
<h3><b>Create calendars</b></h3>
<p>Add pictures to your calendars and customize according to your preferences</p>
</div>
</div>
</div>
The problem was caused by the position: absolute; style in your CSS. Basically, you set all 3 cards to the same position which is why they overlapped.
I also changed your card's height to min-height. This is because the text was flowing out of the card and min-height would prevent this.
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.144);
transition: 0.3s;
border-radius: 13px;
width: 320px;
min-height: 455px;
cursor: pointer;
margin-left: 4%;
margin-right: 4%;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.397);
}
.container {
padding: 2px 16px;
font-family: 'Rubik', sans-serif;
cursor: pointer;
}
.row {
display: flex;
}
.row::after {
content: "";
clear: both;
display: table;
}
<div class="row">
<div class="card">
<img src="resources/images/Front1.png" style="width: 100%;" height="320px">
<div class="container">
<h3><b>Create checklists</b></h3>
<p>Make your own customizable checklist to remain happy and healthy</p>
</div>
</div>
<div class="card">
<img src="resources/images/Front2.jpeg" style="width: 100%;">
<div class="container">
<h3><b>Take notes</b></h3>
<p>Write your own notes with fun, colourful tools</p>
</div>
</div>
<div class="card">
<img src="resources/images/Front3.jpeg" style="width: 100%;" height="320px">
<div class="container">
<h3><b>Create calendars</b></h3>
<p>Add pictures to your calendars and customize according to your preferences</p>
</div>
</div>
</div>
remove "position: absolute" and things would work fine. Or if you're trying to display somethign else?

Problem with showing part of background image inside div - transparent effect part of page (html, css)

I have to do one task in html and CSS and I have a problem with showing background in one div (id of div TRANSPARENT_DIV). It should be looks like a div is transparent (I added image).
It's not so easy because adding 'opacity' to our 'TRANSPARENT_DIV' shows background another div.
If you have any idea how to solve this problem I would be grateful.
<head>
<style>
body {
margin: 0;
padding: 0;
background-image: url("https://i.redd.it/zrkwrcj7tbv31.jpg");
background-repeat: no-repeat;
background-color: #cccccc;
background-size: 100% auto;
font-family: "Roboto-Medium", "Verdana", sans-serif !important;
}
.page-wrapper {
margin: 0 60px;
border: 1px solid blue;
background-color: white;
}
</style>
</head>
<body>
<h1 style="text-align: center;">
TITLE
</h1>
<div style="background-color: white; height: 40px; width: 100%; text-align: center;">
<a style="line-height: 40px; margin: 0 55px;" href="#"><span>Link 1</span></a>
<a style="line-height: 40px; margin: 0 55px;" href="#"><span>Link 2</span></a>
<a style="line-height: 40px; margin: 0 55px;" href="#"><span>Link 3</span></a>
</div>
<div style="background-color: white; height: 40px; width: 100%; text-align: center; border: 1px solid black;">
breadcrumbs here
</div>
<div class="page-wrapper">
<div style="margin: 40px; border: 1px solid black;">
<div id="TRANSPARENT_DIV" style="height: 250px;"> <h3> Here should visible part of image from background. </h3> </div>
</div>
<div style="margin: 0 40px; border: 1px solid black;">
Some content
</div>
</div>
</body>
Example image how it should looks
Example:
<div id="TRANSPARENT_DIV" style="height: 250px; background-color: rgba(255, 255, 255, 0.0);"> <h3> Here should visible part of image from background. </h3> </div>
It doesn't work because this solution shows parent's background.
Greetings
You can inflate the picture's border.
<head>
<style>
body {
margin: 0;
padding: 0;
background-image: url("https://i.redd.it/zrkwrcj7tbv31.jpg");
background-repeat: no-repeat;
background-color: #cccccc;
background-size: 100% auto;
font-family: "Roboto-Medium", "Verdana", sans-serif !important;
}
.page-wrapper {
border: 1px solid black;
margin: 0 60px;
}
#TRANSPARENT_DIV {
height: 250px;
border: 40px solid white;
box-shadow: inset 0 0 0 1px black;
}
</style>
<h1 style="text-align: center;">
TITLE
</h1>
<div style="background-color: white; height: 40px; width: 100%; text-align: center;">
<a style="line-height: 40px; margin: 0 55px;" href="#"><span>Link 1</span></a>
<a style="line-height: 40px; margin: 0 55px;" href="#"><span>Link 2</span></a>
<a style="line-height: 40px; margin: 0 55px;" href="#"><span>Link 3</span></a>
</div>
<div style="background-color: white; height: 40px; width: 100%; text-align: center; border: 1px solid black;">
breadcrumbs here
</div>
<div class="page-wrapper">
<div id="TRANSPARENT_DIV">
<h3> Here should visible part of image from background.</h3>
</div>
<div style="background:white">
<div style="margin: 0 40px;border: 1px solid black">
Some content
</div>
</div>
</div>
The problem here is that when you go to make the <div id="TRANSPARENT_DIV"> transparent, it actually is going transparent, but you also have the parent <div class=page-wrapper> which has background-color: white, so it looks like it's not working, BUT it is, the background color of the parent div is still there.
You could try to make the background-image of the <div id="TRANSPARENT_DIV"> the bg image of the page and try to re-size it.
You could add this CSS to your required element
body{
background: linear-gradient(to right, #c0c0aa, #1cefff);
}
.hello{
padding: 10px;
width: 100px;
height: 100px;
background:rgba(255,255,255,0);
color:#111;
}
.buy{
color:#ddd;
border: 25px solid #111;
background: rgb(255,255,255,0.0);
height: 150px;
width: 200px;
}
<br><br><center>
<div class="buy">
<div class="hello">
sji
</div>
<br>
<h3>hello</h3>
<div>

Why #media screen is not working on my web?

Error related with #media query.
My HTML code--
<div class="Card">
<div class="FestivalPhoto"><img src="Image/test1.jpg" width="300px" alt="MusicFestivalImage"></div>
<div class="FestivalDetails">Hello World</div>
</div>
<div class="Card">
<div class="FestivalPhoto"><img src="Image/test1.jpg" width="300px" alt="MusicFestivalImage"></div>
<div class="FestivalDetails">Hello World</div>
</div>
<div class="Card">
<div class="FestivalPhoto"><img src="Image/test1.jpg" width="300px" alt="MusicFestivalImage"></div>
<div class="FestivalDetails">Hello World</div>
</div>
And this is my css--
.Card {
background: #fff;
border-radius: 2px;
display: inline-block;
height: 500px;
margin: 1rem;
position: relative;
width: 300px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
padding: 30px auto;
overflow: hidden;
justify-content: center;
}
.FestivalDetails {
position: absolute;
width:auto;
max-width: 500px;
height: auto;
display: block;
padding: 20px 20px;
}
.FestivalPhoto {
height: 200px;
width: auto;
position: relative;
top: 0;
display: block;
overflow: hidden;
margin: auto;
background-size: initial;
}
#media(max-width: 700) {
.Card {
background: #000;
border-radius: 2px;
display: block;
height: 500px;
margin: auto;
position: relative;
width: 80%;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
padding: 30px auto;
overflow: hidden;
}
}
I am trying the Card div to set "margin: auto;" on mobile but it does not work. I also added in head tag. Please suggest me. And now I am testing responsive on chrome and firefox developer console. Is there any better ways to test? Thank You.
Replace #media(max-width: 700) with #media screen and (max-width: 700)
add this in your head tag
<meta name="viewport" content="width=device-width, initial-scale=1">
also change #media (max-width: 700) to #media (max-width: 700px)
Media query looks okay, you can switch to #media screen and (max-width: 680px)
In Chrome , when you inspect element, "Toggle device Toolbar" option is available.
You can see how the application looks on different devices as well as application is responsive or not.`
div.logo-inline-div {
text-align: center;
margin: auto;
padding: 16px 24px 10px 10px;
border-radius: 8px;
background-color: white;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 2px 3px 0 rgba(0, 0, 0, 0.1);
}
.row {
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.col-1 {
width: 12.4%;
}
img {
width: 100px;
height: 200px;
object-fit: cover;
}
.Card {
background: #fff;
border-radius: 2px;
display: inline-block;
height: 500px;
margin: 1rem;
position: relative;
width: 300px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
padding: 30px auto;
overflow: hidden;
justify-content: center;
}
.FestivalDetails {
position: absolute;
width: auto;
max-width: 500px;
height: auto;
display: block;
padding: 20px 20px;
}
.FestivalPhoto {
height: 200px;
width: auto;
position: relative;
top: 0;
display: block;
overflow: hidden;
margin: auto;
background-size: initial;
}
/*#media screen and (max-width: 680px) {*/
#media (max-width: 700) {
.col-1 {
width: 100%;
margin: 0;
}
div.logo-inline-div {
padding: 5px;
display: block;
}
.Card {
background: #000;
border-radius: 2px;
display: block;
height: 500px;
position: relative;
width: 80%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
padding: 30px auto;
overflow: hidden;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="EightImages.css" />
<link rel="images" href="images" />
<title>Document</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
<div class="col-sm-12 col-1">
<div class="logo-inline-div">
<img src="images/sunset1.png" />
<label>Build an Empire</label>
<p>
Test
</p>
</div>
</div>
</div>
</div>
<div class="Card">
<div class="FestivalPhoto">
<img src="images/sunset1.png" width="300px" alt="MusicFestivalImage" />
</div>
<div class="FestivalDetails">Hello World</div>
</div>
<div class="Card">
<div class="FestivalPhoto">
<img src="images/sunset1.png" width="300px" alt="MusicFestivalImage" />
</div>
<div class="FestivalDetails">Hello World</div>
</div>
<div class="Card">
<div class="FestivalPhoto">
<img src="images/sunset1.png" width="300px" alt="MusicFestivalImage" />
</div>
<div class="FestivalDetails">Hello World</div>
</div>
</body>
</html>
`

How to create a custom arrow with two colors?

I would like to create a custom shape like this image
My HTML :
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class='row'>
<div class="col-md-10 ">
<div class="col-md-2" style="background-color: yellow;height: 38px;padding:0;">
aaaaa
</div>
<div class="col-md-1" style="padding:0;">
<div class="col-md-12" style="background-color: green; border-radius: 0px 400px 50px 0px/0px 150px 23px 0px;">
mmm
</div>
<div class="col-md-12" style="background-color: red; border-radius: 0px 11px 400px 0px/0px 23px 150px 0px;">
nnnn
</div>
</div>
</div>
</div>
You can simply use pseudo element and data attribute. You will be able de generate the HTML from backend without changing CSS (you simply need to adjust the color as you need) :
* {
box-sizing: border-box;
}
.element {
display: inline-block;
position: relative;
padding: 10px 40px;
background: #ccc;
border: 1px solid #000;
}
.element:before {
content: attr(data-before);
position: absolute;
top: 0;
bottom: 50%;
right: -42px;
width: 40px;
background-image: linear-gradient(45deg, black, red);
border-top-right-radius: 100%;
border: 1px solid #000;
color: #fff;
z-index:99;
}
.element:after {
content: attr(data-after);
position: absolute;
top: 50%;
bottom: 0;
right: -42px;
width: 40px;
background-image: linear-gradient(45deg, black, green);
border-bottom-right-radius: 100%;
border: 1px solid #000;
color: #fff;
z-index:99;
}
<div class="element" data-before="A" data-after="B">
content 1
</div>
<div class="element" data-before="C" data-after="D">
content 2
</div>
<div class="element" data-before="E" data-after="F">
content 3
</div>
Use HTML5 canvas tag and java script to draw you own image in
you can read about it in below link
https://www.w3schools.com/html/html5_canvas.asp

Why does this relatively positioned element render below its parent?

JSFiddle.
In this SSCCE, the first div.number-outer-container renders below its parent div.step-container.
The question is that why is this happening, and what can I do to make it render vertically at the right place?
I have tried to apply a top:0 to div.number-outer-container but it does not seem to affect anything.
Note: This is just an SSCCE, actually each div.step-container is added dynamically, and any number of div.step-containers can be added.
.wrapper-big {
height: 600px;
overflow-y: auto;
width: 100%;
}
.wrapper {
height: 100%;
width: 826px;
margin: 50px auto;
display: table;
background-color: #003b80;
}
.cell {
display: table-cell;
vertical-align: top;
}
.left-cell {
width: 50%;
background-color: chocolate;
}
.right-cell {
background-color: darkslategrey
}
.step-container {
max-height: 200px;
font-size: 0;
}
.right-cell .step-container {
margin-top: 125px;
direction: rtl;
}
.content-box {
display: inline-block;
width: 350px;
height: 200px;
/*border: 5px solid blue;*/
font-size: 0;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.69);
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.69);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.69);
background-color: dodgerblue
}
.right-cell .content-box {
background-color: darkturquoise
}
.middle-cell {
height: 100%;
background-color: white;
width: 1.5px;
font-size: 0;
box-shadow: 0px 0px 10px black;
-moz-box-shadow: 0px 0px 10px black;
-webkit-box-shadow: 0px 0px 10px black;
}
.number-outer-container {
display: inline-block;
/*position:absolute;*/
position: relative;
left: 390px;
}
.left-cell .number-outer-container {
/*margin-left:39px;*/
}
.left-cell .number-outer-container {
left:390px;
}
.right-cell .number-outer-container {
right:390px;
}
.number-inner-container {
height: 200px;
display: flex;
flex-direction: column;
justify-content: center;
}
.number-banner {
width: 50px;
height: 50px;
background-color: crimson;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
font-size:22px;
font-weight:bold;
color:white;
line-height:50px;
text-align:center;
}
.notch-outer-container {
display: inline-block;
}
.left-cell .notch-outer-container {
/*margin-right: 24px;*/
}
.right-cell .notch-outer-container {
/*margin-left: 22px;*/
}
.notch-inner-container {
height: 200px;
display: flex;
flex-direction: column;
justify-content: center;
}
.notch {
width: 0;
height: 0;
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
}
.left-face-notch {
border-right: 15px solid #520f23;
}
.right-face-notch {
border-left: 15px solid #571780;
}
<div class="wrapper-big">
<div class="wrapper">
<div class="cell left-cell" align="left">
<!-- -->
<div class="step-container">
<div class="content-box"></div>
<div class="notch-outer-container">
<div class="notch-inner-container">
<div class="right-face-notch notch"></div>
</div>
</div>
<div class="number-outer-container">
<div class="number-inner-container">
<div class="number-banner">1</div>
</div>
</div>
</div>
<!-- -->
<div class="step-container" style="margin-top:50px;">
<div class="content-box"></div>
<div class="notch-outer-container">
<div class="notch-inner-container">
<div class="right-face-notch notch"></div>
</div>
</div>
<div class="number-outer-container">
<div class="number-inner-container">
<div class="number-banner">3</div>
</div>
</div>
</div>
<!-- -->
<div class="step-container" style="margin-top:50px;">
<div class="content-box"></div>
<div class="notch-outer-container">
<div class="notch-inner-container">
<div class="right-face-notch notch"></div>
</div>
</div>
<div class="number-outer-container">
<div class="number-inner-container">
<div class="number-banner">5</div>
</div>
</div>
</div>
<!-- -->
</div>
<div class="cell middle-cell"></div>
<div class="cell right-cell" align="right">
<!-- -->
<div class="step-container" style="margin-top:125px;">
<div class="content-box"></div>
<div class="notch-outer-container">
<div class="notch-inner-container">
<div class="left-face-notch notch"></div>
</div>
</div>
<div class="number-outer-container">
<div class="number-inner-container">
<div class="number-banner">2</div>
</div>
</div>
</div>
<!-- -->
<div class="step-container" style="margin-top:50px;">
<div class="content-box"></div>
<div class="notch-outer-container">
<div class="notch-inner-container">
<div class="left-face-notch notch"></div>
</div>
</div>
<div class="number-outer-container">
<div class="number-inner-container">
<div class="number-banner">4</div>
</div>
</div>
</div>
<!-- -->
<div class="step-container" style="margin-top:50px;">
<div class="content-box"></div>
<div class="notch-outer-container">
<div class="notch-inner-container">
<div class="left-face-notch notch"></div>
</div>
</div>
<div class="number-outer-container">
<div class="number-inner-container">
<div class="number-banner"></div>
</div>
</div>
</div>
<!-- -->
</div>
</div>
<!-- .wrapper -->
</div>
<!-- .wrapper-big -->
You could set position:relative to the parent container, and set position:absolute on the child element, so they will always stay together.
Read this post if you're interested in learning more about the details of how position works.
UPDATED DEMO
.cell .step-container {
position: relative;
}
.cell .number-outer-container {
position: absolute;
top: 0;
}
.left-cell .number-outer-container {
left: 390px;
}
.right-cell .number-outer-container {
left: -20px;
}
.left-face-notch,
.right-face-notch {
position: absolute;
top: 85px; /*200/2 - 30/2*/
}
Because of div.notch-outer-container and div.content-box, are taking up all the space. And since all the divs are inline-block.
If you set position:absolute; top:0; on div.number-outer-container and remove position:relative then it goes up.
http://jsfiddle.net/7dte3ru6/5/