HTML/CSS slider not displaying correctly on mobile - html

I have a slider in the form of a figure that takes 200% width of the body, inside this figure I have set up 2 images slider one next to another with flexbox each taking 100% width of the body I have set the body to be on overflow-x: hidden; so that only 1 of the 2 images would show at a time. The slider is activated through radio links and a simple transform: translate(-50%);
This works perfectly on PC browsers but unfortunately not on mobile:
as shown in this screenshot here
here's the link to the site containing he slider:
https://jzsgpbizbig5vvch0nnmdg-on.drv.tw/Openclassroom/webagency/Webagency.html
here's the html part of the slider
<!--Slider starts here-->
<section>
<input type="radio" id="i2" name="images" />
<input type="radio" id="i1" name="images" />
<figure id="slider">
<div class="controls">
<div class="left-control">
<label class="prev" for="i2">
<i class="fas fa-angle-left"></i>
</label>
</div><!--left control-->
<div class="right-control">
<label class="next" for="i1">
<i class="fas fa-angle-right"></i>
</label>
</div><!--right control-->
</div><!--controls-->
<div id="slide1">
<img src="images/slider/bg1.jpg">
<div class="text">
<h1><span>WEBAGENCY</span>: L'AGENCE DE TOUS<br>VOS PROJECTS!</h1>
<h3>Vous avez un projet web? La WebAgency vous aide à le réaliser!</h3>
<h5>Plus d'infos</h5>
</div><!--text-->
</div><!--slider-->
<div id="slide2">
<img src="images/slider/bg2.jpg">
<div class="text2">
<h1><span>WEBAGENCY</span>: L'AGENCE DE TOUS<br>VOS PROJECTS!</h1>
<h3>Vous avez un projet web? La WebAgency vous aide à le réaliser!</h3>
<h5>Plus d'infos</h5>
</div><!--text-->
</div><!--slider2-->
</figure>
</section>
<!--End of slider section-->
And here's the CSS
body
{
font-family: 'Roboto', Arial, sans-serif;
display: flex;
flex-direction: column;
font-size: 100%;
width: 100%;
overflow-x: hidden;
/* Slider */
figure
{
display: flex;
position: sticky;
top: 90px;
left: 0px;
width: 200%;
transition-duration: 1s;
}
#slide1 , #slide2
{
width: 100%;
height: 100%;
}
#slide1 img , #slide2 img
{
width: 100%;
}
.text
{
position: absolute;
height: 40%;
width: 40%;
left: 5%;
top: 20%;
}
.text2
{
position: absolute;
height: 40%;
width: 40%;
left: 55%;
top: 20%;
}
#slide1 h1 , #slide2 h1
{
left: 150px;
top: 150px;
color: white;
font-size: 2.4vw;
}
#slide1 h1 span , #slide2 h1 span
{
color: #30ABB1;
}
#slide1 h3 , #slide2 h3
{
padding-top: 5px;
font-family: arial;
color: white;
font-size: 1vw;
}
#slide1 h5 , #slide2 h5
{
display: inline-block;
color: white;
background-color: #30ABB1;
padding: 10px;
margin-top: 10px;
border-radius: 3px;
font-size: 1.5vw;
cursor: pointer;
}
#i1 , #i2
{
display: none;
}
#i1:checked ~ figure
{
transform: translate(-50%);
}
#i2:checked ~ figure
{
transform: none;
}
.left-control
{
display: inline-block;
position: absolute;
left: 50%;
top: 50%;
height: 60px;
width: 30px;
border-radius: 0 60px 60px 0;
background-color: rgba(45 ,45 ,45 , 0.7);
z-index: 90;
}
.left-control i
{
position: absolute;
color: white;
font-size: 1.3em;
font-weight: bold;
top: 30%;
margin-left: 5px;
cursor: pointer;
}
.left-control:hover
{
height: 60px;
width: 40px;
transition-duration: 250ms;
overflow: hidden;
padding-left: 10px;
}
.right-control
{
position: absolute;
right: 50%;
top: 50%;
height: 60px;
width: 35px;
border-radius: 60px 0 0 60px;
background-color: rgba(45 ,45 ,45 , 0.7);
z-index: 80;
}
.right-control i
{
position: absolute;
color: white;
font-size: 1.3em;
font-weight: bold;
top: 30%;
margin-left: 15px;
cursor: pointer;
}
.right-control:hover
{
height: 60px;
width: 40px;
transition-duration: 250ms;
overflow: hidden;
padding-right: 10px;
}
/* Slider ends here */
So my question is: How can I make this design work the same on mobile?
Thanks in advance for your time and sorry for the long post. XD

Only Change
.figure{ position: absolute;}
To
.figure{ position: sticky; }
And
#services{ margin-top: 500px; }
To
#services{ margin-top: 0px; }
also remove this
.section { overflow-y: hidden;}

Related

Alternative for line-height to vertically center flexbox item text? [duplicate]

This question already has answers here:
How can I vertically align elements in a div?
(28 answers)
How can I center text (horizontally and vertically) inside a div block?
(27 answers)
Flexbox: center horizontally and vertically
(14 answers)
css single or multiple line vertical align
(8 answers)
Closed 10 months ago.
I've included the JSFiddle below.You have to shrink the size to about 670px to see the issue. What I am trying to fix are the flexbox items at the bottom of the page where the footer says "call xxx-xxx-xxxx". It is hard to see because the background image isn't loaded on the JSFiddle, but when the screen shrinks, the text "to schedule a consultation" pushes into the white background. Initially I used the line height trick, making it equal to the container height, so it vertically centers my first line of text but pushes the second line 100px down off the footer. What I am going for is to make both lines of text center vertically together instead of 100px apart.
https://jsfiddle.net/4m7pysqb/
HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<title>DLGTreecare - Home</title>
<link rel="icon" href="images/favicon-16x16.png">
<link rel="Stylesheet" href="DLGtreecare.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome#1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght#400;500&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="dlg.js"></script>
</head>
<body>
<div class="header">
<div class="heroimagecontainer">
<img class="heroimage" src="images/heroimage.jpg">
</div>
<div class="redbar">
</div>
<div class="orangebar">
</div>
</div>
<div class="wrapper">
<div class="logowrapperdiv">
<div class="logoarea"> <p class="dlg">DLG Tree Care </p> <img class="logo" src="images/logotransparent.png"> </div>
<p class="undertree">Professional Tree Services</p>
</div>
<!-- https://drive.google.com/file/d/1YcJmJO-7mKo1er338P4AQ9Kn6HohaJsy/preview
https://drive.google.com/uc?export=view&id=1YcJmJO-7mKo1er338P4AQ9Kn6HohaJsy
-->
<div class= maincontent>
<p class="intro">PROVIDING THE "518" WITH ALL YOUR TREE CARE NEEDS!</p>
<iframe class="videointro" src="https://drive.google.com/file/d/1YcJmJO-7mKo1er338P4AQ9Kn6HohaJsy/preview" allow="autoplay"></iframe>
<div> </div>
<div class="phonebar"> Call 518-407-9500 for a free estimate!</div>
<div class="messagebuttontext"> Or message us on
<a class="messagebutton" href="https://m.me/DLGTreeCare">
<span style=color:orange>Facebook!</span>
<i class="fa fa-facebook-messenger fa-1x" aria-hidden="true"></i>
</a></div>
<div class="clearfix"></div>
</div>
<h2>Services</h2>
<h6>(Click images to see "before and after")</h6>
<div class="services">
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Tree Removal</p><p class="servicedescription ">Removing dead or unwanted trees is sometimes a must, using the proper skills this can be done safely</p>
<img class="toggleon" src = "images/beforeafter/treeremovalflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Tree Trimming</p><p class="servicedescription ">Having your trees trimmed properly is important and can help maintain healthy future growth</p>
<img class="toggleon" src = "images/beforeafter/treetrimmingflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Stump Grinding</p><p class="servicedescription">By grinding the stump of the tree we are able to totally remove the stump in order to grow grass or replant something new</p>
<img class="toggleon" src = "images/beforeafter/stumpgrindingflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Hedge Trimming</p><p class="servicedescription ">From big to small, we have the tools and expertise for all your needs</p>
<img class="toggleon" src = "images/beforeafter/hedgetrimmingflip300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Fruit Tree Pruning</p><p class="servicedescription">From big to small, we have the tools and expertise for all your needs</p>
<img class="toggleon" src = "images/beforeafter/fruittreeflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Wood & Brush Removal</p><p class="servicedescription">From big to small, we have the tools and expertise for all your needs</p>
<img class="toggleon" src = "images/beforeafter/treeremovalflip300x400.png">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Lot Clearing</p><p class="servicedescription">We can turn any wooded lot into an open usable space for the building of Homes, Businesses, etc.</p>
<img class="toggleon" src = "images/beforeafter/lotclearingflip300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Cabling & Bracing</p><p class="servicedescription">Large branches and/or weak crotches sometimes can split under their own weight, cabling can keep this from happening without damaging the tree</p>
<img class="toggleon" src = "images/beforeafter/cablingbracingflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Storm Damage</p><p class="servicedescription">We're available 24/7 for any tree related emergencies</p>
<img class="toggleon" src = "images/beforeafter/stormdamageflip_300x400.jpg">
</div>
</div>
<h2>See more of our work</h2>
<div class="gallery">
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized95FB95IMG951628801998990.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/FB95IMG951628860144118.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/FB_IMG_1628860108712.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized_20210319_094919.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized_20210325_104241.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized_20210322_131140.jpg"></div>
</div>
<div class="flex-container">
<div class="flex-item">Serving the 518 area</div><div class="flex-item">Call 518-407-9500 to schedule a consultation.</div>
</div>
</div>
</body>
</html>
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root{
/* base red */
--base-red: 10;
/* base yellow */
--base-yellow: 60;
/* base green */
--base-green: 99;
/*base blue*/
--base-blue: 200;
/* colors */
--brown-normal: hsla(17, 42%, 41%, 100%);
--brown-normal: hsla(17, 42%, 41%, 100%);
--red-light: hsla(var(--base-red), 100%, 75%, 100%);
--red-normal: hsla(var(--base-red), 100%, 45%, 100%);
--red-darker: hsla(var(--base-red), 100%, 35%, 100%);
--yellow-light: hsla(var(--base-yellow), 50%, 75%, 100%);
--yellow-normal: hsla(var(--base-yellow), 50%, 50%, 100%);
--yellow-darker: hsla(var(--base-yellow), 50%, 35%, 100%);
--green-light: hsla(var(--base-green), 50%, 75%, 100%);
--green-normal: hsla(var(--base-green), 50%, 50%, 100%);
--green-darker: hsla(var(--base-green), 50%, 35%, 100%);
--blue-light: hsla(var(--base-blue), 50%, 75%, 100%);
--blue-normal: hsla(var(--base-blue), 50%, 50%, 100%);
--blue-darker: hsla(var(--base-blue), 50%, 35%, 100%);
}
#font-face {
font-family: TreeHuggerMedium-lEqZ;
src: url(TreeHuggerMedium-lEqZ.ttf);
}
body {
min-height: 100vh;
max-height: 195.625rem;
background-image: url("images/stump.jpg");
background-color: white;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
margin: auto;
}
div.header {
min-width: 320px;
text-align: center;
height: 300px;
}
div.heroimagecontainer {
height: 210px;
width: inherit;
}
img.heroimage {
height: 100%;
width: 100%;
object-fit: cover;
}
div.redbar {
width: inherit;
background-color: var(--red-normal);
height: 20px;
}
div.orangebar {
width: inherit;
background-color: orange;
height: 70px;
}
div.logowrapperdiv {
min-width: 320px;
max-width: 1000px;
position: relative;
height: auto;
margin: auto;
top: -50px;
}
div.logoarea {
border-bottom-style: solid;
border-color: white;
border-width: 5px;
min-width: 320px;
max-width: 525px;
margin: auto;
height: 92px;
color: white;
position: relative;
}
img.logo {
max-width: 36.5%;
top: -188px;
display: block;
left: 17%;
position: relative;
overflow: visible;
z-index: 105;
object-fit: contain;
}
p.dlg {
font-family: Roboto Slab;
position: relative;
max-width: 525px;
min-width: 320px;
font-size: 3.9em;
font-weight: 500;
text-align: center;
white-space: pre;
top: 20px;
}
.undertree {
font-family: Roboto Slab;
font-weight: 500;
max-width: 525px;
color: white;
text-align: center;
height: 50px;
margin: auto;
margin-top: 0;
padding-bottom: 40px;
letter-spacing: 0.10em;
font-size: 2.16em;
position: relative;
top: 0px;
}
.wrapper {
margin: auto;
min-width: 320px;
max-width: 1000px;
background-image: linear-gradient(var(--brown-normal), orange);
padding-top: 50px;
border-radius: 0px 0px 5px 5px;
}
.maincontent {
min-width: 320px;
text-align: center;
height: auto;
color: white;
position: relative;
margin-bottom: 25px;
padding: 15px;
}
.intro {
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.7em;
color: white;
text-align: center;
padding-bottom: 25px;
min-width: 300px;
max-width: 1000px;
}
.videointro {
min-width: 300px;
min-height: 225px;
position: relative;
display: block;
border-style: solid;
border-width: 2px;
border-color: white;
border-radius: 5px;
margin: auto;
}
.phonebar {
font-family: Roboto Slab;
font-weight: 400;
text-align: center;
position: relative;
float: left;
min-width: 295px;
max-width: 550px;
margin: 25px 0px 0px 20px;
font-size: 1.7em;
border: 1px solid white;
padding: 5px;
border-radius: 15px;
}
.phonebar a {
color: orange;
text-decoration: none;
}
.messagebutton {
display: inline-block;
text-align: center;
color: orange;
position: relative;
margin: auto;
text-decoration: none;
}
.messagebuttontext {
min-width: 295px;
max-width: 550px;
color: white;
position: relative;
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.7em;
display: block;
float: right;
border: 1px solid white;
border-radius: 15px;
margin: 25px 20px 0px 0px;
padding: 5px;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
/*code for photo galley */
h2 {
font-family: Roboto Slab;
font-weight: 400;
text-align: center;
font-size: 5em;
color: white;
margin: 50px auto;
position: relative;
}
h6 {
font-size: 2em;
font-family: Roboto Slab;
font-weight: 400;
text-align: center;
color: white;
position: relative;
margin: 10px auto;
}
button {
appearance: button;
background-color: white;
color: red;
cursor: pointer;
font-weight: 500;
border-color: white;
z-index: 101;
top: 30px;
left: 0px;
position: relative;
border-radius: 5px;
height: 25px;
width: 25px;
margin: 0 auto;
border-width: 1px;
transition: transform .3s linear;
}
.buttonrotate {
transform: rotate(90deg);
}
.services {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
width: auto;
height: auto;
margin: auto;
}
.servicenode {
position: relative;
width: 300px;
margin: auto;
margin-bottom: 25px;
}
.servicenode img {
display: block;
margin-left: auto;
margin-right: auto;
width: 300px;
height: 200px;
object-fit: none;
border: 1px solid red;
border-radius: 8px;
transition: 0.1s object-position ease;
position: relative;
}
.servicetitle {
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.4em;
vertical-align:top;
display:inline-block;
color: white;
width: 100%;
position: relative;
text-align: center;
margin-bottom: 10px;
}
.servicedescription {
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.2em;
color: white;
z-index: 100;
transition-property: opacity, border-radius;
transition-duration: .4s;
transition-timing-function: linear;
opacity: 0;
margin: auto;
width: 298px;
position: absolute;
display: block;
background: rgba(0,0,0, 0.6);
left: 0;
right: 0;
border-radius: 8px 8px 8px 8px;
text-align: center;
user-select: none; /* supported by Chrome and Opera */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
pointer-events: none;
}
.servicedescriptionshow {
position: absolute;
display: block;
width: 298px;
left: 0;
right: 0;
border-radius: 8px 8px 0px 0px;
text-align: center;
opacity: 1;
}
.toggleon {
object-position: top;
cursor: pointer;
}
.toggleoff {
object-position: bottom;
cursor: pointer;
}
/* Gallery stuff */
.gallery {
display: grid;
grid-template-columns: repeat(2, minmax(320px, auto));
width: auto;
height: auto;
margin: auto;
}
.gallerynode {
color: white;
text-align: center;
position: relative;
margin: auto;
border-width: 1px;
border-style: solid;
border-color: white;
height: 490px;
}
.galleryimg {
object-fit: cover;
width: 490px;
height: 490px;
}
/* footer stuff */
.footer {
height: 5vh;
width: 100%;
background-color: white;
position: relative;
margin-top: 100px;
bottom: 0;
border-style: solid;
border-color: red;
border-width: 3px;
border-radius: 0px 0px 5px 5px;
}
.flex-container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin-top: 10px;
}
.flex-item {
-ms-flex-preferred-size: 33%;
flex-basis: 50%;
background-color: orange;
padding: 5px;
height: 100px;
color: white;
font-weight: bold;
font-size: 1.5em;
text-align: center;
border: 1px solid #333;
box-sizing: border-box;
line-height: 100px;
}
.flex-item a {
color: white;
}
/* media queries */
#media screen and (max-width: 1000px) {
div.maincontent {
height: auto;
}
.messagebuttontext {
float: none;
margin: 20px auto;
}
.phonebar {
float: none;
margin: 20px auto;
}
.gallery {
grid-template-columns: repeat(1, minmax(320px, auto));
}
.flex-item {
font-size: 1em;
}
}
#media screen and (max-width: 545px) {
div.logoarea {
width: 420px;
}
p.dlg {
font-size: 3em;
top: 35px;
}
img.logo {
left: 17%;
top: -130px;
}
.undertree {
font-size: 1.6em;
}
}
#media screen and (max-width: 500px) {
.gallerynode {
height: 320px;
}
.galleryimg {
object-fit: cover;
width: 320px;
height: 320px;
margin: auto;
}
}
#media screen and (max-width: 485px) {
div.logoarea {
width: 320px;
}
img.logo {
top: -86px;
left: 16%
}
p.dlg {
font-size: 2.6em;
top: 42px;
}
}
#media screen and (max-width: 354px) {
p.dlg {
font-size: 2.6em;
top: 42px;
}
.undertree {
font-size: 1.39em;
}
img.logo {
top: -86px;
}
.maincontent {
padding: 8px;
}
}
JS
$(document).ready(function(){
$(".servicenode > img").click(function(){
$(this).toggleClass('toggleon toggleoff');
});
$(".mybutton").click(function() {
$(this)
.siblings(".servicedescription")
.toggleClass('servicedescriptionshow');
$(this).toggleClass('buttonrotate');
});
});

