images and text of a flexbox item overlapping absolute positioned div (tooltip) - css

I'm using display: flex to create panels for my upgrade items. The code looks something like this, I tried to re-create it as best as I could: fidle
. Now I don't understand why are the images overlapping into the tooltip (hover over elements for tooltip to appear). This is very strange, I thought it was because of display: flex, so I tried doing the same thing using grid, no luck. The tooltip has to be position: absolute, especially because I'm planning on adding some javascript so the tooltip box follows the cursor. What is causing this kind of behavior? I'm thinking there's something to do with flexbox/grid and absolute positioning, but I'm not very good at css

Add a z-index value to the .tooltip class.
*
{
margin: 0;
padding: 0;
box-sizing: border-box;
}
p
{
font-size: 24px;
line-height: normal;
}
img
{
border: 1px solid grey;
vertical-align: middle;
}
/* Upgrade wrapper & body */
#upgrades {
height:100%;
box-shadow:0 0 16px 4px rgb(0, 0, 0);
}
.upgrade {
display: flex;
width: 320px;
height: auto;
margin: 1em;
position: relative;
box-shadow: 0 0 8px 2px rgb(0, 0, 0);
}
.upgrade-img {
width: 64px;
height: 64px;
}
.upgrade-body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-basis: 100%;
padding: 0.5em;
}
/* Upgrade Hover Effects */
.upgrade:hover {box-shadow: 0 0 8px 2px rgb(0, 204, 255);}
.upgrade:hover .tooltip {display: initial;}
/* Tooltip */
.tooltip {
display: none;
width: 256px;
height: auto;
padding: 1em;
position: absolute;
top: 64px;
left: 0;
z-index: 100; /* <------- ADDED Z-INDEX */
background-color: rgb(0, 0, 0);
color: rgb(255, 255, 255);
box-shadow: 0 0 4px 1px rgb(0, 0, 0);
}
<div class="upgrade">
<div class="upgrade-img">
<img src="https://source.unsplash.com/random/64x64">
<div class="tooltip">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam ea sequi recusandae commodi necessitatibus voluptatum, labore libero quasi quos veniam eveniet laborum aspernatur harum iusto, provident itaque hic laboriosam unde!
</div>
</div>
<div class="upgrade-body">
<p>
<img src="https://source.unsplash.com/random/24x24">
100 (dmg)
</p>
<p>
<img src="https://source.unsplash.com/random/24x24">
500 (cost)
</p>
</div>
</div><div class="upgrade">
<div class="image">
<img src="https://source.unsplash.com/random/64x64">
<div class="tooltip">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam ea sequi recusandae commodi necessitatibus voluptatum, labore libero quasi quos veniam eveniet laborum aspernatur harum iusto, provident itaque hic laboriosam unde!
</div>
</div>
<div class="body">
<p>
<img src="https://source.unsplash.com/random/24x24">
100 (dmg)
</p>
<p>
<img src="https://source.unsplash.com/random/24x24">
500 (cost)
</p>
</div>
</div><div class="upgrade">
<div class="image">
<img src="https://source.unsplash.com/random/64x64">
<div class="tooltip">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam ea sequi recusandae commodi necessitatibus voluptatum, labore libero quasi quos veniam eveniet laborum aspernatur harum iusto, provident itaque hic laboriosam unde!
</div>
</div>
<div class="body">
<p>
<img src="https://source.unsplash.com/random/24x24">
100 (dmg)
</p>
<p>
<img src="https://source.unsplash.com/random/24x24">
500 (cost)
</p>
</div>
</div>

Related

Building a carousel in React

