I wonder how I can place the section class="teacher__section on the right side of the screen using flexbox. Not by float. I have written "justify-content: flex-end;", width 80% also 100% but it doesnt seem to be placing on right side.
I mean I have on the picture below succeeded placing the section on the right side, but the problem now is the left side where I want to get rid of the extra white box and the extra box-shadow. I want it to go around the image just like in
<section class="explore__section"> where I have the box-shadow go around the image. Source code is under below the image.
Source code:
.explore__container {
margin: 5% 0 2% 0;
display: flex;
width: 80%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 0rem 2rem 2rem 0;
}
.forkids__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(0 0, 75% 0, 100% 100%, 0 100%);
margin-right: -20%;
}
.forkids__img {
background-image: url(/img/kids-science.jpeg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0%, 100% 100%, 25% 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 0rem 2rem 2rem 0;
}
.teacher__section {
display: flex;
justify-content: flex-end;
width: 100%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 0rem 2rem 2rem 0;
}
.teacher__container {
display: flex;
justify-content: flex-end;
width: 100%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 2rem 0 0 2rem;
}
.teacher__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
margin-left: -20%;
text-align: right;
font-size: 2rem;
}
.teacher__img {
background-image: url(/img/teacher-science.jpg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 2rem 0 0 2rem;
}
<section class="explore__section">
<div class="explore__container">
<div class="forkids__info"> some text</div>
<div class="forkids__img"></div>
</div>
</section>
<section class="teacher__section">
<div class="teacher__container">
<div class="teacher__img"></div>
<div class="teacher__info">some text</div>
</div>
</section>
Try this solution, Hope this will help
<section class="explore__section">
<div class="explore__container">
<div class="forkids__info"> some text</div>
<div class="forkids__img"></div>
</div>
</section>
<section class="teacher__section">
<div class="teacher__container">
<div class="teacher__img"></div>
<div class="teacher__info">some text</div>
</div>
</section>
<style>
.explore__container {
margin: 5% 0 2% 0;
display: flex;
width: 80%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 0rem 2rem 2rem 0;
}
.forkids__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(0 0, 75% 0, 100% 100%, 0 100%);
margin-right: -20%;
}
.forkids__img {
background-image: url(/img/kids-science.jpeg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0%, 100% 100%, 25% 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 0rem 2rem 2rem 0;
}
.teacher__section {
display: flex;
justify-content: flex-end;
width: 100%;
height: 10rem;
border-radius: 0rem 2rem 2rem 0;
}
.teacher__container {
display: flex;
justify-content: flex-end;
width: 80%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 2rem 0 0 2rem;
}
.teacher__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
margin-left: -20%;
text-align: right;
font-size: 2rem;
}
.teacher__img {
background-image: url(/img/teacher-science.jpg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 2rem 0 0 2rem;
}
</style>
Related
I coded the display of two beveled photos on top of each other and I try to make it responsive without success (I think that using the right units of measurement we can do it).
Here's where I'm at (I put fixed pixel sizes on the elements so you can see the desired rendering) :
.container {
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
margin-right: auto;
margin-left: auto;
}
.img-shape {
width: 400px;
height: 400px;
overflow: hidden;
}
.img-shape:nth-child(2n-1) {
border-top-left-radius: 1.3rem;
border-top-right-radius: 1.3rem;
-webkit-clip-path: polygon(0% 0, 100% 0, 100% 50%, 0 100%);
clip-path: polygon(0% 0, 100% 0, 100% 50%, 0 100%);
}
.img-shape:nth-child(2n) {
margin-top: -185px;
border-bottom-right-radius: 1.3rem;
border-bottom-left-radius: 1.3rem;
-webkit-clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
}
.img-shape img {
width: 100%;
}
<div class="container">
<div class="img-shape">
<img src="https://cdn.pixabay.com/photo/2020/11/10/10/08/architecture-5729165_960_720.jpg" alt="test">
</div>
<div class="img-shape">
<img src="https://cdn.pixabay.com/photo/2020/11/10/01/34/pet-5728249_960_720.jpg" alt="test">
</div>
</div>
Below the maximum .max-width size, I'd like the content to fit the size of the .container without distortion or offset.
Would you be able to help me?
Thank you
PS : Do you think my code is feasible in production or is there a risk of incompatibility?
Update the code like below and rely on percentage:
.container {
max-width: 400px;
margin: auto
}
.img-shape {
overflow: hidden;
position:relative;
}
.img-shape::before { /* this will maitain a square shape */
content:"";
padding-top:100%;
display:block;
}
.img-shape:nth-child(2n-1) {
border-radius: 1.3rem 1.3rem 0 0;
clip-path: polygon(0% 0, 100% 0, 100% 50%, 0 100%);
}
.img-shape:nth-child(2n) {
margin-top: calc(-50% + 20px); /* the gap is 20px */
border-radius: 0 0 1.3rem 1.3rem;
clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
}
.img-shape img {
position:absolute;
top:0;
left:0;
width: 100%;
height:100%;
object-fit:cover;
object-position:top;
}
<div class="container">
<div class="img-shape">
<img src="https://cdn.pixabay.com/photo/2020/11/10/10/08/architecture-5729165_960_720.jpg" alt="test">
</div>
<div class="img-shape">
<img src="https://cdn.pixabay.com/photo/2020/11/10/01/34/pet-5728249_960_720.jpg" alt="test">
</div>
</div>
That you can also simplify like below:
.container {
max-width: 400px;
margin: auto
}
.container::before,
.container::after{
content: "";
padding-top: 100%;
display: block;
background:top/cover;
}
.container::before {
border-radius: 1.3rem 1.3rem 0 0;
clip-path: polygon(0% 0, 100% 0, 100% 50%, 0 100%);
background-image:url(https://cdn.pixabay.com/photo/2020/11/10/10/08/architecture-5729165_960_720.jpg)
}
.container::after {
margin-top: calc(-50% + 20px); /* the gap is 20px */
border-radius: 0 0 1.3rem 1.3rem;
clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
background-image:url(https://cdn.pixabay.com/photo/2020/11/10/01/34/pet-5728249_960_720.jpg)
}
<div class="container"></div>
box-shadow is not working on my image element - I'm talking about .card img:nth-child(1). Here is my HTML code:
.card {
display: flex;
flex-flow: column wrap;
align-items: center;
}
.card img:nth-child(1) {
height: 220px;
width: 100%;
object-fit: cover;
box-shadow: 0px 10px 5px 0px rgba(0, 0, 0, 0.75);
clip-path: polygon(0 0, 100% 0, 100% 86%, 63% 100%, 28% 87%, 0 100%);
}
.card img:nth-child(2) {
height: 150px;
width: 150px;
object-fit: cover;
border-radius: 50%;
border: 10px solid #fff;
box-shadow: 5px 0 10px rgba(0, 0, 0, .7);
margin-top: -40%;
z-index: 2;
}
<div class="card">
<!--img src="img/card-bg1.jpg"-->
<img src="https://via.placeholder.com/550" />
<!-- I'm talking about this image -->
<!--img src="img/profile1.jpg"-->
<img src="https://via.placeholder.com/150" />
<h2>Jane Smith</h2>
<p>FrontEnd Developer</p>
<p>Esdsdsd.</p>
<button type="button">Message me!</button>
</div>
Why isn't it working?
The box shadow is properly applied also on the second image, but you are clipping it using the clip-path property
.card {
display: flex;
flex-flow: column wrap;
align-items: center;
}
.card img:nth-child(1) {
height: 220px;
width: 100%;
object-fit: cover;
box-shadow: 0px 10px 5px 0px rgba(0, 0, 0, 0.75);
}
.card img:nth-child(2) {
height: 150px;
width: 150px;
object-fit: cover;
border-radius: 50%;
border: 10px solid #fff;
box-shadow: 5px 0 10px rgba(0, 0, 0, .7);
margin-top: -40%;
z-index: 2;
}
<div class="card">
<img src="img/card-bg1.jpg">
<!-- I'm talking about this image -->
<!--img src="img/profile1.jpg"-->
<img src="https://via.placeholder.com/150" />
<h2>Jane Smith</h2>
<p>FrontEnd Developer</p>
<p>Esdsdsd.</p>
<button type="button">Message me!</button>
</div>
You need to wrap the image in a parent element set to the same size, and use filter: with drop-shadow(0px 10px 5px rgba(0, 0, 0, 0.75)); on the parent element to create the shadow effect that you want.
You can see the parent element I have added is a div with the class "img-wrap".
.card {
display: flex;
flex-flow: column wrap;
align-items: center;
}
.card img:nth-child(1) {
height: 220px;
width: 100%;
object-fit: cover;
box-shadow: 0px 10px 5px 0px rgba(0, 0, 0, 0.75);
clip-path: polygon(0 0, 100% 0, 100% 86%, 63% 100%, 28% 87%, 0 100%);
}
.img-wrap {
height: 220px;
width: 100%;
filter: drop-shadow(0px 10px 5px rgba(0, 0, 0, 0.75));
}
.card img:nth-child(2) {
height: 150px;
width: 150px;
object-fit: cover;
border-radius: 50%;
border: 10px solid #fff;
box-shadow: 5px 0 10px rgba(0, 0, 0, .7);
margin-top: -40%;
z-index: 2;
}
<div class="card">
<div class="img-wrap">
<img src="https://picsum.photos/id/237/200/300"> <!-- I'm talking about this image -->
</div>
<img src="https://picsum.photos/id/237/200/300">
<h2>Jane Smith</h2>
<p>FrontEnd Developer</p>
<p>Esdsdsd.</p>
<button type="button">Message me!</button>
</div>
You can't use box-shadow on that parent either, because the parent is still a rectangle and the shadow will look wrong.
.tag-wrap {
filter: drop-shadow(-1px 6px 3px rgba(50, 50, 0, 0.5));
}
.tag {
background: #FB8C00;
color: #222;
padding: 2rem 3rem 2rem 4rem;
font: bold 32px system-ui;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 86%, 63% 100%, 28% 87%, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 86%, 63% 100%, 28% 87%, 0 100%);
}
<span class="tag-wrap">
<span class="tag">
drop-shadow
</span>
</span>
The problem is that clip-path is overriding box-shadow styles.
You then need to create a new parent and use the drox-shadow filter to it to retain the polygonal shape.
Please, have a look here for a clear presentation and solution of the problem.
Just remove clip-path: polygon(0 0, 100% 0, 100% 86%, 63% 100%, 28% 87%, 0 100%); from .card img:nth-child(1). If you need clip-path and box-shadow both together you need to add one parent class to clip-path and give that class filter: drop-shadow(0px 10px 5px 0px rgba(0, 0, 0, 0.75));
.card {
display: flex;
flex-flow: column wrap;
align-items: center;
}
.card-img:nth-child(1){
height: 220px;
width: 100%;
object-fit: cover;
filter: drop-shadow(-1px 6px 3px rgba(50, 50, 0, 0.5));
}
.card img:nth-child(1) {
height: 220px;
width: 100%;
object-fit: cover;
clip-path: polygon(0 0, 100% 0, 100% 86%, 63% 100%, 28% 87%, 0 100%);
}
.card img:nth-child(2) {
height: 150px;
width: 150px;
object-fit: cover;
border-radius: 50%;
border: 10px solid #fff;
box-shadow: 5px 0 10px rgba(0, 0, 0, .7);
margin-top: -40%;
z-index: 2;
}
<div class="card">
<div class="card-img">
<img src="img/card-bg1.jpg">
</div>
<!-- I'm talking about this image -->
<!--img src="img/profile1.jpg"-->
<div class="card-img">
<img src="https://via.placeholder.com/150" />
</div>
<h2>Jane Smith</h2>
<p>FrontEnd Developer</p>
<p>Esdsdsd.</p>
<button type="button">Message me!</button>
</div>
Any way to ensure that the green line is equal length to the left and between the dots on this line? Even when the browser is resized?
I am not sure what the best way to do it is. I can make the lines the same size but cannot keep the right-hand circle at the end, or just make it look visually balanced.
#wrapper1 {
display: flex;
left: 0px;
right: 0px;
}
#item1 {
box-sizing: border-box;
display: flex;
flex: 1 1 0%;
padding: 24px 0px 41px;
}
#item1:after {
content: '';
height: 3px;
width: 120.313px;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
flex: 1 1 auto;
opacity: 0.5;
}
#item1:before {
content: '';
height: 3px;
width: 120.313px;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
flex: 1 1 auto;
opacity: 0.5;
}
#label_wrapper_1 {
align-self: center;
}
#label_wrapper_1:before {
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 0px 5px;
color: rgba(255, 255, 255, 0.87);
content: '✓';
display: inline-block;
height: 25px;
min-width: 25px;
text-align: center;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
border-radius: 40px 40px 40px 40px;
}
#wrapper2 {
box-sizing: border-box;
display: flex;
flex: 1 1 0%;
padding: 24px 0px 41px;
}
#wrapper2:before {
content: '';
height: 3px;
text-align: center;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
flex: 1 1 auto;
opacity: 0.5;
}
#label_wrapper_2:before {
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 0px 5px;
color: rgba(255, 255, 255, 0.87);
content: '✓';
display: inline-block;
height: 25px;
text-align: center;
width: 25px;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
border-radius: 40px 40px 40px 40px;
}
<div id="wrapper1">
<div id="item1">
<div id="label_wrapper_1">
</div>
</div>
<div id="wrapper2">
<div id="label_wrapper_2">
</div>
</div>
</div>
A fiddle for your convenience:
http://jsfiddle.net/ha7uqe9x/3/
Ideally I would like it to look more like this:
is this?
#wrapper1 {
display: flex;
left: 0px;
right: 0px;
position:relative;
}
#item1 {
box-sizing: border-box;
display: flex;
flex: 1 1 0%;
padding: 24px 0px 41px;
position:absolute;
left:50%;
transform:translateX(-50%);
}
#item1:after {
content: '';
height: 3px;
width: 120.313px;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
flex: 1 1 auto;
}
#item1:before {
content: '';
height: 3px;
width: 120.313px;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
flex: 1 1 auto;
}
#label_wrapper_1 {
align-self: center;
}
#label_wrapper_1:before {
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 0px 5px;
color: rgba(255, 255, 255, 0.87);
content: '✓';
display: inline-block;
height: 25px;
min-width: 25px;
text-align: center;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
border-radius: 40px 40px 40px 40px;
}
#wrapper2 {
box-sizing: border-box;
display: flex;
flex: 1 1 0%;
padding: 24px 0px 41px;
}
#wrapper2:before {
content: '';
height: 3px;
text-align: center;
align-self: center;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
flex: 1 1 auto;
}
#label_wrapper_2:before {
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 0px 5px;
color: rgba(255, 255, 255, 0.87);
content: '✓';
display: inline-block;
height: 25px;
text-align: center;
width: 25px;
background: rgb(124, 179, 66) none repeat scroll 0% 0% / auto padding-box border-box;
border-radius: 40px 40px 40px 40px;
}
<div id="wrapper1">
<div id="item1">
<div id="label_wrapper_1">
</div>
</div>
<div id="wrapper2">
<div id="label_wrapper_2">
</div>
</div>
</div>
I wanted to add a certain font awesome icon (fa-arrow-alt-circle-down), but it's not showing. I copied the classes from the website and entered them in my HTML. I tried other icons before and there was no issue with them. Sometimes I change .far to .fa, but now that doesn't work either. Can someone see why?
<div class="jumbotron jumbotron-fluid">
<h1 class="heading-primary heading-primary--main"> Wizard's unite fans</h1>
<div class="navigation-container">
<button class="find-locals-nav-btn">Find Local players</button>
<button class="forum-nav-btn">Forum</button>
<button>login / register</button>
</div>
<i class="far fa-arrow-alt-circle-down"></i>
</div>
SCSS file
.jumbotron {
height: 100vh;
background-image: linear-gradient(
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)
), url("https://i.amz.mshcdn.com/-7R3bLC1xTVhrjc86pBeYAogXFY=/950x534/filters:quality(90)/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fcard%2Fimage%2F760683%2F2117d274-d2cf-46b9-b60c-698d65361438.jpg");
background-size: cover;
position: relative;
padding: 5rem;
margin-bottom: 2rem;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 85vh, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
.heading-primary {
opacity: .8;
}
#include respond(phone) {
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90vh, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 90vh, 0 100%);
background-position: center top;
}
.navigation-container {
border-radius: 20px;
background-color: #fff;
font-size: 2rem;
width: 70%;
margin: 4rem auto 0 auto;
display: flex;
text-align: center;
justify-content: center;
padding: 1rem;
background-image: linear-gradient(to bottom right, #ccc, #666);
> * {
background-color: transparent;
border: none;
flex: 1 0 0;
cursor: pointer;
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
&:hover {
transform: translateY(-.2rem);
}
&:not(:last-child) {
border-right: 1px solid #444;
}
}
}
.fa-arrow-alt-circle-down {
font-size: 4rem;
color: #fff;
}
}
.fa Font Awesome are v4. .far are v5.
For all icons existing in both, changing far to fa will do the trick. For the ones added in v5, obviously, it won't, as they do not exist in v4.
You can view all v4.7 icons here.
For future notice, finding version specific FA icons is by searching for "font awesome x.x cheatsheet". Replace x.x with the proper version.
I am struggling with this overlay. On the prod site the :before element overlays a div with a full image bg. When viewing the site in Chrome and Firefox the content is displayed above the overlay as intended. However, when viewing the content in IE11 the :before element overlays everything in that parent div.
I would like the result in Chrome to be the same in IE.
Ex. Overlay above image, text/content on top of the overlay.
See: JSFiddle
.foreverCTA:before {
content: "";
width: 100%;
height: 900px;
background: #2f71a9;
background: -webkit-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -o-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -moz-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: radial-gradient(circle, transparent -25%, #2f71a9 81%);
position: absolute;
left: 0;
}
.foreverCTA {
color: #fff;
/*display: flex;*/
background: #fff url("images/2015APR06_RAYSBASEBALL_MFPB6240s.jpg") no-repeat center;
background-size: cover;
height: 900px;
/*justify-content: center;
flex-wrap: wrap;
align-items: center;*/
}
.foreverCTA p,
.foreverCTA h2,
.foreverCTA h4 {
color: #fff!important;
}
.foreverCTA li,
.foreverCTA ul {
list-style: none;
padding: 0;
}
.foreverCTA p,
.foreverCTA h3,
.foreverCTA h2,
.foreverCTA li {
-webkit-filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, .4));
filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, .4));
}
.ion-ios-baseball {
margin: 3px;
padding-top: 10px;
font-size: 2em;
vertical-align: center;
}
.foreverGame {
margin-top: 50px;
}
.foreverHeader {
padding-top: 50px;
/*-webkit-flex: 1 1 100%;
-moz-flex: 1 1 100%;
-ms-flex: 1 1 100%;
-o-flex: 1 1 100%;
flex: 1 1 100%;
z-index: 999;*/
}
.waysToBuy {
margin: 50px 0;
}
.buyDetails {
min-height: 210px;
text-align: center;
}
.foreverHeader h1,
.waysToBuy h1 {
font-size: 4.5em;
color: #ECDC00!important;
padding: 0!important;
margin: 0;
-webkit-filter: drop-shadow(2px 4px 0px rgba(249, 159, 28, 1));
filter: drop-shadow(2px 4px 0px rgba(249, 159, 28, 1));
}
.foreverHeader h3 {
font-size: 3.5em;
color: #fff!important;
margin: 5px;
}
.foreverBuy {
/*display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: flex-start;*/
}
.buy1,
.buy2 {
height: 400px;
/*display: flex;
flex-direction: column;
justify-content: center;
flex-wrap: wrap;
align-items: flex-end;
flex-basis: 20%;*/
}
.buyDetails {
/*align-self: flex-start;*/
}
.buyButton {
/*flex-basis: 50%;
align-self: center;*/
vertical-align: bottom;
}
.buy2 a {
color: #ECDC00!important;
}
<div class="foreverCTA">
<div class="row">
<div class="foreverHeader">
<h3>Lorem ipsum<br></h3>
<h1>Lorem ipsum<br></h1>
<h3>Lorem ipsum</h3>
</div>
</div>
<div class="row">
<div class="foreverGame">
<h2>Lorem ipsum</h2>
</div>
<div class="foreverDate">
<h3>Lorem ipsum</h3>
</div>
</div>
</div>
This will do the trick,
check this fiddle here
first remove position:absolute property and add following properties as,
display:block;
margin-bottom:-900px;
so your final CSS will be as follows,
.foreverCTA:before {
content: "";
width: 100%;
height: 900px;
background: #2f71a9;
background: -webkit-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -o-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -moz-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: radial-gradient(circle, transparent -25%, #2f71a9 81%);
left: 0;
display:block;
margin-bottom:-900px;
}