Trouble Connecting images and secondary pages to GitHub index.html - 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.

Related

Why won't the scrolling container display in my popup window, but works outside of it?

I have a popup window (within the same page) which I'm attempting to put a container which scrolls horizontally into, yet it distorts the popup window and does not display anything other than the scrollbar. I'm honestly at a loss, can anyone help me here? I've looked around for solutions but I can't find anything that I can see applies to my problem.
If anyone can help, or point me in the right direction, I'd be really grateful. The scrollbar works perfectly fine when isolated, but inside the window shows like this:
Standalone:
My HTML (popup window with scrollbar inside)
<div id="formula-popup" class="popup-window">
<div>
<a onclick="closeFormulaWindow()" title="Close" class="close">X</a>
<span id="ftitle" class="title1"></span>
<form method="post" id="formulaform" name="edit">
<span>Current Formula</span>
<p id="current-formula" class="formula">Existing formula</p>
<input id="id-passer" type="hidden" name="formula-id" value="">
<!--sort out horizontal scrollbar from bookmarks here later-->
<input onclick="refreshWindow()" name="edit-formula" type="submit" value="Confirm">
</form>
<div class="h-scrollbar">
<section class="h-scrollbar-container">
<div class="outer-wrapper">
<div class="inner-wrapper">
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
</div>
</div>
<div class="pseudo-track"></div>
</section>
</div>
</div>
My CSS:
.scrollbar-container {
display: flex;
flex-direction: row;
}
.h-scrollbar {
display: flex;
max-width: 30vw;
padding: 0px 10px;
height: 20vh;
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}
.h-scrollbar-container {
width: 100%;
}
.outer-wrapper {
max-width: 100vw;
overflow-x: scroll;
position: relative;
scrollbar-color: #d5ac68 #f1db9d;
scrollbar-width: thin;
-ms-overflow-style: none;
}
.pseudo-track {
background-color: #f1db9d;
height: 2px;
width: 100%;
position: relative;
top: -3px;
z-index: -10;
}
.outer-wrapper::-webkit-scrollbar {
height: 5px;
}
.outer-wrapper::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 0px rgba(0, 0, 0, 0);
}
.outer-wrapper::-webkit-scrollbar-thumb {
height: 5px;
background-color: #d5ac68;
}
.outer-wrapper::-webkit-scrollbar-thumb:hover {
background-color: #f1db9d;
}
.outer-wrapper::-webkit-scrollbar:vertical {
display: none;
}
.inner-wrapper {
display: flex;
padding-bottom: 10px;
}
.pseudo-item {
height: 30px;
width: 80px;
margin-right: 15px;
flex-shrink: 0;
background-color: gray;
}
.pseudo-item:nth-of-type(2n) {
background-color: lightgray;
}
.popup-window {
position: fixed;
font-family: Arial, sans-serif;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
z-index: 9999;
display: none;
}
.popup-window div {
width: 40vw;
height: 30vw;
position: relative;
margin: 10% auto 30%;
border-radius: 10px;
background: #213B54;
padding-top: 2vh;
padding-left: 1vw;
padding-right: 1vw;
padding-bottom: 2vh;
display: flex;
flex-direction: column;
}
.close {
font: Arial, sans-serif;
background: #067A9F;
color: #B5E5E7;
line-height: 25px;
position: absolute;
right: -12px;
text-align: center;
top: -10px;
width: 24px;
text-decoration: none;
font-weight: bold;
border-radius: 12px;
box-shadow: 1px 1px 3px #000;
cursor: pointer;
}
.popup-window div .title1 {
font-family: Arial, sans-serif;
font-weight: normal;
font-size: 36px;
color: #EE6802;
align-self: center;
}
.popup-window form input[type=submit]:hover {
opacity: 0.8;
}
.popup-window form span {
color: #EE6802;
font-size: 22px;
}
.popup-window form {
display: flex;
flex-direction: column;
font-family: Arial, sans-serif;
}
.popup-window form span, input {
width: 100%;
}
.popup-window form input[type=submit] {
width: 20%;
background-color: #067A9F;
color: #213B54;
padding: 14px 0;
cursor: pointer;
border: none;
}
I found the solution, it was that I forgot to select an element inside the window properly and instead it was selecting all divs and so overriding the CSS properties.