I am trying to build a carousel from scratch in React. I want the active card to be in the middle and the others to show a portion of them on the side. When I put overflow hidden, it hides the portions.
How do I make it so that the side portions appear but I still maintain the background image blur?
here is my jsx code:
import React from 'react'
import './Header.css'
import {images} from '../../constants'
import Blur from 'react-blur'
const Header = () => {
return (
<Blur className="app__header" img={images.bgcake} blurRadius={35} style={{height: "100vh"}} >
<div className="app__header-carousel">
<div className="app__header-carousel-1">
<img className="app__header-carousel-img" alt="pink cake" src={images.carousel01} />
<div className="app__header-carousel-content">
<h3 className="app__header-h3">Fresh Baked | Fathers Day</h3>
<h1 className="app__header-h1">MORNING BERRY</h1>
<p className="app__header-p">Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque, omnis odit similique dolor ab maiores quae aliquam beatae ad deleniti porro ducimus eum provident fuga quo doloremque animi impedit unde.</p>
<button type="button" className="app__explore-button">Order</button>
<button type="button" className="app__order-button">Explore</button>
</div>
</div>
<div className="app__header-carousel-1">
<img className="app__header-carousel-img" alt="red velvet" src={images.redVelvet} />
<div className="app__header-carousel-content">
<h3 className="app__header-h3">Fresh Baked | Fathers Day</h3>
<h1 className="app__header-h1">RED VELVET</h1>
<p className="app__header-p">Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque, omnis odit similique dolor ab maiores quae aliquam beatae ad deleniti porro ducimus eum provident fuga quo doloremque animi impedit unde.</p>
<button type="button" className="app__explore-button">Order</button>
<button type="button" className="app__order-button">Explore</button>
</div>
</div>
<div className="app__header-carousel-1">
<img className="app__header-carousel-img" alt="pink cupcake" src={images.carousel03} />
<div className="app__header-carousel-content">
<h3 className="app__header-h3">Fresh Baked | Fathers Day</h3>
<h1 className="app__header-h1">CUP CAKES</h1>
<p className="app__header-p">Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque, omnis odit similique dolor ab maiores quae aliquam beatae ad deleniti porro ducimus eum provident fuga quo doloremque animi impedit unde.</p>
<button type="button" className="app__explore-button">Order</button>
<button type="button" className="app__order-button">Explore</button>
</div>
</div>
</div>
</Blur>
)
}
export default Header
here is my css code:
.app__header-carousel{
display: flex;
position: absolute;
top: 10%;
right: 10%;
left: 10%;
overflow: hidden;
}
.app__header-carousel-1{
display: flex;
justify-content: space-between;
height: 80vh;
width: 100%;
margin-right: 3em;
}
.app__header-carousel-img-1{
width: 80%;
}
.app__header-carousel-content{
background: #FDFFD5;
padding: 4rem 10rem 5rem 5rem;
}
.app__header-h3{
color: #76D9D2;
margin-bottom: 0.65rem;
}
.app__header-h1{
color: #F397B0;
font-size: 4rem;
margin-bottom: 0.65rem;
}
.app__header-p{
margin-bottom: 5rem;
}
.app__explore-button{
background: #2D2D2D;
color: beige;
width: 8rem;
margin-right: 0.5rem;
padding: 5px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.app__order-button{
background: #F397B0;
color: #2D2D2D;
width: 8rem;
margin-right: 0.5rem;
padding: 5px;
border: none;
border-radius: 5px;
cursor: pointer;
}
How do I make it appear how I want it to?

Mix blend mode with 2 overlapping divs but need to exclude the text

I'm flexing 2 elements, they overlap about 25%.
Using mix-blend-mode, it blends the backgrounds nicely, but also the text.
JS fiddle right here: https://jsfiddle.net/simohell/q9breg60/
I tried using ::before to apply the mix-blend mode but i can't figure it out.
.wrapper {
display: flex;
}
.text {
margin-top: 30px;
flex: 0 0 50%;
padding: 30px;
background-color: rgba(17, 38, 59, .95);
mix-blend-mode: multiply;
}
h1,
p {
color: #fff;
}
.image {
flex: 0 0 75%;
margin-left: -25%;
background: url("https://images.unsplash.com/photo-1456298964505-ef9e1a638209?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2534&q=80");
background-size: cover;
mix-blend-mode: multiply;
}
<div class="wrapper">
<div class="text">
<h1>Welcome to this snippet</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea dolore quaerat cupiditate accusantium eligendi vitae quas omnis obcaecati unde deserunt. Quibusdam aspernatur magni accusamus debitis distinctio iusto aliquam natus magnam?</p>
</div>
<div class="image"> </div>
</div>
Move the background of the text to main wrapper instead then increase its z-index to allow the image to blend only with the background. The main trick is to adjust the size of the gradient to simulate the same background for the text only:
.wrapper {
display: flex;
background:
linear-gradient(rgba(17, 38, 59, .95),rgba(17, 38, 59, .95))
bottom left/
50% /*widh:50% */
calc(100% - 30px) /*height:100% - top margin */
no-repeat;
}
.text {
margin-top: 30px;
flex: 0 0 50%;
padding: 30px;
z-index:2;
}
h1,p {
color: #fff;
}
.image {
flex: 0 0 75%;
margin-left: -25%;
background: url("https://images.unsplash.com/photo-1456298964505-ef9e1a638209?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2534&q=80");
background-size: cover;
mix-blend-mode: multiply;
}
body {
margin:0;
}
* {
box-sizing:border-box;
}
<div class="wrapper">
<div class="text">
<h1>Welcome to this snippet</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea dolore quaerat cupiditate accusantium eligendi vitae quas omnis obcaecati unde deserunt. Quibusdam aspernatur magni accusamus debitis distinctio iusto aliquam natus magnam?</p>
</div>
<div class="image"> </div>
</div>
You can also move the image to the background of the main wrapper and consider background-blend-mode. You will also have a reduced code:
.wrapper {
overflow:auto;
background:
url("https://images.unsplash.com/photo-1456298964505-ef9e1a638209?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2534&q=80")
center/cover content-box,
linear-gradient(rgba(17, 38, 59, .95),rgba(17, 38, 59, .95))
bottom left/
50% /*widh:50% */
calc(100% - 30px) /*height:100% - top margin */
no-repeat;
padding-left:25%;
background-blend-mode: multiply;
}
.text {
margin-top: 30px;
width:66.6%; /* we added 25% of padding so we need 66.6% from 75% to get 50%*/
margin-left:-33.4%; /* we shift back by the added margin 25% (33.4% of 75%)*/
padding: 30px;
}
h1,p {
color: #fff;
}
body {
margin:0;
}
* {
box-sizing:border-box;
}
<div class="wrapper">
<div class="text">
<h1>Welcome to this snippet</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea dolore quaerat cupiditate accusantium eligendi vitae quas omnis obcaecati unde deserunt. Quibusdam aspernatur magni accusamus debitis distinctio iusto aliquam natus magnam?</p>
</div>
</div>

Issue with h1 positioning

the h1 in the showcase area is getting on top of each other when i am trying to squeeze the window which is not supposed to behave in that way.But when it is not,, everything is fine. As i am new in this sector, i am not understanding what i've done wrong. Could anyone please show me where it needs to be fixed?
html:
body {
margin: 0;
padding: 0;
background: #f4f4f4;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
line-height: 1.6em;
}
/* GLOBAL */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
ul {
padding: 0;
margin: 0;
}
/* HEADER */
header {
background-color: #35424a;
color: #fff;
padding-top: 30px;
min-height: 70px;
border-bottom: #e8491d 3px solid;
}
header a {
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 17px;
}
header li {
float: left;
display: inline;
padding: 0 20px;
}
header #branding {
float: left;
}
header #branding h1 {
margin: 0;
}
header nav {
float: right;
margin-top: 10px;
}
header .highlight,
header .current a {
color: #e8491d;
font-weight: bold;
}
header a:hover {
color: #cccccc;
font-weight: bold;
}
/*Showcase*/
#showcase {
min-height: 400px;
background: url('../images/showcase.jpg') no-repeat 0 -400px;
text-align: center;
color: #fff;
}
#showcase h1 {
margin-top: 100px;
font-size: 55px;
margin-bottom: 10px;
}
#showcase p {
font-size: 17px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ACME Web Design</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1><span class="highlight">Acme</span> Web Design</h1>
</div>
<nav>
<ul>
<li class="current">Home</li>
<li>About</li>
<li>Services</li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>Affordable Professional Web Design</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illo, dolor, explicabo voluptas quibusdam dolore omnis maiores quidem necessitatibus nulla, iure ullam asperiores illum. Aliquid fuga magnam labore error vitae laborum.</p>
</div>
</section>
<section id="newsletter">
<div class="container">
<h1>Subscribe To Our Newsletter</h1>
<form action="">
<input type="email" name="email" id="" placeholder="Enter Email">
<button type="submit" class="button_1">Submit</button>
</form>
</div>
</section>
<section id="boxes">
<div class="container">
<div class="box">
<img src="images/logo_html.png" alt="">
<h1>HTML 5 Markup</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iusto quis consequuntur architecto quos ullam non dolore magni officiis. Veniam maxime labore corrupti voluptatibus! Sequi consequuntur quam laboriosam voluptatibus, at dolorum.</p>
</div>
<div class="box">
<img src="images/logo_css.png" alt="">
<h1>CSS 3 Styling</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iusto quis consequuntur architecto quos ullam non dolore magni officiis. Veniam maxime labore corrupti voluptatibus! Sequi consequuntur quam laboriosam voluptatibus, at dolorum.</p>
</div>
<div class="box">
<img src="images/logo_brush.png" alt="">
<h1>Graphic Design</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iusto quis consequuntur architecto quos ullam non dolore magni officiis. Veniam maxime labore corrupti voluptatibus! Sequi consequuntur quam laboriosam voluptatibus, at dolorum.</p>
</div>
</div>
</section>
<footer>
<p>ACME Web Design, Copyright © 2019</p>
</footer>
</body>
</html>
You have a few options here:
If you want to allow the title to stack for smaller screens you will need to make a small change to your css. I noticed that you have the following line in your css:
line-height: 1.6em;
Try changing this to
line-height:1.6;
Unitless line heights are typically recommended for use because this will allow the child elements to compute their line heights based on the font size specified.
Try reading the information here for more in-depth explanation
If you would like for the text to remain on one line when resizing the screen you can use media queries to change the font-size:
Based on your code I noticed that the font begins to stack at 1204px so try adding this:
#media screen and (max-width: 1204px) {
#showcase h1 {
font-size: 45px;
}
}
And then from here you can continue on to test the size of the screen and then add more breakpoints based on where the font begins to stack.
Personally I would add the style line-height: 55px; to the #showcase h1 element, so the height of the text is the same as the size of it.
This is going to be the final result:
body {
margin: 0;
padding: 0;
background: #f4f4f4;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
line-height: 1.6em;
}
/* GLOBAL */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
ul {
padding: 0;
margin: 0;
}
/* HEADER */
header {
background-color: #35424a;
color: #fff;
padding-top: 30px;
min-height: 70px;
border-bottom: #e8491d 3px solid;
}
header a {
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 17px;
}
header li {
float: left;
display: inline;
padding: 0 20px;
}
header #branding {
float: left;
}
header #branding h1 {
margin: 0;
}
header nav {
float: right;
margin-top: 10px;
}
header .highlight,
header .current a {
color: #e8491d;
font-weight: bold;
}
header a:hover {
color: #cccccc;
font-weight: bold;
}
/*Showcase*/
#showcase {
min-height: 400px;
background: url('../images/showcase.jpg') no-repeat 0 -400px;
text-align: center;
color: #fff;
}
#showcase h1 {
margin-top: 100px;
font-size: 55px;
margin-bottom: 10px;
line-height: 55px;
}
#showcase p {
font-size: 17px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ACME Web Design</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1><span class="highlight">Acme</span> Web Design</h1>
</div>
<nav>
<ul>
<li class="current">Home</li>
<li>About</li>
<li>Services</li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>Affordable Professional Web Design</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illo, dolor, explicabo voluptas quibusdam dolore omnis maiores quidem necessitatibus nulla, iure ullam asperiores illum. Aliquid fuga magnam labore error vitae laborum.</p>
</div>
</section>
<section id="newsletter">
<div class="container">
<h1>Subscribe To Our Newsletter</h1>
<form action="">
<input type="email" name="email" id="" placeholder="Enter Email">
<button type="submit" class="button_1">Submit</button>
</form>
</div>
</section>
<section id="boxes">
<div class="container">
<div class="box">
<img src="images/logo_html.png" alt="">
<h1>HTML 5 Markup</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iusto quis consequuntur architecto quos ullam non dolore magni officiis. Veniam maxime labore corrupti voluptatibus! Sequi consequuntur quam laboriosam voluptatibus, at dolorum.</p>
</div>
<div class="box">
<img src="images/logo_css.png" alt="">
<h1>CSS 3 Styling</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iusto quis consequuntur architecto quos ullam non dolore magni officiis. Veniam maxime labore corrupti voluptatibus! Sequi consequuntur quam laboriosam voluptatibus, at dolorum.</p>
</div>
<div class="box">
<img src="images/logo_brush.png" alt="">
<h1>Graphic Design</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iusto quis consequuntur architecto quos ullam non dolore magni officiis. Veniam maxime labore corrupti voluptatibus! Sequi consequuntur quam laboriosam voluptatibus, at dolorum.</p>
</div>
</div>
</section>
<footer>
<p>ACME Web Design, Copyright © 2019</p>
</footer>
</body>
</html>
Hope this helps.