Trouble Connecting images and secondary pages to GitHub index.html

I am a student and this is my first time using GitHub Pages. I am looking for help in linking my secondary webpages and images that are in folders in my repository.
I pushed HTML and CSS pages to GitHub and made a GitHub Pages. None of my images are showing up and links are not working as the addresses are no longer in my computer, but on GitHub. I cannot figure out how to get the proper address for images.
I started making a website for a school project, but before we go any further we now have to host the webpage onto GitHub Pages. When I run the html pages through VSCode, every page works flawlessly with the images and links. Now that I am using GitHub Pages, none of my images or links are working/ showing up. I understand I have to change the url of each one individually in my code to the new address through GitHub Pages, but everything I have researched from other questions is not working for me.
My "index.html" and its css "landingpage.css" are located on the main branch.
The images are under a folder on the main branch called "img".
// The background picture I am having the first issue with is labeled "frame- 2#1x.png" under the "img" folder.
The secondary pages are under a folder on the main branch called "link-pages".
I have not started trying to link the secondary pages as my first goal is to get the "home page" to have it's desired look again, but the images will not show up after trying multiple different addresses.
I have tried copying the path after clicking on the image under the "img" folder:
/img/frame-2#1x.png or img/frame-2#1x.png
As well as copying the permalink address which is:
"https://github.com/vjsarlo/bioSite/blob/c0ef6aef3fb0f37ff63152338909086ba94bb486/img/frame-2#1x.png".
I have read that I may need to use a "raw absolutely link" answered here in the first comment (not given answer upvoted):
Images in github pages and relative links
But I cannot find how to get the "raw absolutely link".
Here is my code for the html and the corresponding css. CSS is line 93-103/ HTML is line 1-17:
HTML Section Where The Background "frame" is located:
#import url("https://fonts.googleapis.com/css?family=Abel:400|Adamina:400|Abhaya+Libre:400|Advent+Pro:500");
/* !! Figure Out Slider If Wanted !! Image Imported For Reference Of Placing and Look !! */
/* Style Guide Variables */
:root {
--black: rgba(0, 0, 0, 1);
--bg: rgba(11, 29, 38, 1);
--accent: rgba(251, 215, 132, 1);
--white: rgba(255, 255, 255, 1);
--font-size-m2: 18px;
--font-size-l2: 24px;
--font-size-xl2: 36px;
--font-size-xxl: 48px;
--font-size-xxxl: 64px;
--font-size-xxxxl: 96px;
--font-size-xxxxxl: 240px;
--font-family-abel: "Abel";
--font-family-abhaya_libre: "Abhaya Libre";
--font-family-adamina: "Adamina";
--font-family-advent_pro: "Advent Pro";
}
/* Preset Classes */
.abel-normal-white-240px {
color: var(--white);
font-family: var(--font-family-abel);
font-size: var(--font-size-xxxxxl);
font-weight: 400;
font-style: normal;
}
.abhayalibre-normal-white-64px {
color: var(--white);
font-family: var(--font-family-abhaya_libre);
font-size: var(--font-size-xxxl);
font-weight: 400;
font-style: normal;
}
.adamina-normal-grandis-48px {
color: var(--accent);
font-family: var(--font-family-adamina);
font-size: var(--font-size-xxl);
font-weight: 400;
font-style: normal;
}
.adamina-normal-grandis-18px {
color: var(--accent);
font-family: var(--font-family-adamina);
font-size: var(--font-size-m2);
font-weight: 400;
font-style: normal;
}
.abel-normal-white-18px {
color: var(--white);
font-family: var(--font-family-abel);
font-size: var(--font-size-m2);
font-weight: 400;
font-style: normal;
}
.abel-normal-grandis-18px {
color: var(--accent);
font-family: var(--font-family-abel);
font-size: var(--font-size-m2);
font-weight: 400;
font-style: normal;
}
.adventpro-medium-white-18px {
color: var(--white);
font-family: var(--font-family-advent_pro);
font-size: var(--font-size-m2);
font-weight: 500;
font-style: normal;
}
/* HEADER */
* {
box-sizing: border-box;
}
.hidden,
.hidden * {
pointer-events: none;
visibility: hidden;
}
.overlap-group-1 {
height: 4232px;
position: relative;
width: 1940px;
}
.frame {
background-image: url(https://github.com/vjsarlo/bioSite/blob/c0ef6aef3fb0f37ff63152338909086ba94bb486/img/frame-2#1x.png);
background-position: 50% 50%;
background-size: cover;
height: 1529px;
left: 0;
opacity: 0.5;
position: absolute;
top: 0;
width: 1920px;
}
.slider {
height: 440px;
left: 1663px;
position: absolute;
top: 226px;
width: 277px;
}
.content-top {
align-items: flex-start;
display: flex;
flex-direction: column;
height: 197px;
left: 500px;
position: absolute;
top: 287px;
width: 950px;
}
.group-1 {
align-items: center;
display: flex;
height: 65px;
min-width: 333px;
padding: 0 0px;
}
.rectangle {
background-color: var(--accent);
height: 4px;
margin-top: 3px;
width: 120px;
}
.meet {
color: var(--accent);
font-family: var(--font-family-adamina);
font-size: var(--font-size-xxl);
font-weight: 400;
letter-spacing: 6px;
margin-left: 41px;
min-height: 65px;
min-width: 170px;
}
.kaley-mc-carthy {
color: var(--white);
font-family: var(--font-family-abhaya_libre);
font-size: var(--font-size-xxxxl);
font-weight: 400;
letter-spacing: 0;
line-height: 100px;
margin-top: 32px;
min-height: 100px;
text-align: center;
white-space: nowrap;
width: 950px;
}
.header {
align-items: flex-start;
display: flex;
height: 52px;
left: 80px;
position: absolute;
top: 64px;
width: 1760px;
}
.logo {
color: var(--white);
font-family: var(--font-family-abhaya_libre);
font-size: var(--font-size-xl2);
font-weight: 400;
letter-spacing: 0.36px;
min-height: 42px;
width: 253px;
text-underline-position: auto;
height: 37px;
width: 346px;
}
.about-me {
cursor: pointer;
transition: all 0.2s ease;
height: 23px;
letter-spacing: 0;
margin-left: 393px;
margin-top: 2px;
min-width: 64px;
}
.hobbies {
cursor: pointer;
transition: all 0.2s ease;
letter-spacing: 0;
margin-left: 66px;
margin-top: 2px;
min-height: 23px;
min-width: 55px;
}
.connect {
cursor: pointer;
transition: all 0.2s ease;
letter-spacing: 0;
margin-left: 60px;
margin-top: 2px;
min-height: 23px;
}
.connect:hover,
.hobbies:hover,
.about-me:hover {
color: #fbd784;
}
/* CONTENT */
.content {
align-items: flex-start;
display: flex;
flex-direction: column;
height: 2772px;
left: 271px;
position: absolute;
top: 1460px;
width: 1465px;
}
.content-1 {
align-items: center;
display: flex;
margin-left: 1px;
min-width: 1463px;
}
.overlap-group-2 {
height: 579px;
margin-bottom: 72.58px;
position: relative;
width: 789px;
}
.equipment-01 {
left: 0;
letter-spacing: 0;
line-height: 240px;
opacity: 0.1;
position: absolute;
top: 0;
white-space: nowrap;
width: 248px;
}
.content-2 {
align-items: flex-start;
display: flex;
flex-direction: column;
height: 377px;
left: 157px;
position: absolute;
top: 202px;
width: 632px;
}
.tagline-01 {
align-items: center;
display: flex;
height: 25px;
min-width: 255px;
}
.line {
background-color: var(--accent);
height: 2px;
margin-bottom: 3px;
width: 72px;
}
.who-am-i {
letter-spacing: 6px;
margin-left: 24px;
min-height: 25px;
min-width: 157px;
}
.the-princess {
letter-spacing: 0;
margin-top: 27px;
min-height: 152px;
width: 555px;
}
.with-a-passion {
letter-spacing: 0;
line-height: 32px;
margin-top: 27px;
min-height: 96px;
width: 632px;
}
.more:hover {
transform: scale(1.1);
}
.more {
align-items: center;
cursor: pointer;
display: flex;
height: 23px;
margin-top: 27px;
min-width: 199px;
transition: all 1s ease-in-out;
}
.learn-about-me {
letter-spacing: 0;
min-height: 23px;
min-width: 105px;
}
.iconnavigationarrow_downward_24px {
height: 17px;
margin-bottom: 0;
margin-left: 9px;
width: 24px;
}
.image-1 {
height: 728px;
margin-left: 101px;
object-fit: cover;
width: 573px;
}
.content-3 {
align-items: center;
display: flex;
margin-left: 1px;
margin-top: 200px;
min-width: 1463px;
}
.image-2 {
height: 732px;
object-fit: cover;
width: 567px;
}
.overlap-group-3 {
height: 579px;
margin-bottom: 75.37px;
margin-left: 114px;
position: relative;
width: 775px;
}
.equipment-02 {
left: 0;
letter-spacing: 0;
line-height: 240px;
opacity: 0.1;
position: absolute;
top: 0;
white-space: nowrap;
width: 243px;
}
.content-4 {
align-items: flex-start;
display: flex;
flex-direction: column;
height: 377px;
left: 143px;
position: absolute;
top: 202px;
width: 632px;
}
.tagline-02 {
align-items: center;
display: flex;
height: 25px;
min-width: 276px;
}
.my-hobbies {
letter-spacing: 6px;
margin-left: 24px;
min-height: 25px;
min-width: 178px;
}
.gross-food {
letter-spacing: 0;
margin-top: 27px;
min-height: 152px;
width: 555px;
}
.cows-brain {
letter-spacing: 0;
line-height: 32px;
margin-top: 27px;
min-height: 96px;
width: 632px;
}
.more-1:hover {
transform: scale(1.1);
}
.more-1 {
align-items: center;
cursor: pointer;
display: flex;
height: 23px;
margin-top: 27px;
min-width: 199px;
transition: all 1s ease-in-out;
}
.discover-more {
letter-spacing: 0;
min-height: 23px;
min-width: 96px;
}
.iconnavigationarrow_downward_24px-2 {
height: 16px;
margin-left: 15px;
margin-top: 1px;
width: 24px;
}
.content-5 {
align-items: flex-start;
display: flex;
margin-top: 200px;
min-width: 1465px;
}
.equipment-2 {
letter-spacing: 0;
line-height: 240px;
margin-top: 48.13px;
min-height: 304px;
opacity: 0.1;
width: 249px;
}
.image-3 {
height: 912px;
margin-left: 643px;
object-fit: cover;
width: 574px;
}
.content-7 {
align-items: flex-start;
display: flex;
flex-direction: column;
height: 529px;
left: 419px;
position: absolute;
top: 3570px;
width: 632px;
}
.tagline-03 {
align-items: center;
display: flex;
height: 25px;
min-width: 413px;
}
.follow-my-journey {
letter-spacing: 6px;
margin-left: 24px;
min-height: 25px;
min-width: 315px;
}
.where-will-i-be {
letter-spacing: 0;
margin-top: 27px;
min-height: 304px;
width: 555px;
}
.my-journey-has-been {
letter-spacing: 0;
line-height: 32px;
margin-top: 27px;
min-height: 96px;
width: 632px;
}
.more-2:hover {
transform: scale(1.1);
}
.more-2 {
align-items: center;
cursor: pointer;
display: flex;
height: 23px;
margin-top: 27px;
min-width: 199px;
transition: all 1s ease-in-out;
}
.discover-more-1 {
letter-spacing: 0;
min-height: 23px;
min-width: 150px;
}
.iconnavigationarrow_downward_24px-3 {
height: 16px;
margin-left: 23px;
margin-top: 1px;
width: 24px;
}
/* FOOTER */
.footer {
align-items: flex-start;
align-self: center;
display: flex;
height: 190px;
margin-left: 9px;
margin-top: 57px;
min-width: 1529px;
}
.kaley-mccarthy {
align-items: flex-start;
background-color: var(--bg);
display: flex;
flex-direction: column;
height: 4672px;
overflow: hidden;
width: 1920px;
}
.flex-col {
align-items: flex-start;
display: flex;
flex-direction: column;
min-height: 190px;
width: 319px;
}
.kaley {
color: var(--white);
font-family: var(--font-family-abhaya_libre);
font-size: var(--font-size-xl2);
font-weight: 400;
letter-spacing: 0.36px;
min-height: 42px;
width: 253px;
}
.its-a-dangerous {
letter-spacing: 0;
line-height: 32px;
margin-top: 20px;
min-height: 128px;
width: 319px;
}
.links {
align-items: center;
align-self: center;
display: flex;
flex-direction: column;
margin-bottom: 3px;
margin-left: 984px;
min-height: 181px;
width: 232px;
}
.connect-1 {
cursor: pointer;
transition: all 0.2s ease;
letter-spacing: 0;
line-height: 32px;
margin-bottom: 0;
margin-right: 40.65px;
margin-top: 16px;
min-height: 32px;
white-space: nowrap;
width: 57px;
}
.about-her {
cursor: pointer;
transition: all 0.2s ease;
letter-spacing: 0;
line-height: 32px;
margin-bottom: 0;
margin-right: 23.8px;
margin-top: 21px;
min-height: 32px;
white-space: nowrap;
width: 74px;
}
.explore-kaley-mc-carthy {
color: var(--accent);
font-family: var(--font-family-abel);
font-size: var(--font-size-l2);
font-weight: 400;
letter-spacing: 0;
line-height: 32px;
margin-bottom: 0;
margin-right: 8px;
min-height: 32px;
white-space: nowrap;
width: 224px;
}
.her-hobbies {
cursor: pointer;
transition: all 0.2s ease;
letter-spacing: 0;
line-height: 32px;
margin-bottom: 0;
margin-right: 6.95px;
margin-top: 16px;
min-height: 32px;
white-space: nowrap;
width: 91px;
}
.valign-text-middle {
display: flex;
flex-direction: column;
justify-content: center;
}
.about-her:hover,
.her-hobbies:hover,
.connect-1:hover {
color: #fbd784;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="landingpage.css" />
</head>
<body>
<div class="kaley-mccarthy screen">
<div class="overlap-group-1">
<div class="frame"></div>
<img class="slider" src="/Users/vince/csd/bioSite/img/slider#2x.svg" />
<div class="content-top">
<div class="group-1">
<div class="rectangle"></div>
<div class="meet">MEET</div>
</div>
<h1 class="kaley-mc-carthy">Kaley McCarthy</h1>
</div>
<h2>
<div class="header">
<div class="logo">Kaley McCarthy</div>
<a href="/Users/vince/csd/bioSite/link-pages/aboutpage.html" target="_blank">
<div class="about-me valign-text-middle abel-normal-white-18px">About Me</div>
</a>
<a href="/Users/vince/csd/bioSite/link-pages/hobbiespage.html" target="_blank">
<div class="hobbies abel-normal-white-18px">Hobbies</div>
</a>
<a href="/Users/vince/csd/bioSite/link-pages/connectpage.html" target="_blank">
<div class="connect abel-normal-white-18px">Connect</div>
</a>
</div>
</h2>
<div class="content">
<div class="content-1">
<div class="overlap-group-2">
<div class="equipment-01 abel-normal-white-240px">01</div>
<div class="content-2">
<h3 class="tagline-01">
<div class="line"></div>
<div class="who-am-i adamina-normal-grandis-18px">WHO AM I?</div>
</h3>
<div class="the-princess abhayalibre-normal-white-64px">
The Princess Who Will Eat Frog Legs
</div>
<div class="with-a-passion abel-normal-white-18px">
''With a passion for learning and discovering the world, I hope to
one day call the globe my home. While creating magic for visitors
from around the world has been my career, I now want to see the
magic that comes from their homes.''
</div>
<a href="/Users/vince/csd/bioSite/link-pages/aboutpage.html" target="_blank">
<div class="more">
<div class="learn-about-me abel-normal-grandis-18px">
Learn About Me
</div>
<img class="iconnavigationarrow_downward_24px" src="/Users/vince/csd/bioSite/img/icon-navigation-arrow-downward-24px-2#2x.svg"/>
</div>
</a>
</div>
</div>
<img class="image-1" src="/Users/vince/csd/bioSite/img/01.png" />
</div>
<div class="content-3">
<img class="image-2" src="/Users/vince/csd/bioSite/img/02.png" />
<div class="overlap-group-3">
<div class="equipment-02 abel-normal-white-240px">02</div>
<div class="content-4">
<h4 class="tagline-02">
<div class="line"></div>
<div class="my-hobbies adamina-normal-grandis-18px">MY HOBBIES</div>
</h4>
<div class="gross-food abhayalibre-normal-white-64px">
Gross Food, Open Doors, And Sore Feet
</div>
<div class="cows-brain abel-normal-white-18px">
''Cow's brain from New York has a mousse-texture. Pig's brain in
China is serve raw and you should "just know" how long to cook it
in a hot pot. Both places I've worn out a pair of shoes
traversing. Where will I go next?''
</div>
<a href="/Users/vince/csd/bioSite/link-pages/hobbiespage.html" target="_blank">
<div class="more-1">
<div class="discover-more abel-normal-grandis-18px">
Discover More
</div>
<img class="iconnavigationarrow_downward_24px-2" src="/Users/vince/csd/bioSite/img/icon-navigation-arrow-downward-24px-2#2x.svg"/>
</div>
</a>
</div>
</div>
</div>
<div class="content-5">
<div class="equipment-2 abel-normal-white-240px">03</div>
<img class="image-3" src="/Users/vince/csd/bioSite/img/03.png" />
</div>
</div>
<div class="content-7">
<h5 class="tagline-03">
<div class="line"></div>
<div class="follow-my-journey adamina-normal-grandis-18px">
FOLLOW MY JOURNEY
</div>
</h5>
<div class="where-will-i-be abhayalibre-normal-white-64px">
Where Will I be Tomorrow? What Food Can I Try? What Will I See?
</div>
<div class="my-journey-has-been abel-normal-white-18px">
''My journey has been filled with nothing short of wonder and amazement. I
want to share everything I'll discover with who ever is interested in
what the world really has to offer. My game show is the world, so what's
behind curtain number 1?''
</div>
<a href="/Users/vince/csd/bioSite/link-pages/connectpage.html" target="_blank">
<div class="more-2">
<div class="discover-more-1 abel-normal-grandis-18px">
Open Curtain Number 1
</div>
<img class="iconnavigationarrow_downward_24px-3" src="/Users/vince/csd/bioSite/img/icon-navigation-arrow-downward-24px-2#2x.svg"/>
</div>
</a>
</div>
</div>
<div class="footer">
<div class="flex-col">
<div class="kaley">Kaley McCarthy</div>
<div class="its-a-dangerous abel-normal-white-18px">
''It's a dangerous business, Frodo, going out of your door. You step into
the Road, and if you don't keep your feet, there is no knowing where you
might be swept off too.''
</div>
</div>
<div class="links">
<div class="explore-kaley-mc-carthy">Explore Kaley McCarthy</div>
<a href="/Users/vince/csd/bioSite/link-pages/aboutpage.html" target="_blank">
<div class="about-her adventpro-medium-white-18px">About Her</div>
</a>
<a href="/Users/vince/csd/bioSite/link-pages/hobbiespage.html" target="_blank">
<div class="her-hobbies adventpro-medium-white-18px">Her Hobbies</div>
</a>
<a href="/Users/vince/csd/bioSite/link-pages/connectpage.html" target="_blank">
<div class="connect-1 adventpro-medium-white-18px">Connect</div>
</a>
</div>
</div>
</div>
</body>
</html>
The background image is not showing up at the top of the page as it did when running through VSCode. None of the images are showing up, however I am just looking for help so I can figure the rest out from this answer.
GitHub Repository:
https://github.com/vjsarlo/bioSite
What can I try to resolve this?
EDIT! Found A Solution. Maybe not the best?
I copied the url at the top of the page after clicking on the image itself inside the "img" folder in my repository. Before I was copying the path from the three "..." menu in GitHub. This worked and the background image is now showing up as it did when run from VSCode. I will post an update with this if it works for every image from here on out.

how to move the loader from left to right on hover?

I have a simple div in which there is an tag with 4 spans and a text
I am trying to create a loader on hovering my name.
The top line moves from left to right, after passing half way it get stucks in the middle and does not hides.
I am following a short youtube video:
https://www.youtube.com/watch?v=ex7jGbyFgpA&t=156s
The code is also attached. Please help
.name {
// font-size: 6rem;
margin: 0 0 3.5rem;
color: #2196f3;
position: relative;
display: inline-block;
padding: 15px 30px;
text-transform: uppercase;
letter-spacing: 0px;
text-decoration: none;
overflow: hidden;
transition: 0.2s;
font-size: 24px;
}
.hi {
margin: 0;
padding: 0;
display: flex;
align-items: center;
min-height: 100vh;
}
a span {
position: absolute;
display: block;
}
a span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #2196f3);
}
a:hover span:nth-child(1) {
left: 100px;
`enter code here` transition: 1s;
}
<div>
<a href='#' className='name'>
<span></span>
<span></span>
<span></span>
<span></span> Hafiz Arsam Rahmaan
</a>
</div>
Delete margin: 0 0 3.5rem;
Change left: -10000%; by left: -100%;
Check the demo below
(Don't forget to change class by className in your react component)
a.name {
position: relative;
display: inline-block;
padding: 15px 30px;
color: #6600FF;
letter-spacing: 4px;
text-decoration: none;
text-transform: uppercase;
font-size: 24px;
overflow: hidden;
transition: 0.2s;
}
a.name span {
position: absolute;
display: block;
}
a.name span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #2196f3)
}
a.name:hover span:nth-child(1) {
left: 100%;
transition: 1s;
}
<div>
<a href='#' class='name'>
<span></span>
<span></span>
<span></span>
<span></span>
Hafiz Arsam Rahmaan
</a>
</div>
Demo with react: Stackblitz

Problem with creating responsive overlapping Divs

The imagine above shows the browser in a smartphone size and thus the stretched space at the right caused by the overlapped divs in blue and red that I put below.
My main aim here was to get these divs to also shrink together with the screen but when I tried using flex properties, it disoriented whenever the page was reduced from desktop size.
Also, I tried percentages but placing the divs at a position after using percentage to size proved rather abortive.
The codes for the the image are found below.
Much help would be appreciated.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Acadera Renewed</title>
    <link rel="stylesheet" href="Acadera Imp.css">
</head>
<body>
    <div class="head_section">
        <div id="top_layout">
           <center>
           <ul>
            <li><a>Home</a></li>
            <li><a>Pages</a></li>
            <li> <a>Services</a></li>
            <li><a>Gallary</a></li>
            <li><a>Blog</a></li>
            <li><a>Contact</a></li>
            <li><a>About</a></li>
       
            <li><input type="text" placeholder="Search"></input></li>
        </ul>
    </center>
        </div>
        <h1>WELCOME TO ACADERA</h1>
        <p>We bring you the best there is to offer</p>
       <center><input type="button" class= "btn" value="GET STARTED" ></input></center>
        <div class="lower_section">
           <center>
           <ul class="two">
            <li id="lower"><a href="" class="lower">Akan</a></li>
            <li id="lower"><a href="" class="lower">Uwem</a></li>
            <li id="lower"><a href="" class="lower">Itoro</a></li>
        </ul>
        </center>
        </div>
    </div>
    
   <div class="contain">
       <div class="box red"> </div>
       <div class="box blue"></div>
    </div>
</body>
</html>
CSS
*{
    padding: 0px;
    margin: 0px;
    box-sizing: border-box;
}
 body{
    background-color: white;
    overflow: auto;
    background-attachment: scroll;
    min-width: 100%;
} 
.head_section{
    position: relative;
    z-index: 1;
    height: 32rem;
    width: 100%;
    background-color: black;
}
.head_section::before{
    content: "";
    z-index: -1;
    position: absolute;
    height: 32rem;
    width: 100%;
    color: black;
    background-image: url(image/pexels-birgit-held-1046125.jpg);
    background-position: center;
    background-attachment: fixed;
    background-size: cover;
    opacity: 0.6;
}
/* 
#top_layout{
    padding:5px 0 5px 0;
    text-align: center;
    justify-content: center;
} */
ul{
    margin: auto 0px;
    padding: 0px;
    list-style: none;
    display: table;
    width: 80%;
    text-align: center;
    /* background-color: red;  */
}
.two{
    margin: auto 0px;
    padding-bottom: 40px;
    list-style: none;
    display: table;
    width: 80%;
    text-align: center;
    top: 0px;
}
li{
    display: table-cell;
    position: relative;
    padding: 5px 10px 5px 12px;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.15em;
    display: inline-block;
    position: relative;
    /* background-color: blue; */
}
#lower{
    display: table-cell;
    padding: 10px 13px 40px 15px;
    /* background-color: blue; */
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 0.15em;
    position: relative ;
    /* padding-top: 50px; */
    position: 0;
    
   
}
a{
    padding: 5px 10px;
    color: white;
    text-decoration: none;
    top: 0px;
    /* background-color: grey; */
    margin-bottom: 20px;
}
a:hover{
    color: yellow;
    cursor: pointer;
}
a:after{
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    left: 50%;
    position: absolute;
    background: yellow;
    transition: width 0.3s ease 0s, left 0.3s ease 0s;
    width: 0px;
}
a:hover:after{
    width: 100%;
    left: 0;
}
#media screen and (max-height:300px){
    ul{
        margin-top: 40px;
    }
}
#lower:hover{
    color: yellow;
    cursor: pointer;
}
a .lower{
    margin-left: 60px;
   
   
}
.lower:after{
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    left: 50%;
    position: absolute;
    background: rgb(249, 253, 6);
    transition: width 0.3s ease 0s, left 0.3s ease 0s;
    width: 0px;
}
.lower:hover:after{
    width: 65%;
    left: 18%;
}
#media screen and (max-height:300px){
    .two{
        margin-top: 40px;
       
    }
}
h1{
    text-align: center;
    justify-content: center center;
    font-size: 50px;
    font-weight: 900;
    padding: 150px 5px 5px 5px;
    background:linear-gradient(to left, yellow, white);
    -webkit-background-clip:text;
    -webkit-text-fill-color: transparent;
}
p{
    background-color: white;
    text-align: center;
    -webkit-background-clip:text;
    -webkit-text-fill-color: transparent;
}
.btn{
    border: none;
    background-color: darkgoldenrod;
    color: white;
    border-radius: 25px;
    width: 110px;
    height: 30px;
    font-size: 12px;
    font-weight: 600; 
    justify-content: center center;
    margin: auto;
    outline: none;
    }
