How to put Image on top of text with Boostrap - html

SO I want to reach this image
But i am getting this result, and i have a sense that i misused boostrap for the grid, but i am not sure it has to do with my initial problem
I want to reach a parallax element too by translating the image on the x axis on click as in this gif So i am worried if using margin would make it worse
EDIT: my problem isn't with the grid and text placement, i want to position the trees ( right and left on the right sides) which isn't working at all. I know it is immature to say this but idc of the grid if its work like in the prototype
here is my code
<section id="abtus">
</span>
<div class="col-4" style="margin-bottom: 700px;"><img class="tree" src="./images/tree1.png" width="750"></div>
<div class="grid text-center " >
<div class="cols-4 pb-3"><p class="text1">WHO WE ARE</p></div>
<div class="cols-4 p-1 "><p class="text2">We are two sisters who come from a similar <br>
background of love for everything creative and magical.</p> </div>
<div class="cols-4 p-1 "> <p class="text2">We aim to deliver your stories with interesting <br>
visually pleasing magic that separates you from the rest!</p></div>
<div class=" cols-4 p-1 pb-5 "> <p class="text2">To guarantee great quality work and also an added fun <br>
element to your project.</p></div>
<div class="cols-1"><img src="./images/Group 33.svg"></div>
</div>
<div class="grid px-5">
<div class="cols-4 offset-md-2"><img src="./images/Group 30.svg" width="90"> </div>
<div class=" cols-4 pb-4"></div>
<div class=" cols-4 pb-2"></div>
<div class=" cols-4"><img src="./images/Group 46.svg" width="150"></div>
</div>
<div class="grid text-center">
<div class="cols-4 pb-3"><p class="text1">THE TEAM</p></div>
<div class="cols-4 pb-5"><p class="text2 pb-4">We have a rich experience in the market, especially <br>
in gaming and animation. We work with several tasks <br>
such as visual development, concept art, character design, <br>
graphic design, branding, and social media.<br><br>
Yes, We do everything!</p> </div>
<div class=" cols-4 pb-4"></div>
<div class=" cols-4 text-center"><img src="./images/Group 50.svg" width="120"></div>
</div>
</span>
</section>
the relative css
section{
flex: none;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100vw;
scroll-snap-align: start;
}
.tree{
top: 0;
left:0;
position:absolute ;
z-index: 1;
}
.text1{
text-align: left;
left: 0;
color: #20122B;
font-family: 'Lato';
font-weight: 900;
font-size: 30px;
}
.text2{
text-align: left;
color: #20122B;
font-family: 'Lato';
font-weight: 500;
font-size: 0.9em;
line-height: 16px;
}
.arrow1{
display: grid;
place-items: center;
place-content: center;
border-left: 3px solid #ffffff;
border-bottom: 3px solid #ffffff;
width: 10px;
height: 10px;
border-radius: 0.2em;
transform: rotate(225deg);
}
.right{
margin-right: 150px;
float:left;
}
.left{
margin-right: 100px;
float:left;
transform: rotate(45deg);
}

Related

How to align image and text side by side? HTML CSS Flexbox

