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>
Related
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.
Im honestly not sure what the heck happened when I changed the position from relative to absolute. Most of my elements were in absolute already. But changing the header, footer, and main section messed up the heights and visibility. Im not sure what to do. Im not even sure what to look for [for solutions] so Stack Overflow is my last resort.
My site for reference: https://rosesystem.neocities.org/index.html
No matter what % value I put in, the height doesnt change for the footer and the main box.
The CSS and The HTML:
background-image:url(Backgrounds/roses.gif);
Font-family: "Courier New", monospace;
}
.all {
margin-left: 25%;
margin-right: 25%;
margin-top: 2%;
align-items: center;
align-content: center;
justify-content: center;
height: 110%;
position: relative;
}
a {
color: red;
text-decoration: none;
}
a:hover {
color: darkred;
}
#top {
color: white;
justify-content: center;
font-size: 35px;
background-image:url(Backgrounds/rouge.JPG);
background-position: center;
background-size: fill;
border: 4px red solid;
display: flex;
align-items: center;
align-content: center;
padding: 5px;
width: 100%;
animation: mymove 5s infinite;
position: absolute;
}
#booty {
background-image:url(https://64.media.tumblr.com/6382d38a81b616031c469d56a09d88b4/7faacc6c2b3eb254-76/s500x750/fe9ff85c4a3590a3701990dd6182b40706df862e.gifv); /*background*/
color: white; font-size:20px; /*text*/
border: 4px red solid; /*border*/
justify-content: center; align-items: center; align-content: center; /*content position*/
padding-top: 20px; margin-top: 12.5%!important; margin-bottom: 1%; margin: 20%; position: absolute; /*container position*/
padding: 5px; width: 60%; height: 200%; /*dimensions*/
animation: mymove 5s infinite;
}
#keyframes mymove {
0% {border-color: red;}
50% {border-color: darkred;}
100% {border-color: red}
}
#feet {
background-image:url(Backgrounds/rouge.JPG);
color: white; font-size: 20px;
Border: 4px red solid;
Padding: 5px; width: 60%; height: 100%;
margin-top: 85%!important;margin-bottom: 5%!important; margin: 20%; /*container position*/
animation: mymove 5s infinite;
position: absolute;
}
.sidebar {
Border: 4px red solid;
animation: mymove 5s infinite;
background-color: black;
height: 100%
float: left;
margin-left: none;
margin-right: 82%!important;
overflow: hidden;
margin-top: 12.5%;
position: absolute;
left: 0;
top: 0;
padding: 5px;
padding-top: 20px!important;
align-items: center;
align-content: center;
justify-content: center;
}
.sidebar a {
display: block;
padding-top: 10px;
font-size: 20px;
background-color: #540101;
}
#otherside {
background-color: black;
color: white; font-size: 20px;
Border: 4px red solid; Padding: 5px;
position: absolute;
animation: mymove 5s infinite;
margin-left: 84% ;
width: 16.2%;
margin-top: 12.5%;
height: 100%;
}
#othersidetext {
background-color: #540101;
text-align: center;
color: red;
}
#othersideimg {
Border: 4px red solid;
height: auto; width: 93%;
animation: mymove 5s infinite;
margin-top: 4.5%;
}
#countbox {
background-image:url(Backgrounds/rouge.JPG);
color: white; font-size: 20px;
Border: 4px red solid; Padding: 5px;
position: absolute;
animation: mymove 5s infinite;
margin-left: 84%;
width: 16.2%;
margin-top: 49.5%;
height: 7%;
}
#blinkiebox {
background-color: black;
color: white; font-size: 20px;
Border: 4px red solid; Padding: 5px;
position: absolute;
animation: mymove 5s infinite;
margin-left: 84%;
width: 16.2%;
margin-top: 38.7%;
height: 35%;
overflow: hidden;
}
#blinkies {
width: 103%;
margin-left: 84%;
height: auto;
}
hr {
border-color: red;
border-style: solid;
border-width: 2px;
width: 106%;
margin-left: -5%;
animation: mymove 5s infinite;
}
</style>
<body>
<!-- everything box -->
<div class="all">
<!-- title box -->
<div id="top"> The Rose System </div>
<!-- main box -->
<div id="booty">
yes i'm redoing the index page again shh<br>
test<br>test<br>ok<br>now<br>here<br>Is<br>placeholder<br>text<br>i<br>hope<br>you<br>enjoy<br>
<img src="Roses/groupofroses.gif" alt="group of pretty roses with a butterfly" width="40%" height="auto"><br>
</div>
<!-- footer box -->
<div id="feet"> <marquee> || site by achrya || Feb 2022-Forever ||</marquee> </div>
<!-- sidebar box -->
<div class="sidebar">
<img src="Roses/groupofroses.gif" alt="group of pretty roses with a butterfly" width="75%" height="auto">
<hr>
<img src="Roses/rosedivider2.GIF" alt="horizontal rose vine that divides a section" width="97%" height="auto">
<hr>
Alter List
<hr>
Blog
<hr>
General [TW: Flashing]
<hr>
Links
<hr>
<img src="Roses/rosedivider2.GIF" alt="horizontal rose vine that divides a section" width="97%" height="auto" padding-bottom="15px">
<hr>
<img src="Roses/groupofroses.gif" alt="group of pretty roses with a butterfly" width="75%" height="auto">
</div>
<!-- image box -->
<div id=otherside>
<div id="othersidetext"> Zombie: </div>
<hr>
<img src="https://c.tenor.com/8ustcfbXeAcAAAAM/anime-excited.gif" id="othersideimg" alt="a gif of the system host, zombie. from one of her source medias">
</div>
<!-- count box -->
<div id="countbox">Alter Count: 13?</div>
<!-- Blinkie Box -->
<div id="blinkiebox">
<img src="Blinkies/Guestbook.gif" id="blinkies" padding-top="5%">
<hr>
<img src="Blinkies/dicesurvivor.PNG" id="blinkies">
<hr>
<img src="Blinkies/achrya.gif" id="blinkies" width="110%!important" height="auto">
<hr>
<img src="Blinkies/osdid.gif" id="blinkies">
</div>
</div>
When you use height: 100%; on your Footer, that basically means to get a 100% of height of the nearest parent with absolute or relative position. In your case it's an <div class="all" element.
The problem that you have is that <div class="all" element has a height of 0.
You can choose one of these options to fix the issue:
Add height to your all element
.all {
height: 100vh;
}
Make your all element also absolute, and then it takes the height automatically
.all {
position: absolute;
width: 50%;
}
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.
So as said above, I have (for fun) recreated a website (hologram.io), because I'm new to CSS, and just wanted to see what I can do myself without help... But I can't figure out how I can position the whole first section which is absolute (-> On top of an Image) center, center. So vertical and horizontal, So that on bigger screens it always stays perfectly in the center of the menu... On the other sections which are not absolute, I used display: flex, justify-content: center and align-items center, which works perfectly... On the screenshots I have included, you can see the problem... Also, will include the code. It looks a bit messy, but should be fine haha...
Here you can see the noncentered Absolute item
Here you can see the flex items which are perfectly centered on every screensize and
And here for Refernce is the hologram website...
#font-face {
font-family: Robert Sans;
src: url(RobertSans-Regular.ttf);
}
#navtextonly li {
list-style-type: none;
display: inline;
padding: 15px;
text-align: center;
}
.listitem:hover {
cursor: pointer;
color: #4e6cff;
}
#hologramlogo {
margin-top: 20px;
margin-bottom: 20px;
margin-right: 0px;
padding-right: 0px;
}
nav {
background-color: rgb(255, 255, 255);
}
body {
margin: 0px;
font-family: Robert Sans;
}
#navbarouter {
display: flex;
align-items: center;
justify-content: center;
}
#navtextonly {
white-space: nowrap;
}
#mainmenuwobtnlogo {
margin-right: 100px;
}
ul {
font-size: 16px;
}
#buttonsmenu1 {
background-color: white;
border: 1px solid #4e6cffce;
padding: 12px 23px 12px 23px;
border-radius: 25px;
margin-right: 15px;
-webkit-box-shadow: 2px 2px 15px 1px #999999;
box-shadow: 2px 2px 15px 1px #999999;
}
#buttonsmenu1:hover {
border-color: #111;
cursor: pointer;
}
#buttonsmenu2 {
background-color: #4e6cff;
padding: 12px 23px 12px 23px;
color: white;
border-radius: 25px;
-webkit-box-shadow: 2px 2px 15px 1px #999999;
box-shadow: 2px 2px 15px 1px #999999;
}
#buttonsmenu2:hover {
background-color: #788fff;
color: white;
cursor: pointer;
}
.buttonsmenuouter {
margin-left: 25px;
}
#hamburgernav {
display: none;
}
#backgroundverlauf {
height: 800px;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
}
.mainheading {
font-size: 64px;
white-space: nowrap;
font-weight: 400;
}
#h1top,
#h1bottom {
margin: 0px;
padding: 0px;
}
article {
color: rgb(255, 255, 255);
max-width: 550px;
}
#ellipse {
position: absolute;
top: 0px;
left: 630px;
}
#drohnepng {
position: absolute;
top: -50px;
left: 880px;
height: 80px;
}
#cartpng {
position: absolute;
top: 80px;
left: 585px;
height: 250px;
}
#rollerpng {
position: absolute;
top: 140px;
left: 825px;
height: 440px;
}
#content1 {
position: absolute;
top: 250px;
left: 12%;
}
#outerouter {
max-width: 1300px;
}
#glowh1 {
background: linear-gradient(
-60deg,
#904e95,
#904e95,
#e73c7e,
#ee7752,
#4e6cff,
white
);
background-size: 600%;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
animation: animate 10s linear infinite;
}
#keyframes animate {
0% {
background-position: 0%;
}
100% {
background-position: 600%;
}
}
#paragraph {
width: 390px;
color: rgb(199, 199, 199);
font-size: 20px;
margin-bottom: 30px;
}
#emailwithsubmit {
display: flex;
}
.emailfeld {
width: 100%;
padding: 18px 23px 18px 23px;
border-radius: 25px 26px 26px 25px;
border-width: 0px;
border: 1px red solid;
}
#submitbtn {
padding: 18px 35px 18px 35px;
border-radius: 25px 25px 25px 25px;
color: white;
font-weight: 600;
border-width: 0px;
background-image: linear-gradient(90deg, #00a6ff, #7831ca, #fe17c0);
position: relative;
left: -60px;
}
#mainpart2,
#mainpart3 {
display: flex;
align-items: center;
justify-content: center;
margin: 100px 60px 100px 60px;
}
#mainpart2-3outer {
}
#card {
margin-left: 60px;
margin-right: 100px;
height: 280px;
/* -webkit-animation: fadein 3.2s both;
-moz-animation: fadein 3.2s both;
-o-animation: fadein 3.2s both;
animation: fadein 3.2s both; */
animation: float2 6s ease-in-out infinite;
}
#keyframes float2 {
0% {
transform: translatey(0px);
}
50% {
transform: translateX(-10px);
}
100% {
transform: translatey(0px);
}
}
#-webkit-keyframes fadein {
0% {
opacity: 0;
-webkit-transform: translateX(-25px);
}
100% {
opacity: 1;
-webkit-transform: translateX(0);
}
}
#-moz-keyframes fadein {
0% {
opacity: 0;
-moz-transform: translateX(-50px);
}
100% {
opacity: 1;
-moz-transform: translateX(0);
}
}
#-0-keyframes fadein {
0% {
opacity: 0;
-o-transform: translateX(-50px);
}
100% {
opacity: 1;
-o-transform: translateX(0);
}
}
#keyframes fadein {
0% {
opacity: 0;
transform: translateX(-50px);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
#ellipse {
-webkit-animation: fade 5s both;
-moz-animation: fade 5s both;
-o-animation: fade 5s both;
animation: fade 5s both;
}
#-webkit-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-moz-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-0-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#cartpng,
#drohnepng,
#rollerpng {
/* -webkit-animation: fadein 3.2s both;
-moz-animation: fadein 3.2s both;
-o-animation: fadein 3.2s both;
animation: fadein 3.2s both;
transform: translatey(0px); */
animation: float 6s ease-in-out infinite;
}
#keyframes float {
0% {
transform: translatey(0px);
}
50% {
transform: translatey(-50px);
}
100% {
transform: translatey(0px);
}
}
#mainh-1,
#mainp-1 {
max-width: 280px;
}
#mainh-2,
#mainp-2 {
max-width: 280px;
}
.main1h,
.main1p,
.main2h,
.main2p {
display: flex;
flex-direction: row;
justify-content: space-between;
}
#mainh-3,
#mainp-3 {
max-width: 280px;
}
#mainh-4,
#mainp-4 {
max-width: 280px;
}
#mainh-1,
#mainh-2,
#mainh-3,
#mainh-4 {
margin: 0px;
padding: 0px;
}
#textmainpart2 {
margin-right: 60px;
}
.main2h1 {
margin-bottom: 40px;
}
.contentmainpart3-1 {
max-width: 475px;
margin-left: 60px;
}
.contentmainpart3-2 {
margin-right: 60px;
}
#beforefootercentered {
text-align: center;
margin-bottom: 75px;
}
.beforefootercolumncontent {
display: flex;
flex-direction: row;
justify-content: center;
gap: 100px;
margin-left: 100px;
margin-right: 100px;
margin-bottom: 50px;
}
.beforefootericons {
height: 66px;
width: 66px;
}
#beforefootercolumncontent1,
#beforefootercolumncontent2,
#beforefootercolumncontent3 {
max-width: 280px;
text-align: center;
}
#list2banner {
display: flex;
flex-direction: row;
margin-top: 20px;
}
#list1bannerouter {
max-width: 725px;
}
.footerbanner {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background-image: linear-gradient(90deg, #7831ca, #00a5ff);
margin: 0px 190px 0px 190px;
border-radius: 10px;
padding-left: 30px;
padding-top: 25px;
padding-right: 30px;
padding-bottom: 50px;
color: white;
position: relative;
top: 100px;
}
.footerbanner h2 {
font-size: 40px;
font-weight: 400;
margin-bottom: 10px;
}
#list1banner {
margin: 0;
padding: 0;
list-style: none;
display: flex;
}
#list1banner li:before {
content: "✓";
padding-right: 5px;
}
#btn1,
#btn2 {
border-radius: 25px;
padding: 10px 20px 10px 20px;
}
#btn1 {
margin-right: 20px;
background-color: #111;
border-width: 0px;
}
#btn2 {
background-image: transparent;
border: 1px solid white;
}
#pfeil {
margin-left: 5px;
}
#mainfooter {
height: 600px;
background-color: #0a1435;
}
#mainfooterupper {
height: 100px;
background-color: #0a1435;
display: none;
}
.item1 {
margin-right: 20px;
}
#placehold {
position: absolute;
top: 3100px;
left: 50%;
transform: translate(-50%, -50%);
color: rgb(255, 255, 255);
font-size: 70px;
}
#media only screen and (max-width: 1350px) {
html,
body {
overflow-x: hidden;
}
body {
position: relative;
}
#navtextonly {
font-size: 14px;
}
li {
padding-right: 20px;
}
#mainmenuwobtnlogo {
margin-left: 0px;
margin-right: 0px;
}
#navbarouter {
display: flex;
}
#hologramlogo {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 0px;
width: 120px;
}
.buttonsmenuouter {
margin-left: 25px;
font-size: 14px;
margin-right: 0px;
}
#buttonsmenu1,
#buttonsmenu2 {
padding: 9px 17px 9px 17px;
}
#backgroundverlauf {
height: 800px;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
}
}
#media only screen and (max-width: 990px) {
html,
body {
overflow-x: hidden;
}
body {
position: relative;
}
#navtextonly {
display: none;
}
#navbarouter {
margin-left: 20px;
margin-right: 20px;
display: flex;
justify-content: space-between;
}
#hologramlogo {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
}
.buttonsmenuouter {
margin-left: 0px;
}
#hamburgernav {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
margin-right: 20px;
display: inline;
}
#backgroundverlauf {
height: 800px;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
}
.mainheading {
font-size: 50px;
}
#paragraph {
font-size: 19px;
}
}
#media only screen and (max-width: 570px) {
.mainheading {
font-size: 30px;
}
#paragraph {
font-size: 16px;
}
#content1 {
position: absolute;
top: 175px;
}
article {
color: rgb(255, 255, 255);
max-width: 500px;
display: flex;
flex-direction: column;
margin-right: 20px;
}
#floatingimages {
display: none;
}
#paragraph {
width: 300px;
color: rgb(199, 199, 199);
font-size: 16px;
margin-bottom: 30px;
}
#backgroundverlauf {
height: 500px;
}
.emailfeld {
width: 80%;
padding-bottom: 20px;
padding: 13px 20px 13px 20px;
border-radius: 25px 26px 26px 25px;
border-width: 0px;
border: 1px red solid;
}
#submitbtn {
width: 87%;
position: absolute;
left: 10px;
top: 280px;
padding-bottom: 20px;
padding: 13px 20px 13px 20px;
border-radius: 25px 26px 26px 25px;
border-width: 0px;
border: 1px red solid;
/*
padding: 13px 30px 13px 30px;
border-radius: 25px 25px 25px 25px;
color: white;
font-weight: 600;
margin-left: 0px;
border-width: 0px;
background-image: linear-gradient(90deg, #00a6ff, #7831ca, #fe17c0);*/
}
#emailwithsubmit {
display: flex;
gap: 13px;
flex-direction: column;
align-items: center;
}
}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="styles2.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index2</title>
</head>
<div>
<nav>
<div id="navbarouter">
<img
id="hologramlogo"
src="610f51dabc2bd752a968dfac_Hologram Logo Black Text.svg"
alt="Logo"
width="130px"
/>
<ul id="navtextonly">
<li class="listitem">Cellular IoT</li>
<li class="listitem">Why Hologram</li>
<li class="listitem">Resources</li>
<li class="listitem">Plans</li>
<li class="listitem">Jobs</li>
<li class="listitem">Store</li>
<span class="buttonsmenuouter">
<li id="buttonsmenu1">Contact Sales</li>
<li id="buttonsmenu2">Sign in</li>
</span>
</ul>
<div id="hamburgernavouter">
<img id="hamburgernav" src="hamburgernav.svg" alt="hamburgernav" />
</div>
</div>
</nav>
<div id="outerouterouter">
<img
src="background1.png"
id="backgroundverlauf"
alt="backgroundverlauf"
/>
<div id="outerouter">
<div id="content1">
<article>
<h1 class="mainheading" id="h1top">Internet everywhere.</h1>
<p class="mainheading" id="h1bottom">For every<span id="glowh1">thing</span>.</p>
<p id="paragraph">Spend less time monitoring your IoT deployments and more time innovating. Hologram's cellular platform enables you to connect and manage any device, anywhere in the world.</p>
<div id="emailwithsubmit">
<input type="email" class="emailfeld" autocomplete="email" maxlength="256" name="Email" data-name="Email" placeholder="E-Mail-Adresse" id="email" data-validation="email required email length" required="" data-validation-event="keyup change" data-validation-length="max256">
<input type="submit" value="Get started" data-wait="Please wait..." class="c-button is--gradient w-button disabled" disabled="disabled" id="submitbtn">
</div>
</article>
<div id="floatingimages">
<img class="sideimages" id="ellipse" src="backgroundellipse.png" alt="ellipse">
<img class="sideimages" id="drohnepng" src="drohne.png" alt="drohne">
<img class="sideimages" id="cartpng" src="cart.png" alt="cart">
<img class="sideimages" id="rollerpng" src="roller.png" alt="roller">
</div>
</div>
</div>
</div>
<div id="mainpart2-3outer">
<div id="mainpart2">
<div id="cardcontainer">
<img id ="card" src="card.png" alt="card">
</div>
<div id="textmainpart2">
<h1 class="main2h1"> Testüberschrift: global IoT connectivity platform</h1>
<div class="main1h">
<h2 id="mainh-1">One global SIM card</h2>
<h2 id="mainh-2">Automatic carrier switching</h2>
</div>
<div class="main1p">
<p id="mainp-1">Connect to 470+ networks in 200 countries using a single hardware-agnostic SIM card or eSIM eUICC chip. </p>
<p id="mainp-2">Hologram SIMs automatically switch between local carriers to ensure you have top performance and never lose service.</p>
</div>
<div class="main2h">
<h2 id="mainh-3">Flexible, scalable pricing</h2>
<h2 id="mainh-4">Connectivity tools for your team</h2>
</div>
<div class="main2p">
<p id="mainp-3">No contracts, quotas, or negotiations. Activate, change, or pause plans anytime via our Hologram Dashboard or APIs.</p>
<p id="mainp-4">Collaboratively manage your fleet with ease via our easy-to-use Dashboard or our modern REST API.</p>
</div>
</div>
</div>
<div id="mainpart3">
<div class="contentmainpart3-1">
<img src="hyper.svg" alt="hyper">
<h1>Testüberschrift2: flexibility and coverage with Hyper</h1>
<p>Future-proof your SIMs and scale faster globally with Hyper, Hologram’s eUICC SIMs and platform. Hyper provides over-the-air, updatable access to Hologram’s full portfolio of IoT connectivity partners and profiles.</p>
<p>What is Hyper? --></p>
</div>
<div class="contentmainpart3-2">
<img src="image maincontent3.png" alt="ballwiththingsmainpart3right" height= "570px">
</div>
</div>
</div>
<div id="beforefootercentered">
<h1>Scaling connectivity has never been so easy</h1>
<p>The simplest way to get your IoT deployment connected worldwide.</p>
</div>
<div class="beforefootercolumncontent">
<div id="beforefootercolumncontent1">
<img src="antenne.svg" loading="lazy" alt="cell tower icon" class="beforefootericons">
<h3 class="">No hassles or headaches</h3>
<p class="">Focus on your product and data — not connectivity infrastructure, negotiations, and pricing.</p>
</div>
<div id="beforefootercolumncontent2">
<img src="speedometer.svg" loading="lazy" alt="dashboard icon" class="beforefootericons">
<h3 class="">Ready to grow your business</h3>
<p class="">Manage global deployments from a single connectivity platform with pricing that scales as you do.</p>
</div>
<div id="beforefootercolumncontent3">
<img src="settings.svg" loading="lazy" alt="gear icon" class="beforefootericons">
<h3 class="">All the tools you need</h3>
<p class="">Our Hologram Dashboard, REST API, and supported hardware make integrating connectivity easy.</p>
</div>
</div>
<footer>
<div id="mainfooterupper"></div>
<div class="footerbanner">
<div id="list1bannerouter">
<h2>Try Hologram today.</h2>
<ul id="list1banner">
<li class="item1">Free Sim</li>
<li class="item1">1 MB/mo free</li>
<li>Connect and scale in days</li>
</ul>
</div>
<div id="list2banner">
<div id="btn1">Sign up free<img id="pfeil" src="pfeil.svg"></div>
<div id="btn2">Contact sales <img id="pfeil" src="pfeil.svg"></div>
</div>
</div>
<div id="mainfooter">
<h1 id="placehold">Footer Items Soon</h1>
</div>
</footer>
</main>
</body>
</html>
Use this to your container[absolute] element
.container{
position: absolute;
/* For Vertically center */
top: 50%;
transform: translateY(-50%);
/* For Horizontally center */
left: 50%;
transform: translateX(-50%);
}
If You're using height and width without positioning use this
.container{
--height: 100px;
height: var(--height);
/* Horizontally Center */
margin: auto;
/* Vertically Center */
margin-top: calc(50% - var(--height));
}
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>