.btn:hover{
    background-color: yellow;
    color: rgb(15, 12, 12);
    cursor: pointer;
}
.lower_section{
    bottom: 0;
    z-index: 1;
    height: 100px;
    width: 100%;
    position: absolute;
    /* padding-top: 40px;
    padding-bottom: 40px; */
    
   /* justify-content: center;
   text-align: center center; */
   
}
.lower_section::before{
    content: "";
    z-index: -1;
    bottom: 0;
    height:120px;
   width: 100%;
   text-align: center;
   position: absolute;
   background-color: black;
   filter: brightness(0%);
   opacity:0.5;
   align-items: center;
    justify-content: center center;
}
/* .sub_lower{  
   margin-top: -15px;
    position: relative;
    width: 85%;
    height: 50px;
    color: yellow; 
     background-color: yellow;
    content: "";
    z-index: 1;
    text-align: center;
    justify-content: space-around;
} */
   .sub_lower a{
       display: inline-flex;
    position: relative;
     width: 20px;
     height: 20px;
    margin:2px;
    padding-right:100px;
    padding-left: 100px;
    color: white;
    background-color: grey;
    text-align: center;
    justify-content: center;
    justify-items: center center; 
} 
.contain{
   
    position: relative;
   max-width: 300px;
    /* height: fit-content; */
}
/* #media only screen and (min-device-width:400px)
{
    .box{
        max-width: 400px;
    }
} */
.box{
    display: flex;
    flex-shrink: initial;
   width: 300px;
    height: 300px;
    position: absolute;
}
.red{
    z-index: 1;
    background-color: red;
}
.blue{
   z-index: 2;   
    background-color: blue;
   top: 200px;
   left: 200px;
}
ADDED:
#media screen and (max-width:576px){
.contain{
max-width: unset;
}
.blue{
left: unset;
right: 0;
}
}
*{
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
body{
background-color: white;
background-attachment: scroll;
min-width: 100%;
}
.head_section{
position: relative;
z-index: 1;
height: 32rem;
width: 100%;
background-color: black;
}
.head_section::before{
content: "";
z-index: -1;
position: absolute;
height: 32rem;
width: 100%;
color: black;
background-image: url(image/pexels-birgit-held-1046125.jpg);
background-position: center;
background-attachment: fixed;
background-size: cover;
opacity: 0.6;
}
/*
#top_layout{
padding:5px 0 5px 0;
text-align: center;
justify-content: center;
} */
ul{
margin: auto 0px;
padding: 0px;
list-style: none;
display: table;
width: 80%;
text-align: center;
/* background-color: red; */
}
.two{
margin: auto 0px;
padding-bottom: 40px;
list-style: none;
display: table;
width: 80%;
text-align: center;
top: 0px;
}
li{
display: table-cell;
position: relative;
padding: 5px 10px 5px 12px;
text-transform: uppercase;
font-size: 13px;
letter-spacing: 0.15em;
display: inline-block;
position: relative;
/* background-color: blue; */
}
#lower{
display: table-cell;
padding: 10px 13px 40px 15px;
/* background-color: blue; */
text-transform: uppercase;
font-size: 15px;
letter-spacing: 0.15em;
position: relative ;
/* padding-top: 50px; */
position: 0;
}
a{
padding: 5px 10px;
color: white;
text-decoration: none;
top: 0px;
/* background-color: grey; */
margin-bottom: 20px;
}
a:hover{
color: yellow;
cursor: pointer;
}
a:after{
background: none repeat scroll 0 0 transparent;
bottom: 0;
content: "";
display: block;
height: 2px;
left: 50%;
position: absolute;
background: yellow;
transition: width 0.3s ease 0s, left 0.3s ease 0s;
width: 0px;
}
a:hover:after{
width: 100%;
left: 0;
}
#media screen and (max-height:300px){
ul{
margin-top: 40px;
}
}
#lower:hover{
color: yellow;
cursor: pointer;
}
a .lower{
margin-left: 60px;
}
.lower:after{
background: none repeat scroll 0 0 transparent;
bottom: 0;
content: "";
display: block;
height: 2px;
left: 50%;
position: absolute;
background: rgb(249, 253, 6);
transition: width 0.3s ease 0s, left 0.3s ease 0s;
width: 0px;
}
.lower:hover:after{
width: 65%;
left: 18%;
}
#media screen and (max-height:300px){
.two{
margin-top: 40px;
}
}
h1{
text-align: center;
justify-content: center center;
font-size: 50px;
font-weight: 900;
padding: 150px 5px 5px 5px;
background:linear-gradient(to left, yellow, white);
-webkit-background-clip:text;
-webkit-text-fill-color: transparent;
}
p{
background-color: white;
text-align: center;
-webkit-background-clip:text;
-webkit-text-fill-color: transparent;
}
.btn{
border: none;
background-color: darkgoldenrod;
color: white;
border-radius: 25px;
width: 110px;
height: 30px;
font-size: 12px;
font-weight: 600;
justify-content: center center;
margin: auto;
outline: none;
}
.btn:hover{
background-color: yellow;
color: rgb(15, 12, 12);
cursor: pointer;
}
.lower_section{
bottom: 0;
z-index: 1;
height: 100px;
width: 100%;
position: absolute;
/* padding-top: 40px;
padding-bottom: 40px; */
/* justify-content: center;
text-align: center center; */
}
.lower_section::before{
content: "";
z-index: -1;
bottom: 0;
height:120px;
width: 100%;
text-align: center;
position: absolute;
background-color: black;
filter: brightness(0%);
opacity:0.5;
align-items: center;
justify-content: center center;
}
/* .sub_lower{
margin-top: -15px;
position: relative;
width: 85%;
height: 50px;
color: yellow;
background-color: yellow;
content: "";
z-index: 1;
text-align: center;
justify-content: space-around;
} */
.sub_lower a{
display: inline-flex;
position: relative;
width: 20px;
height: 20px;
margin:2px;
padding-right:100px;
padding-left: 100px;
color: white;
background-color: grey;
text-align: center;
justify-content: center;
justify-items: center center;
}
.contain{
position: relative;
max-width: 300px;
/* height: fit-content; */
}
/* #media only screen and (min-device-width:400px)
{
.box{
max-width: 400px;
}
} */
.box{
display: flex;
flex-shrink: initial;
width: 300px;
height: 300px;
position: absolute;
}
.red{
z-index: 1;
background-color: red;
}
.blue{
z-index: 2;
background-color: blue;
top: 200px;
left: 200px;
}
#media screen and (max-width:576px){
.contain{
max-width: unset;
}
.blue{
left: unset;
right: 0;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Acadera Renewed</title>
<link rel="stylesheet" href="Acadera Imp.css">
</head>
<body>
<div class="head_section">
<div id="top_layout">
<center>
<ul>
<li><a>Home</a></li>
<li><a>Pages</a></li>
<li> <a>Services</a></li>
<li><a>Gallary</a></li>
<li><a>Blog</a></li>
<li><a>Contact</a></li>
<li><a>About</a></li>
<li><input type="text" placeholder="Search"></input></li>
</ul>
</center>
</div>
<h1>WELCOME TO ACADERA</h1>
<p>We bring you the best there is to offer</p>
<center><input type="button" class= "btn" value="GET STARTED" ></input></center>
<div class="lower_section">
<center>
<ul class="two">
<li id="lower">Akan</li>
<li id="lower">Uwem</li>
<li id="lower">Itoro</li>
</ul>
</center>
</div>
</div>
<div class="contain">
<div class="box red"> </div>
<div class="box blue"></div>
</div>
</body>
</html>

CSS transition effect upward height doesnt work

EDITED JSFIDDLE
The goal to display a transition upward height when the button is hovered, but this line of CSS .btn-position:hover ~ .bg-transit { height: 430px !important;} seems it expands downwards instead upward. Is there a way to transition UPWARD?
I dont want to add any JS to it.
HTML
<div class="career-wrapper-positions">
<div class="section-positions">
<div class="position-wrap">
<div class="position-box" id="video_interpreter">
<div class="employees"><img src="http://staging.svrs.com/assets/images/careers2018/position-lady1-1.png" alt="SVRS | Video Interpreter positions"></div>
<div class="position-tited-top-bg"></div>
<div class="position-box-info">
<div class="position-header"><h5 class="h5-careers18">CUSTOMER SERVICES</h5></div>
<div class="position-subheader" id="subheader1">positions</div>
<div class="position-p">Individually, passionate about the work. Collectively, the largest sales workforce in the world.</div>
<div class="btn-position">
<button onclick="location.href='#'" class="position-btn" id="btn1-position">Apply now</button></div>
<div class="bg-transit"></div>
</div>
</div>
</div>
</div>
CSS
.section-positions { margin: 0 auto; width: 100%; }
.position-header { text-align: center; }
.position-header p { margin-top: 0; }
.position-wrap { height: 525px; position: absolute; z-index: 10; width: 100%; text-align: center; display: flex; margin-top: 175px; }
.position-box { width: 209px !important; height: 330px; display: block; margin: 20px; background-color: #231f20; z-index: 2;}
.position-tited-top-bg { width: 209px !important; height: 20px; background-color: #231f20; -webkit-transform: skew(0deg, 2deg); transform: skew(0deg, 2deg); margin-top: -15px; position: relative;z-index: -2; }
.position-header { height: 15px;color:#ffbb11; font-size: 22px; font-family:'Source Sans Pro', sans-serif; font-weight: 400; }
.position-subheader { color: #ffbb11; margin-top: 10px; font-family:'Source Sans Pro', sans-serif;}
.position-p { color: #fff; padding: 0 10px 0 10px; font-family:'Source Sans Pro', sans-serif; font-size: 14px; margin-top: 10px; line-height: 20px; }
.position-btn { background-color: #ffbb11; width: 150px; height: 41px; border: none; border-radius: 8px; font-size: 1em; font-weight: 600; cursor: pointer; margin-top: 50px; }
.position-box-info { padding-top: 10px; }
/* this is the button to trigger a new height size transition of the background box */
.bg-transit { width: 209px !important; height: 338px; display: block; background-color: #ff0000; z-index: -1; position: relative; top: -280px; transition-property: height; transition-duration: 0.5s;}
.btn-position:hover ~ .bg-transit { height: 430px !important;}
.position-btn:hover { background-color: #231f20 !important; color: #ffbb11 !important; border: #9c7002 solid 1px; }
.employees { position: absolute; margin-top: -210px; width: 207px; margin-left: 5px; z-index: 9999;}
.position-btn:hover ~ .position-box-info selects all siblings .position-box-info that come after a .position-btn:hover. Since .position-box-info is actually the parent of the .position-btn element, nothing gets selected. In fact, you can't select a parent from a child, so you either have to add a class with javascript or change your HTML.
Also, you seem to miss a </div> closing tag.