Right now the text aligns underneath the image. I want the text to be beside the image vertically. I tried to add flex-direction: column and justify-content: center but it's not working. I also tried float and it didn't work. I can't figure out how to align the text and image side by side. How can I make it so that they align beside each other? Are there errors in my code?
.whoweare {
padding: 80px 0px 50px;
background-color: #000000;
}
.whoweare #whoweareimg {
width: 100%;
min-width: 200px;
}
.whoweare .content {
-webkit-display: flex;
display: flex;
flex-wrap: wrap;
/* flex-direction: column; */
/* justify-content: center; */
}
.whoweare .content .box {
/* padding:5px;
flex:0 0 100%;
max-width: 100%; */
padding: 5px;
flex: 0 0 100%;
max-width: 100%;
}
.whoweare .content #whoweareimg {
width: 50%;
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
padding: 30px;
}
.whoweare .content h2 {
font-size: 50px;
font-weight: 500;
margin: 20px;
color: #ffffff;
padding: 0px 0px 20px;
}
.whoweare .content p {
font-size: 20px;
line-height: 50px;
color: #ffffff;
margin: 20px;
padding: 0px 0px 20px;
font-family: 'Open Sans', sans-serif;
}
<section class="whoweare" id="whoweare">
<div class="container">
<div class="content">
<div class="box text wow slideInRight">
<!-- <div class="class-items"> -->
<div class="item wow bounceInUp">
<!-- <div class="item-img"> -->
<img id="whoweareimg" src="https://via.placeholder.com/50" alt="classes" />
</div>
<div class="box text wow slideInRight">
<h2>Who we are</h2>
<p>UNDRGRND Muscle & Fitness, where street culture meets the bodybuilding and fitness lifestyle. Our goal is to provide our members with a unique state of the art training experience in the Vaughan/GTA.
</br>
</br>
Experience a one of a kind training atmosphere to help fuel workouts like no other. Exclusive training sessions from IFBB pro athletes will be available in order for members to reach their lifestyle and/or contest prep goals. The facility will provide the best fitness equipment on the market ranging from Atlantis, Cyber, Arsenal, and more.
</br>
</br>
We are all part of a family and all in this together here at UNDRNRGD.</p>
</div>
</div>
</div>
</div>
</section>
Your HTML seems wrong because there was a <div class="box text wow slideInRight"> nested inside another, but in any case here is the code I came up with to solve your problem.
The idea is that .whoweare .content .box:first-child is your flex container, and its two children (<div class="item wow bounceInUp"> and the other <div class="box text wow slideInRight">) will be aligned side by side.
.whoweare {
padding: 80px 0px 50px;
background-color: #000000;
}
.whoweare #whoweareimg {
width: 100%;
min-width: 200px;
}
.whoweare .content .box {
padding: 5px;
max-width: 100%;
}
.whoweare .content .box:first-child {
display: flex;
}
.whoweare .content #whoweareimg {
width: 50%;
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
padding: 30px;
}
.whoweare .content h2 {
font-size: 50px;
font-weight: 500;
margin: 20px;
color: #ffffff;
padding: 0px 0px 20px;
}
.whoweare .content p {
font-size: 20px;
line-height: 50px;
color: #ffffff;
margin: 20px;
padding: 0px 0px 20px;
font-family: 'Open Sans', sans-serif;
}
<section class="whoweare" id="whoweare">
<div class="container">
<div class="content">
<div class="box text wow slideInRight">
<!-- <div class="class-items"> -->
<div class="item wow bounceInUp">
<!-- <div class="item-img"> -->
<img id="whoweareimg" src="https://via.placeholder.com/50" alt="classes" />
</div>
<div class="box text wow slideInRight">
<h2>Who we are</h2>
<p>UNDRGRND Muscle & Fitness, where street culture meets the bodybuilding and fitness lifestyle. Our goal is to provide our members with a unique state of the art training experience in the Vaughan/GTA.
</br>
</br>
Experience a one of a kind training atmosphere to help fuel workouts like no other. Exclusive training sessions from IFBB pro athletes will be available in order for members to reach their lifestyle and/or contest prep goals. The facility will provide the best fitness equipment on the market ranging from Atlantis, Cyber, Arsenal, and more.
</br>
</br>
We are all part of a family and all in this together here at UNDRNRGD.</p>
</div>
</div>
</div>
</div>
</section>
<!-- begin snippet: js hide: false console: true babel: false -->
<div class="content">
<div>
<img id="whoweareimg" src="https://via.placeholder.com/50x250" alt="classes" />
</div>
<div>
<h2>Who we are</h2>
<p>UNDRGRND Muscle & Fitness, where street culture meets the bodybuilding and fitness lifestyle. Our goal is to provide our members with a unique state of the art training experience in the Vaughan/GTA.
<br>
<br> Experience a one of a kind training atmosphere to help fuel workouts like no other. Exclusive training sessions from IFBB pro athletes will be available in order for members to reach their lifestyle and/or contest prep goals. The facility will
provide the best fitness equipment on the market ranging from Atlantis, Cyber, Arsenal, and more.
<br>
<br> We are all part of a family and all in this together here at UNDRNRGD.</p>
</div>
</div>

How to make sticky div in css?

