displaying block of two divs on half splitted index page - html

I have a half-splitted index page. I use twitter bootstrap-v5.1.3 to split. On the left side I have two divs which have one text and one image class.
These divs are inside of flex-parent. So they are looking inline-block.
I want text on top and image on bottom which I mentioned below. But also text and image must be on center in "leftside col-md-6".
I need this:
body {
font-family: "Merriweather", sans-serif;
background-color: #fafafa;
overflow-x: hidden;
}
.leftside,
.rightside {
height: 50vh;
width: 100%;
}
#media screen and (min-width: 768px) {
.leftside,
.rightside {
height: 100vh;
}
}
.leftside {
background-color: #8a68ff;
opacity: 83%;
}
.rightside {
background-color: #ffffff;
}
.left-hero-text {
font-size: 48px;
font-weight: 400;
color: #ffffff;
}
.bold-text {
font-size: 55px;
font-weight: 700;
}
img {
width: 50%;
height: auto;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="row gx-0">
<div class="col-md-6 gx-0">
<div class="leftside d-flex justify-content-center align-items-center">
<div class="left-hero-text">
<span class="bold-text">Lorem</span> ipsum
<span class="bold-text">dolor</span> sit amet
</div>
<img src="https://wiki.geogebra.org/uploads/a/a4/Menu-tools.svg" alt="tools" />
</div>
</div>
<div class="col-md-6 gx-0">
<div class="rightside d-flex justify-content-center align-items-center">
Right Side
</div>
</div>
</div>

You just need to change your inner flex container's direction to column.
body {
font-family: "Merriweather", sans-serif;
background-color: #fafafa;
overflow-x: hidden;
}
.leftside,
.rightside {
height: 50vh;
width: 100%;
}
#media screen and (min-width: 768px) {
.leftside,
.rightside {
height: 100vh;
}
}
.leftside {
background-color: #8a68ff;
opacity: 83%;
}
.rightside {
background-color: #ffffff;
}
.left-hero-text {
font-size: 48px;
font-weight: 400;
color: #ffffff;
}
.bold-text {
font-size: 55px;
font-weight: 700;
}
img {
width: 50%;
height: auto;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="row gx-0">
<div class="col-md-6 gx-0">
<div class="leftside d-flex flex-column justify-content-center align-items-center">
<div class="left-hero-text">
<span class="bold-text">Lorem</span> ipsum
<span class="bold-text">dolor</span> sit amet
</div>
<img src="https://wiki.geogebra.org/uploads/a/a4/Menu-tools.svg" alt="tools" />
</div>
</div>
<div class="col-md-6 gx-0">
<div class="rightside d-flex justify-content-center align-items-center">
Right Side
</div>
</div>
</div>

Related

How to align elements and add icon to bootstrap li

I don't know how to center icon with the text. I have SVG + text. I can do it with plain CSS(flex-box) but I have to use bootstrap. Also, I want to center text, so it will be centered as other parts of the webpage, I want it to be aligned vertically
I have this:
I want to get this:
I have tried different solutions but did not come up with a good idea.
So the questions are:
How to make text to be centered to the left so it looks centered?
How to aligned svg icon with the text?
thanks
<section class="perks">
<img src="./media/blueCircle.svg" alt="" />
<div class="container">
<div class="row">
<div class="col perksFirst">Perks of Meetlete</div>
<div class="w-100"></div>
<div class="row perksList">
<div class="col">Access to our secure video platform!</div>
<div class="col">
<img src="./media/2.svg" alt="" />Calls are executed through our
App!
</div>
<div class="w-100"></div>
<div class="col">Metelete calls take place on your time!</div>
<div class="col">None of your information is shared!</div>
<div class="w-100"></div>
<div class="col">Build loyalty with your fans!</div>
<div class="col">Make lifetime memories!</div>
<div class="w-100"></div>
<div class="col">Earn up to 10x more than other platforms!</div>
<div class="col">Meetlete calls are timed!</div>
</div>
<div class="w-100"></div>
<div class="col">
<button class="earlyAccess btn">Early access</button>
<div class="launchDate">Launching 2/14/21!</div>
</div>
</div>
</section>
.perks {
display: flex;
text-align: center;
margin-top: 310px;
position: relative;
}
.perks .earlyAccess {
margin-top: 117px;
}
.perks img {
position: absolute;
left: 0;
top: -50%;
}
.perks .row {
justify-content: center;
}
.perksList {
max-width: 860px;
display: flex;
justify-content: center;
align-items: center;
}
.perksList .col {
font-weight: 600;
font-size: 18px;
display: flex;
align-items: center;
display: flex !important;
text-align: start;
margin-top: 26px;
}
.perksFirst {
margin-bottom: 77px;
font-size: 24px;
font-weight: 700;
}
.launchDate {
font-weight: 700;
font-size: 18px;
margin-top: 26px;
}
In order to align icons with the text you can put them together in a
Or you use bootstrap grid https://getbootstrap.com/docs/4.6/layout/grid/. You could use this easily to render it all dynamically, by putting your text in a list.
You can use text-align: center on the outer div (container) to center all. then text-align left in the inner one (perklist) in case this turns your text all left aligned.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
justify-content: center;
margin: auto;
text-align: left;
margin-top: 10px;
}
.heading {
text-align: center;
padding: .5rem;
}
.heading h3 {
font-size: 24px;
font-weight: 700;
text-transform: capitalize;
}
.card {
background: whitesmoke;
padding: 2rem;
border: darkgrey
}
span {
display: flex;
vertical-align: middle;
padding-top: 1rem;
}
span img {
display: inline-flex;
height: 2rem;
}
span a {
font-size: 18px;
font-weight: 600;
line-height: 2rem;
padding-left: .5rem;
}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Solution By Tarak</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="new.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xl-1"></div>
<div class="card col-xl-10 col-sm-12">
<div class="row">
<div class="heading col-12">
<h3>Perks of Meetlete</h3>
</div>
</div>
<div class="row">
<div class="col-xl-6 col-md-12">
<span><img src="./test-tubes.svg" /><a>Access to our secure video platform!</a></span>
<span><img src="./test-tubes.svg" /><a>Metelete calls take place on your time!</a></span>
<span><img src="./test-tubes.svg" /><a>Build loyalty with your fans!</a></span>
<span><img src="./test-tubes.svg" /><a>Earn up to 10x more than other platforms!</a></span>
</div>
<div class="col-xl-6 col-md-12">
<span><img src="./test-tubes.svg" /><a>Calls are executed through our App!</a></span>
<span><img src="./test-tubes.svg" /><a>None of your information is shared!</a></span>
<span><img src="./test-tubes.svg" /><a>Make lifetime memories!</a></span>
<span><img src="./test-tubes.svg" /><a>Meetlete calls are timed!</a></span>
</div>
</div>
</div>
</div>
</div>
</body>
height of span img == line-height of span a (for it to be inline center)
change svg of your choice.
play with styles.