Exclude some part from background blend mode

I try to achieve effect similar to Photoshop multiply via code on my project. At the same time i try to exclude some elements that are in child div to be affected by it (like text layers) - and i hit in the wall. Tried already adding additional div's setting different z-index's or go with absolute position.
Here you can find pen with example of the problem:
HTML
<div class="main">
<div class="inner">
<h1>Some header</h1>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quia eligendi est eius unde autem dolore adipisci perspiciatis laboriosam reiciendis placeat! Eveniet, quam? Vitae sit saepe quam delectus fugiat, dolores necessitatibus.</p>
</div>
</div>
CSS
.inner {
text-align: center;
padding: 50px 0;
background: #0079ff;
mix-blend-mode: multiply;
backface-visibility: hidden;
color: white;
}
.main {
background-repeat: no-repeat;
background-image: url('https://preview.ibb.co/fMY2f9/Bg1.jpg');
background-size: cover;
}
Summary: Child element's of 'child div' are affected by multiply. Is there a way to prevent that?
Screenshots:
Use pseudo element for the background to avoid this:
.inner {
text-align: center;
padding: 50px 0;
color: white;
}
.main {
background-repeat: no-repeat;
background-image: url('https://preview.ibb.co/fMY2f9/Bg1.jpg');
background-size: cover;
position: relative;
z-index: 0;
}
.main::before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #0079ff;
mix-blend-mode: multiply;
}
<div class="main">
<div class="inner">
<h1>Some header</h1>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quia eligendi est eius unde autem dolore adipisci perspiciatis laboriosam reiciendis placeat! Eveniet, quam? Vitae sit saepe quam delectus fugiat, dolores necessitatibus.</p>
</div>
</div>