I have shared 2 images which mentioned below, In the first Screenshot there is a one div which label as This is test course, As you can see the footer div (which labeled as We're closed) is not sticky, I need the footer div as like second image. My conditions is something like - If the page don't have enough content then or you can say blank space then the footer div should stick at the bottom. Something like the second image.
I have tried position: fixed; it's showing perfectly but on the other pages it's still showing at the top which I don't want.
Another way I tried padding-top: 15vh; It's solving the problem but on the other page it's making blank space (Padding) which also not a good interface.
And tried many more methods like, bottom: 0; position: absolute; etc.
Current style applied in the div:
.footer {
padding: 0px 15px 10px 15px;
margin-bottom: 0px !important;
z-index: 11;
}
The HTML:
<div class="footer">
<div class="card card-style m-0">
<div class="card mx-0" data-card-height="120" style="height: 120px;">
<div class="card-center" style="z-index: 9">
Call
Email
</div>
<div class="card-center ms-3 ps-1">
<h1 class="font-20 show-business-opened working-message-above color-white mb-n1 disabled">We're Online!</h1>
<p class="show-business-opened working-message-under color-white opacity-90 mb-0 disabled">Call us Now! Let's have a
chat!</p>
<h1 class="font-20 show-business-closed working-message-above color-white mb-n1">We're Closed!</h1>
<p class="show-business-closed working-message-under color-white opacity-90 mb-0">We'll be back very soon!
</p>
</div>
<div class="card-overlay rounded-0 show-business-opened bg-highlight-dark disabled"></div>
<div class="card-overlay rounded-0 show-business-closed bg-red-dark"></div>
</div>
<div class="content p-3 pt-0 mt-0">
<p>If you have any queries or facing techinal problem, You can simply inform us, Our team will resolved your
issue as soon as they can.</p>
</div>
</div>
How can I resolve this?
You can do that starting from your HTML structure. for example, if your website has a header, main container, and footer, then you can manage their height to the viewport. specifically the main container's min-height to the viewport.
* {
margin: 0;
padding: 0;
overflow-x: hidden;
}
.header {
width: 100vw;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
background: lightcoral;
}
.main-container {
width: 100vw;
/* min height should fill the viewport then to make all element in view port,
reduce other elements height from this min height including every pixel like borders or margin etc. */
min-height: calc(100vh - 300px);
/* or you can try this way if it's suitable for you */
/* min-height: 100vh; */
display: flex;
justify-content: center;
align-items: center;
background: lightblue;
}
.footer {
width: 100vw;
height: 250px;
display: flex;
justify-content: center;
align-items: center;
background: lightseagreen;
overflow: auto;
/* padding: 0px 15px 10px 15px; */
/* margin-bottom: 0px !important; */
z-index: 11;
/* border: 1px solid red; */
}
<header class="header">header</header>
<div class="main-container">main container</div>
<div class="footer">
<div class="card card-style m-0">
<div class="card mx-0" data-card-height="120" style="height: 120px;">
<div class="card-center" style="z-index: 9">
Call
Email
</div>
<div class="card-center ms-3 ps-1">
<h1 class="font-20 show-business-opened working-message-above color-white mb-n1 disabled">We're Online!</h1>
<p class="show-business-opened working-message-under color-white opacity-90 mb-0 disabled">Call us Now! Let's have a
chat!</p>
<h1 class="font-20 show-business-closed working-message-above color-white mb-n1">We're Closed!</h1>
<p class="show-business-closed working-message-under color-white opacity-90 mb-0">We'll be back very soon!
</p>
</div>
<div class="card-overlay rounded-0 show-business-opened bg-highlight-dark disabled"></div>
<div class="card-overlay rounded-0 show-business-closed bg-red-dark"></div>
</div>
<div class="content p-3 pt-0 mt-0">
<p>If you have any queries or facing techinal problem, You can simply inform us, Our team will resolved your
issue as soon as they can.</p>
</div>
</div>

Content breaking when screen gets smaller bootstrap

This is not breaking as i want it to, i'd like for the image to be above the button but below the words when the screens size gets smaller, like phone size. Im new to bootstrap you i haven't tried much besides look in the docs but haven't found my solution. Could sonmeone please help me and point out where this issue is and why its occuring? Thanks!
<div class="row">
<div class="col-sm-6 text-center h-80 text-center">
<p style="display: flex;
padding-inline-start: 140px;
justify-content: center;
margin: 0;
align-items: center;
text-align: center;
font-family: Dancing Script, 'sans serif';
width: 80%;
height: 50%;
color: white;
font-size: 80px">So you want to travel the world</p>
<p style=" display: flex;
color: white;
padding-inline-start: 60px;
width: 100%;
height: 20%;
font-size: 30px;">I do not have millions in the bank but I am making it happen without stress or worry.</p>
<button style="border: none;
color: white;
font-size: 30px;
background-color: rgba(201,115,116,255);
border-radius: 5px;
height: 60px;
cursor: pointer;
width: 400px;">Download!</button>
</div>
<div class="col-md-6 text-center">
<img src="images/Digital Download! (1).png" id="img-fluid" class="img-fluid" style="height: 700px; width: 1300px;" alt="">
</div>
</div>
</div>
The image can never be above the button as they are in separate columns.
<div class="container">
<div class="row">
<div class="col-sm">
<p>So you want to travel the world</p>
<p>I do not have millions in the bank but I am making it happen without stress or worry.</p>
</div>
<div class="col-sm">
<img src="images/Digital Download! (1).png" id="img-fluid" class="img-fluid" style="height: 700px; width: 700px;" alt="">
</div>
<div class="col-sm-12">
<button> Download!</button>
</div>
</div>
</div>
This is basically what you want right? The download button is below the text and image except on a small screen where they all stack? I would also follow the advice given above to move all your CSS into an external file and use the bootstrap utility classes.
I would also avoid using characters other than A-z/0-9 in your filenames if possible.

Adding unusual background to transparent image

.half-half-image-text {
padding: 70px 0px;
}
.half-half-image-text h1 {
color: #800000;
}
.half-half-image-text .content {
height: 100%;
display: flex;
align-items: center;
padding: 35px 0px;
}
.half-half-image-text .content p {
font-size: 22px;
}
.half-half-image-text .img {
min-height: 320px;
height: 100%;
border-radius: 10px;
}
<div class="half-half-image-text">
<div class="container">
<div class="row">
<div class="col-12">
<h1>Our Mission</h1>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6">
<div class="content">
<p>At Fluid Automotive, our purpose is to make automotive parts easily accessible for everyone. Working with our partner brands, we aim to retail the highest quality parts, whilst maintaining a high level of customer satisfaction.</p>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="img" style="background: url('https://www.pngall.com/wp-content/uploads/2016/04/Happy-Person-Free-Download-PNG.png')no-repeat center;width:40%"></div>
</div>
</div>
</div>
</div>
Hi What am I trying to achieve is depicted on the screen attached. I am trying to apply to a transparent image a background like this(purple in this example) a shape can be similar.
What am I looking for is a source of knowledge (links ets) for that kind of problem and would very much appreciate the help.

CSS - aplying border-radius to a gif

I am trying to style the gif by giving it border-radius. However ther gif is smaller than the column itself so border-radius is aplied only to the right side of the gif. Could anyone help me out in applying it to the left side aswell? I dont want to change the background-size: contain!important; because then I will loose the proportions of the gif.
PS. Snippet breakes the row and the gif is in another row but it doesn't matter in this example.
.half-half-image-text {
padding: 70px 0px;
}
.half-half-image-text h1 {
color: #800000;
}
.half-half-image-text .content {
height: 100%;
display: flex;
align-items: center;
padding: 35px 0px;
}
.half-half-image-text .content p {
font-size: 22px;
}
.half-half-image-text .img {
min-height: 320px;
height: 100%;
border-radius: 10px;
}
<!-- begin snippet: js hide: false console: true babel: false -->
<div class="half-half-image-text">
<div class="container" >
<div class="row">
<div class="col-7 col-lg-7" style="padding-right:0">
<div class="content">
<p>At Fluid Automotive, our purpose is to make automotive parts easily accessible for everyone. Working with our partner brands, we aim to retail the highest quality parts, whilst maintaining a high level of customer satisfaction.</p>
</div>
</div>
<div class="col-5 col-lg-5" style="padding-right:0">
<a href="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/240px-Rotating_earth_%28large%29.gif" data-gallery="portfolioGallery" class="portfolio-lightbox">
<div class="img customzoom s2" style="background-size: contain!important;box-shadow: none;
background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/240px-Rotating_earth_%28large%29.gif')no-repeat center right;background-size:cover;" alt="Plan rozwoju" title="Plan rozwoju"></div>
</a>
</div>
</div>
</div>
</div>
You could add this style to portfolio-lightbox :
width: 240px;
display: block;
and change min-height:320px; to min-height:240px will solve your problem. Like below :
half-half-image-text {
padding: 70px 0px;
}
.half-half-image-text h1 {
color: #800000;
}
.half-half-image-text .content {
height: 100%;
display: flex;
align-items: center;
padding: 35px 0px;
}
.half-half-image-text .content p {
font-size: 22px;
}
.half-half-image-text .img {
min-height: 240px;
height: 100%;
border-radius: 10px;
}
.portfolio-lightbox {
width: 240px;
display: block;
}
<div class="half-half-image-text">
<div class="container" >
<div class="row">
<div class="col-7 col-lg-7" style="padding-right:0">
<div class="content">
<p>At Fluid Automotive, our purpose is to make automotive parts easily accessible for everyone. Working with our partner brands, we aim to retail the highest quality parts, whilst maintaining a high level of customer satisfaction.</p>
</div>
</div>
<div class="col-5 col-lg-5" style="padding-right:0">
<a href="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/240px-Rotating_earth_%28large%29.gif" data-gallery="portfolioGallery" class="portfolio-lightbox">
<div class="img customzoom s2" style="background-size: contain!important;box-shadow: none;
background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/240px-Rotating_earth_%28large%29.gif')no-repeat center right;background-size:cover;" alt="Plan rozwoju" title="Plan rozwoju"></div>
</a>
</div>
</div>
</div>
</div>
Simply use an image tag.
.imgradius {
border-radius: 10px
}
<img class="imgradius" src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/240px-Rotating_earth_%28large%29.gif"></img>