How to change the order of website items on a phone screen

On my website I have the following section:
<div class="container">
<div class="row text-center mb-4 mt-2">
<div class="col-md-12">
<div class="w-100 col-md-12 pb-4 pt-1 bg-light">
<div class="row align-items-center">
<div class="col-md-4">
<h4 class="font-weight-bold">Step 1:</h4>
<h5 class="pl-5 pr-5">Search for people based on your keywords.</h5>
</div>
<div class="col-md-8 mb-5 mt-4">
<div class="icon-box">
<img src="static/images/step1.jpg" class="img-fluid
mx-auto d-block border" />
</div>
</div>
<div class="col-md-8 mt-5 mb-5">
<div class="icon-box">
<img src="static/images/step2.jpg" class="img-fluid
mx-auto d-block border" />
</div>
</div>
<div class="col-md-4">
<h4 class="font-weight-bold">Step 2:</h4>
<h5 class="pl-5 pr-5">The results are sorted by a person's responsiveness. Choose from a\
list of matches who are ready and willing to interact.</h5>
</div>
<div class="col-md-4">
<h4 class="font-weight-bold">Step 3:</h4>
<h5 class="pl-5 pr-5">Message and make connections with people who are open for (real or\
virtual) coffee!</h5>
</div>
<div class="col-md-8 mt-5">
<div class="icon-box">
<img src="static/images/step3.jpg" class="img-fluid
mx-auto d-block border" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
which looks like:
But on a phone screen, the text (Step 1 etc.) and images are stacked on top of each other. But because of the layout it does not alternate text-image-text-image-text-image as I would like it to:
How to I change the order on a phone screen but keep the desktop layout the way it is please?
My CSS is here also:
html {
font-size: 14px;
}
#media (min-width: 768px) {
html {
font-size: 16px;
}
}
body {
font-family: "PT Sans", sans-serif;
}
.container {
max-width: 960px;
}
.lh-condensed {
line-height: 1.25;
}
.main-header {
max-width: 700px;
}
.ofc-main-title {
font-family: "Lato", sans-serif;
font-weight: 900;
font-size: 40px;
}
.ofc-title {
font-family: "Lato", sans-serif;
font-weight: 900;
font-size: 24px;
}
a.ofc-link-title {
color: #000000;
text-decoration: none;
}
a.ofc-link-title:hover {
color: #000000;
}
a.ofc-link-title:active {
color: #000000;
}
a.ofc-link-title:visited {
color: #000000;
}
.ofc-main-subtitle {
font-family: "PT Sans", sans-serif;
font-weight: 400;
font-size: 24px;
}
.ofc-footer {
font-family: "Economica", sans-serif;
font-weight: 400;
font-size: 16px;
text-align: center;
}
form#main-search-form {
align-items: center;
justify-content: center;
}
span#main-beta-tag {
color: #FF1493;
font-size: 16px;
}
span#beta-tag {
color: #FF1493;
font-size: 12px;
}
#onboarding-title {
font-size: 24px;
}
.onboarding-panel {
background-color: #FBF7F0;
border-radius: 15px;
}
.onboarding-img {
width: 250px;
}
.onboarding-text {
font-weight: 900;
}
.step-panel {
background-color: #FFFFFF;
border-radius: 15px;
}
.step-text {
background-color: #FFFFFF;
width: 49%;
text-align: left;
display: inline-block;
padding: 30px;
font-size: 20px;
}
.step-img {
background-color: #FFFFFF;
width: 49%;
text-align: right;
display: inline-block;
padding: 20px;
}
span#looking-for {
color: #1C99CE;
}
#media(max-width:767px) {
.step-text {
width: 100%;
}
.step-img {
width: 100%;
}
.step-img {
width: 100% !important;
padding: 0px;
}
.step-img img {
width: 100% !important;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 10px;
padding-left: 10px;
}
.step-text {
background: none;
}
.steps {
box-shadow: 0px 0px 1px 1px #d9d6d6;
}
.onboarding-panel .steps:first-child .step-text {
padding-bottom: 0px !important;
}
.step-img {
background: none !important;
}
.ofc-main-title {
font-size: 35px;
}
#search-form {
margin-top: 15px;
}
.border-bottom {
display: block !important;
text-align: center !important;
}
#search-form .btn {
margin-top: 10px !important;
padding-left: 20px;
padding-right: 20px
}
}
.icon-box {
margin: 0px 20px;
}
.icon-box p {
font-size: 18px;
}
I have added to your media query for #media (max-width: 767px) {} the order property of flex-box in a way the desired output is achieved.
html {
font-size: 14px;
}
#media (min-width: 768px) {
html {
font-size: 16px;
}
}
body {
font-family: "PT Sans", sans-serif;
}
.container {
max-width: 960px;
}
.lh-condensed {
line-height: 1.25;
}
.main-header {
max-width: 700px;
}
.ofc-main-title {
font-family: "Lato", sans-serif;
font-weight: 900;
font-size: 40px;
}
.ofc-title {
font-family: "Lato", sans-serif;
font-weight: 900;
font-size: 24px;
}
a.ofc-link-title {
color: #000000;
text-decoration: none;
}
a.ofc-link-title:hover {
color: #000000;
}
a.ofc-link-title:active {
color: #000000;
}
a.ofc-link-title:visited {
color: #000000;
}
.ofc-main-subtitle {
font-family: "PT Sans", sans-serif;
font-weight: 400;
font-size: 24px;
}
.ofc-footer {
font-family: "Economica", sans-serif;
font-weight: 400;
font-size: 16px;
text-align: center;
}
form#main-search-form {
align-items: center;
justify-content: center;
}
span#main-beta-tag {
color: #ff1493;
font-size: 16px;
}
span#beta-tag {
color: #ff1493;
font-size: 12px;
}
#onboarding-title {
font-size: 24px;
}
.onboarding-panel {
background-color: #fbf7f0;
border-radius: 15px;
}
.onboarding-img {
width: 250px;
}
.onboarding-text {
font-weight: 900;
}
.step-panel {
background-color: #ffffff;
border-radius: 15px;
}
.step-text {
background-color: #ffffff;
width: 49%;
text-align: left;
display: inline-block;
padding: 30px;
font-size: 20px;
}
.step-img {
background-color: #ffffff;
width: 49%;
text-align: right;
display: inline-block;
padding: 20px;
}
span#looking-for {
color: #1c99ce;
}
#media (max-width: 767px) {
.one {
order: 1;
}
.two {
order: 2;
}
.three {
order: 4;
}
.four {
order: 3;
}
.five {
order: 5;
}
.six {
order: 6;
}
.step-text {
width: 100%;
}
.step-img {
width: 100%;
}
.step-img {
width: 100% !important;
padding: 0px;
}
.step-img img {
width: 100% !important;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 10px;
padding-left: 10px;
}
.step-text {
background: none;
}
.steps {
box-shadow: 0px 0px 1px 1px #d9d6d6;
}
.onboarding-panel .steps:first-child .step-text {
padding-bottom: 0px !important;
}
.step-img {
background: none !important;
}
.ofc-main-title {
font-size: 35px;
}
#search-form {
margin-top: 15px;
}
.border-bottom {
display: block !important;
text-align: center !important;
}
#search-form .btn {
margin-top: 10px !important;
padding-left: 20px;
padding-right: 20px;
}
}
.icon-box {
margin: 0px 20px;
}
.icon-box p {
font-size: 18px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>JS Bin</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<div class="container">
<div class="row text-center mb-4 mt-2">
<div class="col-md-12">
<div class="w-100 col-md-12 pb-4 pt-1 bg-light">
<div class="row align-items-center">
<div class="col-md-4 one">
<h4 class="font-weight-bold">Step 1:</h4>
<h5 class="pl-5 pr-5">
Search for people based on your keywords.
</h5>
</div>
<div class="col-md-8 mb-5 mt-4 two">
<div class="icon-box">
<img
src="static/images/step1.jpg"
class="img-fluid mx-auto d-block border"
alt="image-1"
/>
</div>
</div>
<div class="col-md-8 mt-5 mb-5 three">
<div class="icon-box">
<img
src="static/images/step2.jpg"
class="img-fluid mx-auto d-block border"
alt="image-2"
/>
</div>
</div>
<div class="col-md-4 four">
<h4 class="font-weight-bold">Step 2:</h4>
<h5 class="pl-5 pr-5">
The results are sorted by a person's responsiveness. Choose
from a\ list of matches who are ready and willing to interact.
</h5>
</div>
<div class="col-md-4 five">
<h4 class="font-weight-bold">Step 3:</h4>
<h5 class="pl-5 pr-5">
Message and make connections with people who are open for
(real or\ virtual) coffee!
</h5>
</div>
<div class="col-md-8 mt-5 six">
<div class="icon-box">
<img
src="static/images/step3.jpg"
class="img-fluid mx-auto d-block border"
alt="image-3"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"
></script>
<script src="./script.js"></script>
</body>
</html>
That's the beauty of order property in flexbox. It is very very helpful in these scenarios.
If i undrestand your question correctly you want to display text image , text image , text image from top to down in mobile screen?
first add a container for each row, something like this
<div class="row text-center mb-4 mt-2">
<div class="col-md-12">
<div class="w-100 col-md-12 pb-4 pt-1 bg-light">
<div class="row align-items-center">
<div class="row">
<div class="col-md-4">
<h4 class="font-weight-bold">Step 1:</h4>
<h5 class="pl-5 pr-5">Search for people based on your keywords.</h5>
</div>
<div class="col-md-8 mb-5 mt-4">
<div class="icon-box">
<img src="image1" class="img-fluid
mx-auto d-block border" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-8 mt-5 mb-5">
<div class="icon-box">
<img src="image2" class="img-fluid
mx-auto d-block border" />
</div>
</div>
<div class="col-md-4">
<h4 class="font-weight-bold">Step 2:</h4>
<h5 class="pl-5 pr-5">The results are sorted by a person's responsiveness. Choose
from
a\
list of matches who are ready and willing to interact.</h5>
</div>
</div>
<div class="row">
<div class="col-md-4">
<h4 class="font-weight-bold">Step 3:</h4>
<h5 class="pl-5 pr-5">Message and make connections with people who are open for
(real
or\
virtual) coffee!</h5>
</div>
<div class="col-md-8 mt-5">
<div class="icon-box">
<img src="image3" class="img-fluid
mx-auto d-block border" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Then in when you are inside mobile mode add a class to the second container with this properties
.yourClass {
display: flex;
flex-direction: column-reverse;
}

Podium CSS: position elements at the bottom of their div

I'm trying to create a podium using CSS and HTML. I have achieved to positionate the steps of the podium at the bottom by adding position: relative to the father and position: absolute; bottom: 0 to the steps, but as I want to display a text just above the steps, I'm having problems positioning this text there.
My first aproach was to put the text and the step on a div and positioning absolutely this div, but as the steps get their height by a percentage of their father the father needs to have a height: 100% property, so the div solution isn't valid.
Here I attach my code snippet:
#font-face {
font-family: DaggerSquare;
src: url("fonts/podium-font.woff") format("woff"), url("fonts/podium-font.ttf") format("truetype");
}
#podium-box {
width: 100%;
margin: 0 auto;
}
.podium-number {
font-family: DaggerSquare;
font-weight: bold;
font-size: 4em;
color: white;
}
.step-container {
width: 100%;
position: relative;
}
.step {
width: 100%;
position: absolute;
bottom: 0;
}
.bg-blue {
background-color: #063b65;
}
#first-step {
height: 50%;
}
#second-step {
height: 35%;
}
#third-step {
height: 30%;
}
.centerBoth {
display: flex;
justify-content: center;
align-items: center;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="import" type="css" href="podium-chart.css">
<div id="podium-box" class="row" style="height: 400px">
<div class="col-md-4 step-container m-0 p-0">
<div>
Text 2
</div>
<div id="second-step" class="bg-blue step centerBoth podium-number">
2
</div>
</div>
<div class="col-md-4 step-container m-0 p-0">
<div>
Text 1
</div>
<div id="first-step" class="bg-blue step centerBoth podium-number">
1
</div>
</div>
<div class="col-md-4 step-container m-0 p-0">
<div>
Text 3
</div>
<div id="third-step" class="bg-blue step centerBoth podium-number">
3
</div>
</div>
</div>
No need to use position:absolute just use flexbox and flex-columns.
Then push the text div to the bottom.
#font-face {
font-family: DaggerSquare;
src: url("fonts/podium-font.woff") format("woff"), url("fonts/podium-font.ttf") format("truetype");
}
#podium-box {
margin: 0 auto;
display: flex;
}
.podium-number {
font-family: DaggerSquare;
font-weight: bold;
font-size: 4em;
color: white;
}
.step-container {
flex: 1;
display: flex;
flex-direction: column;
}
.step-container>div:first-child {
margin-top: auto;
text-align: center;
}
.step {
text-align: center;
}
.bg-blue {
background-color: #063b65;
}
#first-step {
height: 50%;
}
#second-step {
height: 35%;
}
#third-step {
height: 30%;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="import" type="css" href="podium-chart.css">
<div id="podium-box" class="row" style="height: 300px">
<div class="col-md-4 step-container m-0 p-0">
<div>
Text 2
</div>
<div id="second-step" class="bg-blue step centerBoth podium-number">
2
</div>
</div>
<div class="col-md-4 step-container m-0 p-0">
<div>
Text 1
</div>
<div id="first-step" class="bg-blue step centerBoth podium-number">
1
</div>
</div>
<div class="col-md-4 step-container m-0 p-0">
<div>
Text 3
</div>
<div id="third-step" class="bg-blue step centerBoth podium-number">
3
</div>
</div>
</div>
As has already been pointed out, you could probably start from scratch and structure this a bit better. But if you want to keep as is then just give the divs that contain the text a class and give them the following attributes:
position:absolute;
bottom:70px;