Hide the .message-notif class if there is a record else show if there is no record

Please see code below:
.menu-notif-f {
position: absolute;
top: 50px;
right: 12px;
background-color: #ffffff;
width: 320px;
height: 480px;
overflow: hidden;
border-radius: 8px;
box-shadow: 0 3px 22px 0px rgb(0 0 0 / 15%);
animation: ani_desk_menuuserf .16s ease;
}
.menu-notif-t._title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
color: #555555;
border-bottom: 1px solid #d5fff8;
}
.menu-notif-l._notif-title {
font-size: 16px;
font-weight: 600;
letter-spacing: .04px;
color: #555555;
}
.meni-notif-r._notif-see-all {
font-size: 14px;
font-weight: 500;
letter-spacing: .04px;
color: #01d2af;
}
._profile-c {
background: url(../media/icons/_overview/profile.png);
background-size: 66%;
}
.menu-notif-img {
width: 66px;
height: 66px;
/*height: 9vw;
max-width: 45px;
max-height: 45px;
min-width: 45px;
min-height: 45px;*/
background-color: #ffffff;
border-radius: 50px;
box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
background-repeat: no-repeat;
background-position: center;
padding: 5px;
}
.menu-notif-c._notif-c {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px;
margin: 5px 5px;
}
.menu-notif-cl {
flex: 0 0 30%;
}
.menu-notif-cr {
flex: 0 0 70%;
}
.menu-notif-dt {
display: flex;
justify-content: space-between;
margin-bottom: 3px;
align-items: center;
}
.menu-notif-name {
font-size: 14px;
font-weight: 600;
color: #01d2af;
}
.menu-notif-time {
font-size: 13px;
font-weight: 600;
color: #657688;
}
.menu-notif-desc {
font-size: 13px;
color: #657688;
display: -webkit-box;
max-width: 100%;
/*height: 30px;*/
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.menu-notif-cc::-webkit-scrollbar {
display: none;
}
.menu-notif-cc {
overflow: auto;
height: 420px;
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
top: 50px;
}
.hdr-noah-c a {
color: #ffffff;
text-decoration: none;
}
<div class="menu-notif-f">
<div class="menu-notif-t _title">
<div class="menu-notif-l _notif-title">Notification</div>
<div class="meni-notif-r _notif-see-all">See All</div>
</div>
<div class="menu-notif-cc">
<div class="menu-notif-c _notif-c">
<div class="menu-notif-cl">
<div class="menu-notif-img _profile-c"></div>
</div>
<div class="menu-notif-cr">
<div class="menu-notif-dt">
<div class="menu-notif-name">Test Name</div>
<div class="menu-notif-time">03:53</div>
</div>
<div class="menu-notif-desc">
Login details need to be update
</div>
</div>
</div>
<div class="menu-notif-c _notif-c">
<div class="menu-notif-cl">
<div class="menu-notif-img _profile-c"></div>
</div>
<div class="menu-notif-cr">
<div class="menu-notif-dt">
<div class="menu-notif-name">Test Name</div>
<div class="menu-notif-time">03:53</div>
</div>
<div class="menu-notif-desc">
Login details need to be update
</div>
</div>
</div>
<!-- This will shown if there is no notification available. Hide if there is an exsiting notification. -->
<div class="message-notif">
<div class="currently-para">There's nothing to be shown as of now</div>
</div>
</div>
</div>
Can anyone help me with this? My goal is if there's a record the .message-notif class will hide and if there is no record The .message-notif class will show. using jQuery? Currently, I don't have any jQuery code that is why the .message-notif is showing, But now there 2 records so meaning the .message-notif should be hidden by now. Please help me with how can I accomplish that transition. Thanks in advance
Usually, for empty-list or things, there is how I manage it without JS : I never remove the item nor hide it. I just say that, if it's the last item in the list, I'll show it.
Let's say that you have a notice list in a div with class .notice-list. Put your 'empty' message in the notice list. Then :
.notice-list > .no-notice-to-show{
display: none;
}
.notice-list > >.no-notice-to-show:last-child{
display: block;
}
When you have a notice, just append your ntoice in the list. The notice will become the last child in your list, causing your 'empty' message to desapear.
Indeed, it doesn't work if you need your empty message to be displayed elsewhere tha tin the empty list. But it's rarely the case.
Used a for loop because you have no #id on the no message div tag, but something like this should work:
var notifications = document.querySelectorAll(".menu-notif-c");
var noNotif = document.querySelectorAll(".message-notif");
if (notifications.length > 0) {
for (let i = 0; i < noNotif.length; i++) {
noNotif[i].style.display = "block";
}
} else {
for (let i = 0; i < noNotif.length; i++) {
noNotif[i].style.display = "none";
}
}
If the <div class="menu-notif-c _notif-c"> wouldn't render if empty, I have a better solution for you.
Just use
.message-notif {display: none;}
.menu-notif-cc > .message-notif:nth-of-type(1) {
display: block;
}
This will hide and display the notification based on the presence of notification messages.
Full code snippet here:
.menu-notif-f {
position: absolute;
top: 50px;
right: 12px;
background-color: #ffffff;
width: 320px;
height: 480px;
overflow: hidden;
border-radius: 8px;
box-shadow: 0 3px 22px 0px rgb(0 0 0 / 15%);
animation: ani_desk_menuuserf .16s ease;
}
.menu-notif-t._title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
color: #555555;
border-bottom: 1px solid #d5fff8;
}
.menu-notif-l._notif-title {
font-size: 16px;
font-weight: 600;
letter-spacing: .04px;
color: #555555;
}
.meni-notif-r._notif-see-all {
font-size: 14px;
font-weight: 500;
letter-spacing: .04px;
color: #01d2af;
}
._profile-c {
background: url(../media/icons/_overview/profile.png);
background-size: 66%;
}
.menu-notif-img {
width: 66px;
height: 66px;
/*height: 9vw;
max-width: 45px;
max-height: 45px;
min-width: 45px;
min-height: 45px;*/
background-color: #ffffff;
border-radius: 50px;
box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
background-repeat: no-repeat;
background-position: center;
padding: 5px;
}
.menu-notif-c._notif-c {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px;
margin: 5px 5px;
}
.menu-notif-cl {
flex: 0 0 30%;
}
.menu-notif-cr {
flex: 0 0 70%;
}
.menu-notif-dt {
display: flex;
justify-content: space-between;
margin-bottom: 3px;
align-items: center;
}
.menu-notif-name {
font-size: 14px;
font-weight: 600;
color: #01d2af;
}
.menu-notif-time {
font-size: 13px;
font-weight: 600;
color: #657688;
}
.menu-notif-desc {
font-size: 13px;
color: #657688;
display: -webkit-box;
max-width: 100%;
/*height: 30px;*/
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.menu-notif-cc::-webkit-scrollbar {
display: none;
}
.menu-notif-cc {
overflow: auto;
height: 420px;
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
top: 50px;
}
.hdr-noah-c a {
color: #ffffff;
text-decoration: none;
}
.message-notif {display: none;}
.menu-notif-cc > .message-notif:nth-of-type(1) {
display: block;
}
<div class="menu-notif-f">
<div class="menu-notif-t _title">
<div class="menu-notif-l _notif-title">Notification</div>
<div class="meni-notif-r _notif-see-all">See All</div>
</div>
<div class="menu-notif-cc">
<div class="menu-notif-c _notif-c">
<div class="menu-notif-cl">
<div class="menu-notif-img _profile-c"></div>
</div>
<div class="menu-notif-cr">
<div class="menu-notif-dt">
<div class="menu-notif-name">Test Name</div>
<div class="menu-notif-time">03:53</div>
</div>
<div class="menu-notif-desc">
Login details need to be update
</div>
</div>
</div>
<div class="menu-notif-c _notif-c">
<div class="menu-notif-cl">
<div class="menu-notif-img _profile-c"></div>
</div>
<div class="menu-notif-cr">
<div class="menu-notif-dt">
<div class="menu-notif-name">Test Name</div>
<div class="menu-notif-time">03:53</div>
</div>
<div class="menu-notif-desc">
Login details need to be update
</div>
</div>
</div>
<!-- This will shown if there is no notification available. Hide if there is an exsiting notification. -->
<div class="message-notif">
<div class="currently-para">There's nothing to be shown as of now</div>
</div>
</div>
</div>
Same code without the <div class="menu-notif-c _notif-c"> inside the parent <div class="menu-notif-cc">
.menu-notif-f {
position: absolute;
top: 50px;
right: 12px;
background-color: #ffffff;
width: 320px;
height: 480px;
overflow: hidden;
border-radius: 8px;
box-shadow: 0 3px 22px 0px rgb(0 0 0 / 15%);
animation: ani_desk_menuuserf .16s ease;
}
.menu-notif-t._title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
color: #555555;
border-bottom: 1px solid #d5fff8;
}
.menu-notif-l._notif-title {
font-size: 16px;
font-weight: 600;
letter-spacing: .04px;
color: #555555;
}
.meni-notif-r._notif-see-all {
font-size: 14px;
font-weight: 500;
letter-spacing: .04px;
color: #01d2af;
}
._profile-c {
background: url(../media/icons/_overview/profile.png);
background-size: 66%;
}
.menu-notif-img {
width: 66px;
height: 66px;
/*height: 9vw;
max-width: 45px;
max-height: 45px;
min-width: 45px;
min-height: 45px;*/
background-color: #ffffff;
border-radius: 50px;
box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
background-repeat: no-repeat;
background-position: center;
padding: 5px;
}
.menu-notif-c._notif-c {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px;
margin: 5px 5px;
}
.menu-notif-cl {
flex: 0 0 30%;
}
.menu-notif-cr {
flex: 0 0 70%;
}
.menu-notif-dt {
display: flex;
justify-content: space-between;
margin-bottom: 3px;
align-items: center;
}
.menu-notif-name {
font-size: 14px;
font-weight: 600;
color: #01d2af;
}
.menu-notif-time {
font-size: 13px;
font-weight: 600;
color: #657688;
}
.menu-notif-desc {
font-size: 13px;
color: #657688;
display: -webkit-box;
max-width: 100%;
/*height: 30px;*/
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.menu-notif-cc::-webkit-scrollbar {
display: none;
}
.menu-notif-cc {
overflow: auto;
height: 420px;
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
top: 50px;
}
.hdr-noah-c a {
color: #ffffff;
text-decoration: none;
}
.message-notif {display: none;}
.menu-notif-cc > .message-notif:nth-of-type(1) {
display: block;
}
<div class="menu-notif-f">
<div class="menu-notif-t _title">
<div class="menu-notif-l _notif-title">Notification</div>
<div class="meni-notif-r _notif-see-all">See All</div>
</div>
<div class="menu-notif-cc">
<!-- This will shown if there is no notification available. Hide if there is an exsiting notification. -->
<div class="message-notif">
<div class="currently-para">There's nothing to be shown as of now</div>
</div>
</div>
</div>

How do I align these HREF Buttons?

I am trying to make 2 button align (they are HREFs) on the right side of a div. I have tried many stuff but I am not sure how.
CSS:
.href-right-header-buttons {
position: unset;
color: #fff;
font-size: 26px;
letter-spacing: 2px;
padding-top: 34px;
padding-bottom: 34px;
padding-left: 6px;
padding-right: 6px;
overflow: hidden;
font-family: 'Roboto', sans-serif;
text-decoration: none;
right: 0;
top: 0;
animation: animheader;
animation-duration: 1.5s;
.div-header-gradient {
display: flex;
background: linear-gradient(#7700ff, #953bff);
height: 100px;
width: 100%;
margin-left: 0px;
overflow: hidden;
animation: animheader;
animation-duration: 1.5s;
flex-direction: row;
}
HTML:
<div class="div-header-gradient" style="z-index: 1000;">
<p class="text-header-title-white" style="z-index: 1000;">
Axxon
</p>
<a href="https://discord.com/oauth2/authorize?client_id=796339788235800577&scope=bot&permissions=267906127" class="href-right-header-buttons">
Invite Bot
</a>
<a href="#" class="href-right-header-buttons">
More Information
</a>
</div>
How this looks now:
How I want it to look:
So basically, I want it to move them both to the right side of the div and make them seperated.
Add an extra wrapper (I used the div in the HTML with the class "my-wrapper"):
<div class="div-header-gradient" style="z-index: 1000;">
<p class="text-header-title-white">
Axxon
</p>
<div class="my-wrapper">
<a href="https://discord.com/oauth2/authorize?client_id=796339788235800577&scope=bot&permissions=267906127" class="href-right-header-buttons">
Invite Bot
</a>
<a href="#" class="href-right-header-buttons">
More Information
</a>
</div>
</div>
And in the CSS, I have added align-items center (to center the X-axis) and justify-content: space-between to create the space between those two elements (the paragraph and my new div with the class wrapper):
.div-header-gradient {
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(#7700ff, #953bff);
height: 100px;
width: 100%;
margin-left: 0px;
overflow: hidden;
animation: animheader;
animation-duration: 1.5s;
flex-direction: row;
}
You can check in this codepen: https://codepen.io/GiulioBadger/pen/XWjBwxr
Preview of the result:
Look for flex-grow and apply it on the p.
To make it work from your codePen CSS, I removed the justify-content: space-between on the flex container .div-header-gradient and the absolute positionnings of its child elements.
About the "ripple" effect on the links, I wrapped them with a div (one for each) to "contain" the animation. There is an additionnal CSS rule for them And it affected the position calculation in the JS. Notice the .closest("div") which targets that wrapper div.
let x = e.pageX - e.target.closest("div").offsetLeft;
let y = e.pageY - e.target.closest("div").offsetTop;
#import url('https://fonts.googleapis.com/css2?family=Roboto:wght#100&display=swap');
body {
display: flex;
flex-direction: column;
background-color: #141414;
position: center;
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
#particles-js {
position: absolute;
width: 100%;
height: 100%;
background-color: #121212;
background-image: url("");
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 50%;
}
.button {
position: relative;
padding: 12px 36px;
margin: 10px 0;
color: #738adb;
font-size: 26px;
letter-spacing: 2px;
border-radius: 100px;
background: #242424;
overflow: hidden;
font-family: 'Roboto', sans-serif;
text-decoration: none;
}
.div-header-gradient {
display: flex;
align-items: center;
/*justify-content: space-between;*/
background: linear-gradient(#7700ff, #953bff);
height: 100px;
width: 100%;
margin-left: 0px;
overflow: hidden;
animation: animheader;
animation-duration: 1.5s;
/*flex-direction: row;*/
}
.div-header-gradient p{
flex-grow: 1; /* Add this for the alignement */
}
.div-header-gradient>div{ /* Add this to contain the ripple effect on links */
position: relative;
overflow: hidden;
height: 100%;
display: flex;
align-content: center;
}
span {
position: absolute;
background: #fff;
transform: translate(-50%, -50%);
pointer-events: none;
border-radius: 50%;
pointer-events: none;
animation: ripple 0.6s linear;
z-index: 9999;
overflow: hidden;
}
.text-header-title-white {
color: #fff;
font-size: 70px;
font-family: Roboto, sans-serif;
margin: 1px;
/*position: absolute;*/
vertical-align: central;
overflow: hidden;
margin-left: 0.5%;
display: flex;
flex-direction: row;
}
.href-right-header-buttons {
/*position: absolute;*/
color: #fff;
font-size: 26px;
letter-spacing: 2px;
padding-top: 34px;
padding-bottom: 34px;
padding-left: 6px;
padding-right: 6px;
overflow: hidden;
font-family: 'Roboto', sans-serif;
text-decoration: none;
/*right: 0;
top: 0;*/
animation: animheader;
animation-duration: 1.5s;
}
#keyframes animheader {
from {
margin-top: -100px;
opacity: 0;
}
to {
margin: 0px;
opacity: 1;
}
}
#keyframes ripple {
0% {
width: 0px;
height: 0px;
opacity: 0.2;
}
100% {
width: 400px;
height: 400px;
opacity: 0;
}
}
<html>
<head>
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<div class="div-header-gradient" style="z-index: 1000;">
<p class="text-header-title-white">
Axxon
</p>
<div> <!-- a div to wrap each link -->
<a href="https://discord.com/oauth2/authorize?client_id=796339788235800577&scope=bot&permissions=267906127" class="href-right-header-buttons">
Invite Bot
</a>
</div>
<div> <!-- a div to wrap each link -->
<a href="#" class="href-right-header-buttons">
More Information
</a>
</div>
</div>
<script type="text/javascript">
const buttons = document.querySelectorAll('a');
buttons.forEach(btn => {
btn.addEventListener('mousedown', function(e) {
let x = e.pageX - e.target.closest("div").offsetLeft; // Changed
let y = e.pageY - e.target.closest("div").offsetTop; // Changed
let ripples = document.createElement('span');
ripples.style.left = x + 'px';
ripples.style.top = y + 'px';
this.appendChild(ripples);
setTimeout(() => {
ripples.remove()
}, 5000);
})
})
</script>
<script src="assets/js/particles.js"></script>
<script src="assets/js/app.js"></script>
</body>
</html>
.href-right-header-buttons {
position: unset;
color: #fff;
font-size: 26px;
letter-spacing: 2px;
padding-top: 34px;
padding-bottom: 34px;
padding-left: 6px;
padding-right: 6px;
overflow: hidden;
font-family: 'Roboto', sans-serif;
text-decoration: none;
right: 0;
top: 0;
animation: animheader;
animation-duration: 1.5s;
}
.div-header-gradient {
display: flex;
background: linear-gradient(#7700ff, #953bff);
height: 100px;
width: 100%;
margin-left: 0px;
overflow: hidden;
animation: animheader;
animation-duration: 1.5s;
flex-direction: row;
justify-content: space-between;
}
<div class="div-header-gradient" style="z-index: 1000;">
<p class="text-header-title-white" style="z-index: 1000;">
Axxon
</p>
<span class="left">
<a href="https://discord.com/oauth2/authorize?client_id=796339788235800577&scope=bot&permissions=267906127" class="href-right-header-buttons">
Invite Bot
</a>
<a href="#" class="href-right-header-buttons">
More Information
</a>
</span>
</div>

Sass style is not applying to content

my SASS style is not being applied when I nest them. I don't understand why, they work perfectly when not nested. I've never encountered this issue before and it seems strange that it would not apply the styling this one time. It also works when I remove the :nth-of-type(1) portion. I find this a bit odd, since I specifically need to divide it with for this one "shop-sec" and others. Thank you.
.shop-sec:nth-of-type(1) {
height: 500px auto;
background-color: white;
margin-top: 75px;
display: grid;
position: relative;
grid-template-columns: .75fr 1.25fr 1.25fr .75fr;
grid-gap: 15px;
.shop-sec-content {
width: 100%;
height: 100%;
}
.shop-sec-content img {
width: 100%;
height: auto;
}
.shop-sec-content:nth-of-type(1) {
position: relative;
}
.shop-sec-content:nth-of-type(1) .shop-sec-text {
position: absolute;
right: 0;
padding-right: 50px;
transform: rotate(-90deg);
top: 42.5%;
font-size: 20px;
font-weight: bold;
}
.shop-sec-content:nth-of-type(4) {
position: relative;
}
.shop-sec-content:nth-of-type(4) .shop-sec-text {
position: absolute;
left: 0;
padding-left: 50px;
top: 42.5%;
font-size: 20px;
font-weight: bold;
}
.shop-sec-content:nth-of-type(2) {
position: relative;
}
.shop-sec-content:nth-of-type(2) .shop-sec-content-text {
position: absolute;
top: 50%;
margin-left: 50px;
font-size: 16px;
padding: 5px 20px;
color: white;
background-color: rgba(0, 0, 0, 0.507);
text-transform: uppercase;
letter-spacing: 5px;
}
.shop-sec-content:nth-of-type(2) .shop-sec-content-text span {
font-size: 24px;
font-weight: bold;
letter-spacing: 0px;
}
}
<div class="shop-sec">
<div class="shop-sec-content">
<div class="shop-sec-text">HELLO</div>
</div>
<div class="shop-sec-content">
<div class="shop-sec-content-text">NEW!<br><span>HELLO</span></div>
<img src="">
</div>
<div class="shop-sec-content">
<div class="shop-sec-content-text"></div>
<img src="">
</div>
<div class="shop-sec-content">
<div class="shop-sec-text">01</div>
</div>
</div>

HTML/CSS slider not displaying correctly on mobile

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;}