Parallax effect with pseudo elements

I'm building a layout for a clients custom cms system, all the content is built in bootstrap rows which gets printed in a container. The client wanted to be able to make colored rows, i managed this with pseudo elements like this:
.full-row:before {
position: absolute;
top: 0;
left: 50%;
display: block;
width: 100vw;
height: 100%;
background-color: inherit;
content: '';
-moz-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
-o-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
I wanted to take the same approach to make the client able to make parallax rows as well, but I can't get the background image to fill the entire width of the row, or can't seem to position it the right way.
I have made a codepen to see an example where the colored rows work but the parallax effect sucks. Any suggestions on how to fix this?
Here's the code pen
One solution would be to use left: -9999px; right: -9999px; instead of width but by using this method image will stretch. the problem with you HTML structure is you used .row with in container and use position:relative; on it. If you take row out of container your current code will work fine
h3 {
text-transform: uppercase;
color: #fff;
}
header {
padding-top: 80px;
width: 100%;
height: 50vh;
color: #fff;
background-position: center;
background-image: url(http://i68.tinypic.com/2upfuk2.jpg);
background-size: cover;
}
header h1 {
text-transform: uppercase;
}
header .sub-headline {
font-size: 20px;
font-family: cursive;
}
.big-ass-icons {
text-align: center;
}
.big-ass-icons .fa {
font-size: 30px;
}
.big-ass-icons p {
display: block;
margin: 0 auto;
width: 80%;
}
.dummie-col {
height: 800px;
}
/* Helper classes */
.mar-b-30 {
margin-bottom: 30px;
}
.mar-b-40 {
margin-bottom: 40px;
}
.mar-b-50 {
margin-bottom: 50px;
}
.mar-b-60 {
margin-bottom: 60px;
}
.mar-b-70 {
margin-bottom: 70px;
}
.pad-30 {
padding: 30px 0;
}
.pad-40 {
padding: 40px 0;
}
.pad-50 {
padding: 50px 0;
}
.pad-60 {
padding: 60px 0;
}
.pad-70 {
padding: 70px 0;
}
.bg-gray {
background-color: #f9f9f3;
}
/* Row handeling */
.full-row,
.parallax-row {
position: relative;
}
.full-row:before {
position: absolute;
top: 0;
left: 50%;
display: block;
width: 100vw;
height: 100%;
background-color: inherit;
content: '';
-moz-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
-o-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
.parallax-row:before {
position: absolute;
top: 0;
bottom: 0;
left: -9999px;
right: -9999px;
display: block !important;
min-height: 100%;
background-color: rgba(0, 0, 0, .7);
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100%;
content: '';
}
/* More images to be added */
.image1:before {
background-image: url(http://i68.tinypic.com/2z5m1hh.png);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<header class="mar-b-50">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h1>Big A** Image</h1>
<div class="sub-headline">How interesting</div>
</div>
</div>
</div>
</header>
<section class="container">
<div class="row big-ass-icons mar-b-40">
<div class="col-sm-4">
<span class="fa fa-pencil"></span>
<h4>Highly editable</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
<div class="col-sm-4">
<span class="fa fa-pencil"></span>
<h4>Highly editable</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
<div class="col-sm-4">
<span class="fa fa-pencil"></span>
<h4>Highly editable</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
<div class="row bg-gray full-row pad-40">
<div class="col-xs-12">
<h2>This is a colored row</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt at quos tenetur assumenda laudantium voluptatum laboriosam placeat rem earum, recusandae similique, et vero, doloremque possimus, fugit aliquam magni nulla! Sunt?</p>
</div>
</div>
<div class="row pad-30">
<div class="col-xs-12 text-center">
<h2>This is just a white row</h2>
<p>But it have two columns!</p>
</div>
<div class="col-sm-6">
<p class="text-justify">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis illo sequi consectetur neque dignissimos animi eligendi, ab soluta laudantium minus autem non dolorem ut sint necessitatibus possimus sapiente pariatur voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod dolores perspiciatis doloribus voluptatem libero itaque, sapiente veniam error, autem, aliquid voluptatibus optio dolorum eaque eos quis facere voluptatum sed provident!</p>
</div>
<div class="col-sm-6">
<p class="text-justify">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis illo sequi consectetur neque dignissimos animi eligendi, ab soluta laudantium minus autem non dolorem ut sint necessitatibus possimus sapiente pariatur voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod dolores perspiciatis doloribus voluptatem libero itaque, sapiente veniam error, autem, aliquid voluptatibus optio dolorum eaque eos quis facere voluptatum sed provident!</p>
</div>
</div>
<div class="row parallax-row image1 pad-70">
<div class="col-xs-12 text-center">
<h3>Wuhuuuu, awesome parallax!</h3>
</div>
</div>
<div class="row">
<div class="col-xs-12 dummie-col">
<h2>This is just to make the page long, for the parallax effect</h2>
</div>
</div>
</section>
Maybe a dick move, but im going to answer my own question.
The problem was the background-position units. I used vw to make the size so the positioning should be in the same units.
I added:
background-position: 50vw 0;
I also updated the pen

Resources