Div Blocks under each other in mobile version

There are 3 block different size in a row. How can I make them responsive, because in mobile version they overlay at each other.
.watch {
position: absolute;
bottom: 0;
left: 50px;
width: 224px;
height: 69px;
cursor: pointer;
background-color: #918A83;
opacity: 0.85;
}
.watch-elements {
margin: 20px 20px;
}
.watch p {
display: inline-block;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #fff;
}
.mouse {
position: absolute;
bottom: 0;
border: 1px solid #DAD3CC;
width: 577px;
height: 69px;
cursor: pointer;
background-color: #fff;
}
.mouse-elements {
text-align: center;
margin-top: 10px;
}
.mouse p {
display: inline-block;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #000;
}
.chat-bot {
position: absolute;
bottom: 20px;
background-color: #09A753;
border-radius: 100px;
right: 100px;
width: 227px;
height: 39px;
cursor: pointer;
}
.chat-bot img {
margin-top: -20px;
margin-left: -15px;
}
.chat-bot p {
display: flex;
justify-content: center;
text-align: center;
margin-top: -15px;
flex-direction: row;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #fff;
}
#media all and (max-width: 1024px) {
.watch img {
position: absolute;
float: left;
left: 0;
}
.watch p {
margin-left: 20px;
}
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="container mt-5">
<h2 class="header-text">Practical business advice and knowhow<br>customized to your needs</h2>
</div>
</div>
<div class="d-flex justify-content-left">
<div class="watch">
<div class="watch-elements">
<img src="assets/img/icons/icon2.svg">
<p>Watch Presenation</p>
</div>
</div>
</div>
<div class="d-flex justify-content-center">
<div class="mouse">
<div class="mouse-elements">
<img src="assets/img/icons/Icon1.svg"><br>
<p>Scroll Down</p>
</div>
</div>
</div>
<div class="d-flex justify-content-right">
<div class="chat-bot">
<img src="assets/img/06w.png">
<p>Hi, can I help you?</p>
<img src="assets/img/icons/icon3.svg" style="float: right; margin-right: -60px; margin-top: -39px;">
</div>
</div>
</div>
Now, they arrange in a row as on image
In mobile version left block disappears and I can not see it, also second and third block overlay at each other.
For mobile devices please try position: relative instead of position: absolute. Don't forget to adjust other CSS values as per your requirements. Hope this will solve your issues
#media all and (max-width: 767px) {
.watch, .mouse, .chat-bot{
position:relative;
right:auto;
left:auto;
top:auto;
bottom:auto;
margin:5px 0
}
}
I have put all the elements inside a div with class footer. and used bootstrap flex css properties to align it. Hope its helps you. thanks
.watch {
width: 224px;
height: 69px;
cursor: pointer;
background-color: #918A83;
opacity: 0.85;
}
.watch-elements {
margin: 20px 20px;
}
.watch p {
display: inline-block;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #fff;
}
.mouse {
border: 1px solid #DAD3CC;
width: 577px;
height: 69px;
cursor: pointer;
background-color: #fff;
}
.mouse-elements {
text-align: center;
margin-top: 10px;
}
.mouse p {
display: inline-block;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #000;
}
.chat-bot {
background-color: #09A753;
border-radius: 100px;
right: 100px;
width: 227px;
height: 39px;
cursor: pointer;
}
.chat-bot img {
margin-top: -20px;
margin-left: -15px;
}
.chat-bot p {
display: flex;
justify-content: center;
text-align: center;
margin-top: -15px;
flex-direction: row;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #fff;
}
#media all and (max-width: 1024px) {
.watch img {
position: absolute;
float: left;
left: 0;
}
.watch p {
margin-left: 20px;
}
}
.footer {
position: absolute;
bottom: 0;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="container mt-5">
<h2 class="header-text">Practical business advice and knowhow<br>customized to your needs</h2>
</div>
</div>
<div class="d-flex footer justify-content-sm-center align-content-between flex-sm-wrap flex-lg-nowrap">
<div class="d-flex justify-content-left">
<div class="watch">
<div class="watch-elements">
<img src="assets/img/icons/icon2.svg">
<p>Watch Presenation</p>
</div>
</div>
</div>
<div class="d-flex justify-content-center">
<div class="mouse">
<div class="mouse-elements">
<img src="assets/img/icons/Icon1.svg"><br>
<p>Scroll Down</p>
</div>
</div>
</div>
<div class="d-flex justify-content-right align-items-center">
<div class="chat-bot">
<img src="assets/img/06w.png">
<p>Hi, can I help you?</p>
<img src="assets/img/icons/icon3.svg" style="float: right; margin-right: -60px; margin-top: -39px;">
</div>
</div>
</div>
</div>
you can try replacing your existing divs with the below ones
<div class="d-flex justify-content-left col-lg-3 col-md-6 col-xs-12">
<div class="d-flex justify-content-center col-lg-3 col-md-6 col-xs-12">
<div class="d-flex justify-content-right col-lg-3 col-md-6 col-xs-12">
position:absolute and related properties are not suitable for this function. You can use CSS flexbox layout
For more information use this link: Complete Guide to Flexbox
I explain simple usage of flexbox layout using example:
#wrapper{display:flex;flex-wrap:wrap;justify-content:space-between}
/*just for styles*/
#wrapper div{background-color:#f5f5f5;text-align:center;padding:2px 5px;margin:2px}
#e3{width:200px}
<div id="wrapper">
<div id="e1">element 1</div>
<div id="e2">element 2</div>
<div id="e3">element 3</div>
<div id="e4">element 4</div>
</div>
Also with flex layout you can manipulate elements places based on viewport size with order property.

Last column background color inside 100% width section

I'm building the website and I want to reach the section like on my psd (img attached):
You can see that there's 100% width section and .col-md-9 and .col-md-3 inside this section.
But when .col-md-3 ends its background should continue and pave the background of the main section.
How can I make the column's background continue? I've spent hours solving this problem but I didn't find the correct way. Thanks!
.single__content {
width: 100%;
max-width: 743px;
padding-top: 57px;
}
.single__content p {
color: #707070;
font-size: 15px;
font-weight: 400;
line-height: 23px;
}
.single__meta {
background: #3c73ba;
height: 70px;
}
.single__meta h2 {
font-size: 38px;
font-weight: 300;
line-height: 42px;
color: #fff;
margin: 0;
padding-top: 14px;
}
.col-sidebar {
background: #4285db;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<div class="single__meta">
<div class="container">
<div class="row ">
<div class="col-md-9">
<h2 class="page-title">Lorem ipsum dolor</h2>
</div>
<div class="col-sidebar col-md-3">
Second column content
</div>
</div>
</div>
</div>
You can split the background of your top with background: linear-gradient.
Demo with bootstrap 4
.top-bar {
background: linear-gradient(
to right,
#3c73ba 0%,
#3c73ba 50%,
#4285db 50%,
#4285db 100%
);
width: 100%;
padding: 0;
margin: 0;
color: #fff;
}
.col-left{
background: #3c73ba;
}
.col-right {
background: #4285db;
}
<div class="top-bar" style="padding: 0">
<div class="container">
<div class="row">
<div class="col-left col-md-9">
<h2>left</h2>
</div>
<div class="col-right col-md-3">
<h2>right</h2>
</div>
</div>
</div>
</div>
"make this changes in your code" hope this u want
<div class="row col_bg">
<div class="col-md-9 ">
<h2 class="page-title">Lorem ipsum dolor</h2>
</div>
<div class="col-sidebar col-md-3">
Second column content
</div>
<div class="clear">
</div>
</div>
"for css"
.row.col_bg {
background-color: #4285db;
clear: both;
}
.col-md-9 {
float: left;
width: 70%;
}
.single__meta h2 {
color: #000;
font-size: 38px;
font-weight: 300;
line-height: 42px;
margin: 0;
}
.col-sidebar.col-md-3 {
float: right;
width: 30%;
}
.clear {
clear: both;
}