how to center image horizontally and vertically - html

I'm trying to center this icon inside its div but can't seem to do that.
I tried top: 50% but that doesnt work.
The class is ion-images and I know I can send a margin-top to it but I want to know how to properly set it in the middle.
body {
margin: 0;
}
.clearfix::after {
content: "";
display: table;
clear: both;
}
/*-------------------HEADER*----------------*/
header {
position: relative;
width: 100%;
height: 100vh;
}
.header-bg {
position: absolute;
width: 100%;
height: 100%;
background-image: url(main-bg.jpg);
background-size: cover;
background-position: center;
}
.header-wrapper {
position: absolute;
width: 100%;
height: 100%;
bottom: 0;
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
}
.title-wrapper {
position: relative;
width: 320px;
height: auto;
margin: 0 auto;
top: -10%;
}
.title-wrapper h1 {
text-align: center;
color: white;
letter-spacing: 5.45px;
margin-bottom: -10px;
font-size: 62px;
font-family: 'Raleway', sans-serif;
border-top: 3px solid white;
font-weight: 500;
}
.title-wrapper h3 {
text-align: center;
color: #35E2FF;
letter-spacing: 3.45px;
font-family: 'Raleway', sans-serif;
font-size: 15px;
}
.title-wrapper h2 {
color: white;
font-size: 50px;
margin-top: 80px;
font-family: 'Raleway', sans-serif;
}
.title-wrapper h4 {
color: white;
font-family: 'Raleway', sans-serif;
font-weight: 400;
text-align: center;
font-size: 25px;
margin-bottom: 50px;
}
#download {
text-align: center;
;
}
#demo:link {
text-decoration: none;
color: white;
border: 2px solid white;
text-align: center;
padding: 20px 40px;
text-transform: uppercase;
font-size: 25px;
font-family: 'Raleway', sans-serif;
transition: all 200ms ease-in-out;
-webkit-transition: all 200ms ease-in-out;
-moz-transition: all 200ms ease-in-out;
-o-transition: all 200ms ease-in-out;
}
#demo:hover {
background-color: #35E2FF;
}
/*------------------------------DESCRIPTION---------------*/
#description-wrapper {
position: relative;
width: 100%;
top: 0;
}
.desc-card {
position: relative;
width: 50%;
height: 450px;
margin: 0;
}
.desc-card.left {
float: left;
left: 0;
background-color: #000;
}
.desc-card.right {
float: right;
right: 0;
background-color: #282828;
}
#features-content {
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#features-content h3 {
color: white;
font-family: 'Raleway', sans-serif;
letter-spacing: 3.5px;
font-weight: 500;
font-size: 32px;
}
#features-content p {
color: white;
font-family: 'Raleway', sans-serif;
font-weight: 300;
letter-spacing: 3.5px;
}
#features-img {
position: absolute;
width: 100%;
height: 100%;
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
flex-direction: column;
}
.square {
width: 50%;
height: 50%;
}
.square.first {} .square.second {
background-color: #4A4A4A;
}
.square.third {
background-color: #4A4A4A;
}
.img-cont {
position: relative;
width: 100%;
height: 100%;
}
.ion-images {
/*THIS IS WHAT IM TRYING TO CENTER */
color: #35E2FF;
text-align: center;
font-size: 115px;
}
#under-img {
font-size: 25px;
color: #35E2FF;
margin-top: -10px;
font-family: 'Raleway', sans-serif;
font-weight: 300;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,500" rel="stylesheet">
<!----HEADER------>
<header>
<div class="header-bg"></div>
<div class="header-wrapper">
<div class="title-wrapper">
<h1>ATLAS</h1>
<h3>BETA</h3>
<h4>Create Professional Digital Design in any Operating System</h4>
<div id="download">Download Now
</div>
</div>
</div>
</header>
<div id="description-wrapper" class="clearfix">
<div class="desc-card left" id="features">
<div id="features-content">
<h3>The All In One Tool for Creative Designers In Any Operating System</h3>
<p>ATLAS provides users the best software to do what they do best. Design</p>
</div>
</div>
<div class="desc-card right" id="features-des">
<div id="features-img">
<div class="square first">
<div class="img-cont">
<div class="ion-images">
<!--Trying to center this--->
<p id="under-img">Photo Editing</p>
</div>
</div>
</div>
<div class="square second">
</div>
<div class="square third">
</div>
<div class="square fourth">
</div>
</div>
</div>
</div>

Try
.ion-images{ /*THIS IS WHAT IM TRYING TO CENTER */
color: #35E2FF;
text-align: center;
font-size: 115px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Reference

If you can use Flex, try whit this.
.ion-images {
height: 100%;
flex-direction: column;
display: flex;
align-items: center;
justify-content: center;
}
Hope can i help you. Regards.

Related

how to fix css height auto property not working

I am now working on a website for my discord bot i have 2 container in my website (container and container2) i set my height of my container and container2 to auto but there is a problem my container 2 height will work on mobile device (ie, css breakpoint with 600px) but now working on devices with breakpoint of 1024px the container is small in devices with 1024 breakpoints
my style.css
* {
margin: 0;
padding: 0;
}
#import url("https://fonts.googleapis.com/css2?family=Nunito:wght#700&family=Quicksand:wght#600&display=swap");
#import url("https://fonts.googleapis.com/css?family=Archivo:400,700");
#import url("https://fonts.googleapis.com/css2?family=Oswald&display=swap");
#import url("https://fonts.googleapis.com/css?family=Source+Code+Pro");
#import url("https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght#300&display=swap");
/*Desktop*/
:root{
--normal: linear-gradient(315deg, #90d5ec 0%, #fc575e 74%);
--darks: linear-gradient(315deg, #000106 0%, #000106 74%);
--text-theme: black;
}
.dark-theme{
--normal: linear-gradient(315deg, #000106 0%, #000106 74%);
--text-theme: white;
}
#media screen and (min-width: 1024px) and (max-width: 1300px) {
.container {
height: auto;
width: 100%;
background-image: var(--normal);
background-position: center;
background-size: cover;
padding-left: 5%;
padding-right: 5%;
box-sizing: border-box;
position: relative;
}
.title {
font-family: "Quicksand", sans-serif;
font-size: 72px;
color: var(--text-theme);
position: relative;
top: 200px;
margin-left: 200px;
user-select: none;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: black;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
color: #0087ca;
text-align: center;
font-family: "Nunito", sans-serif;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
color: #0087ca;
}
.title .img {
width: 400px;
height: 400px;
left: 600px;
bottom: 250px;
position: relative;
display: none;
}
.infotit {
font-size: 10px;
color: var(--text-theme);
}
.hover-underline-animation a {
display: inline-block;
position: relative;
color: #0087ca;
}
.hover-underline-animation a:after {
content: "";
position: absolute;
width: 100%;
transform: scaleX(0);
height: 6px;
bottom: 0;
left: 0;
background-color: #0087ca;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}
.hover-underline-animation a:hover:after {
transform: scaleX(1);
transform-origin: bottom left;
}
.trust {
font-size: 26px;
font-family: "Quicksand", sans-serif;
position: relative;
color: var(--text-theme);
text-align: center;
}
.info .quote {
font-size: 36px;
font-family: "Quicksand", sans-serif;
position: relative;
text-align: center;
bottom: 100px;
color: var(--text-theme);
}
.info .btn {
text-align: center;
position: relative;
}
.info .quoto {
text-align: center;
font-family: "Quicksand", sans-serif;
font-size: 36px;
bottom: 50px;
position: relative;
color: var(--text-theme);
}
.info .h11 {
text-align: center;
position: relative;
bottom: 20px;
font-family: "Quicksand", sans-serif;
font-size: 20px;
color: var(--text-theme);
}
.info .h11 .h33 {
color: red;
}
.info .h11 .muchmore_txt {
color: red;
}
.f_txt {
font-size: 26px;
color: var(--text-theme);
}
.more_txt {
font-size: 26px;
color: var(--text-theme);
}
.footer {
font-family: "Quicksand", sans-serif;
text-align: center;
background-color: gray;
height: 100px;
}
/*MORE CONTENTS*/
.container2 {
width: 100%;
height: 4500px;
background-color: rgba(39, 41, 52, 255);
}
.title2 {
font-size: 10px;
font-family: "Quicksand", sans-serif;
color: white;
text-align: center;
border-style: groove;
}
.hideme {
opacity: 0;
}
.minecraft {
float: right;
margin-top: 10%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.mcimg {
width: 605px;
height: 300px;
border-color: red;
}
.mcpara {
font-size: 15px;
}
.joke {
float: left;
margin-top: 40%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.jokeimg {
width: 805px;
height: 300px;
}
.jokepara {
font-size: 15px;
}
.roast {
float: right;
margin-top: 40%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.roastimg {
width: 705px;
height: 300px;
}
.roastpara {
font-size: 15px;
}
.animegif {
float: left;
margin-top: 40%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.animeimg {
width: 605px;
height: 300px;
}
.animapara {
font-size: 15px;
}
.meme {
float: right;
margin-top: 40%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.memeimg {
width: 705px;
height: 400px;
}
.memepara {
font-size: 15px;
}
.fact {
margin-top: 40%;
float: left;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.factimg {
width: 705px;
height: 200px;
}
.factpara {
font-size: 15px;
}
}
.anime {
font-size: 5vw;
cursor: cell;
line-height: 5.5vw;
}
#icon{
cursor: pointer;
width: 20px;
float: right;
margin-top: 10px;
margin-right: 10px;
}
.anime {
transition: color 3s;
transition-delay: 1s;
letter-spacing: -0.2vw;
}
.anime span:hover {
transition: color 0s;
}
.anime span:nth-child(1n):hover {
color: #9875e0;
}
.anime span:nth-child(2n):hover {
color: #53fbdd;
}
.anime span:nth-child(3n):hover {
color: #00a4dd;
}
.hideme {
opacity: 0;
}
/*Mobile*/
#media screen and (max-width: 600px) {
.container {
height: auto;
width: 100%;
background-image: var(--normal);
background-position: center;
background-size: cover;
padding-left: 5%;
padding-right: 5%;
box-sizing: border-box;
position: relative;
}
.title {
font-family: "Quicksand", sans-serif;
font-size: 72px;
color: var(--text-theme);
position: relative;
top: 200px;
margin-left: 200px;
user-select: none;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: black;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
color: #0087ca;
text-align: center;
font-family: "Nunito", sans-serif;
padding: 10px 12px;
text-decoration: none;
font-size: 15px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
color: #0087ca;
}
.title .img {
width: 400px;
height: 400px;
left: 600px;
bottom: 250px;
position: relative;
}
.infotit {
font-size: 10px;
color: var(--text-theme);
}
.hover-underline-animation a {
display: inline-block;
position: relative;
color: #0087ca;
}
.hover-underline-animation a:after {
content: "";
position: absolute;
width: 100%;
transform: scaleX(0);
height: 6px;
bottom: 0;
left: 0;
background-color: #0087ca;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}
.hover-underline-animation a:hover:after {
transform: scaleX(1);
transform-origin: bottom left;
}
.title .img {
display: none;
}
.title {
font-size: 42px;
position: relative;
right: 95px;
top: 100px;
text-align: center;
color: var(--text-theme);
}
.trust {
font-size: 16px;
font-family: "Quicksand", sans-serif;
position: relative;
top: 180px;
text-align: center;
color: var(--text-theme);
}
.info .quote {
font-size: 26px;
font-family: "Quicksand", sans-serif;
position: relative;
text-align: center;
color: var(--text-theme);
}
.info .btn {
text-align: center;
position: relative;
}
.info .quoto {
text-align: center;
font-family: "Quicksand", sans-serif;
font-size: 26px;
color: var(--text-theme);
}
.info .h11 {
text-align: center;
position: relative;
top: 20px;
font-family: "Quicksand", sans-serif;
font-size: 20px;
color: var(--text-theme);
}
.info .h11 .h33 {
color: red;
}
.info .h11 .muchmore_txt {
color: red;
font-size: 17px;
}
.footer {
font-family: "Quicksand", sans-serif;
text-align: center;
background-color: gray;
height: 100px;
}
.anime {
font-size: 8vw;
cursor: cell;
line-height: 5.5vw;
}
/*MORE CONTENTS*/
.container2 {
width: 100%;
height: auto;
background-color: rgba(39, 41, 52, 255);
}
.title2 {
font-size: 10px;
font-family: "Quicksand", sans-serif;
color: white;
text-align: center;
border-style: groove;
}
.hideme {
opacity: 0;
}
.minecraft {
margin-top: 10%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.mcimg {
width: 95%;
height: 80%;
border-color: red;
}
.mcpara {
font-size: 15px;
}
.joke {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.jokeimg {
width: 95%;
height: 80%;
}
.jokepara {
font-size: 15px;
}
.roast {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.roastimg {
width: 95%;
height: 80%;
}
.roastpara {
font-size: 15px;
}
.animegif {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.animeimg {
width: 95%;
height: 80%;
}
.animapara {
font-size: 15px;
}
.meme {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.memeimg {
width: 95%;
height: 80%;
}
.memepara {
font-size: 15px;
}
.fact {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.factimg {
width: 95%;
height: 80%;
}
.factpara {
font-size: 15px;
}
}
/*Tablets*/
#media screen and (min-width: 768px) and (max-width: 1023px) {
.container {
height: auto;
width: 100%;
background-image: var(--normal);
background-position: center;
background-size: cover;
padding-left: 5%;
padding-right: 5%;
box-sizing: border-box;
position: relative;
}
.title {
font-family: "Quicksand", sans-serif;
font-size: 72px;
color: black;
position: relative;
top: 200px;
margin-left: 200px;
user-select: none;
color: var(--text-theme);
}
/* Add a black background color to the top navigation */
.topnav {
background-color: black;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
color: #0087ca;
text-align: center;
font-family: "Nunito", sans-serif;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
color: #0087ca;
}
.title .img {
width: 400px;
height: 400px;
left: 600px;
bottom: 250px;
position: relative;
}
.infotit {
font-size: 10px;
color: var(--text-theme);
}
.hover-underline-animation a {
display: inline-block;
position: relative;
color: #0087ca;
}
.hover-underline-animation a:after {
content: "";
position: absolute;
width: 100%;
transform: scaleX(0);
height: 6px;
bottom: 0;
left: 0;
background-color: #0087ca;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}
.hover-underline-animation a:hover:after {
transform: scaleX(1);
transform-origin: bottom left;
}
.title .img {
display: none;
}
.title {
font-size: 42px;
position: relative;
right: 95px;
top: 100px;
text-align: center;
color: var(--text-theme);
}
.trust {
font-size: 16px;
font-family: "Quicksand", sans-serif;
position: relative;
top: 180px;
color: var(--text-theme);
text-align: center;
}
.info .quote {
font-size: 26px;
font-family: "Quicksand", sans-serif;
position: relative;
text-align: center;
color: var(--text-theme);
}
.info .btn {
text-align: center;
position: relative;
}
.info .quoto {
text-align: center;
font-family: "Quicksand", sans-serif;
font-size: 26px;
color: var(--text-theme);
}
.info .h11 {
text-align: center;
position: relative;
top: 20px;
font-family: "Quicksand", sans-serif;
font-size: 20px;
color: var(--text-theme);
}
.info .h11 .h33 {
color: red;
}
.info .h11 .muchmore_txt {
color: red;
}
.footer {
font-family: "Quicksand", sans-serif;
text-align: center;
background-color: gray;
height: 100px;
}
.anime {
font-size: 8vw;
cursor: cell;
line-height: 5.5vw;
}
/*MORE CONTENTS*/
.container2 {
width: 100%;
height: auto;
background-color: rgba(39, 41, 52, 255);
}
.title2 {
font-size: 10px;
font-family: "Quicksand", sans-serif;
color: white;
text-align: center;
border-style: groove;
}
.hideme {
opacity: 0;
}
.minecraft {
margin-top: 10%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.mcimg {
width: 95%;
height: 80%;
border-color: red;
}
.mcpara {
font-size: 15px;
}
.joke {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.jokeimg {
width: 95%;
height: 80%;
}
.jokepara {
font-size: 15px;
}
.roast {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.roastimg {
width: 95%;
height: 80%;
}
.roastpara {
font-size: 15px;
}
.animegif {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.animeimg {
width: 95%;
height: 80%;
}
.animapara {
font-size: 15px;
}
.meme {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.memeimg {
width: 95%;
height: 80%;
}
.memepara {
font-size: 15px;
}
.fact {
margin-top: 30%;
text-align: center;
font-size: 26px;
color: white;
font-family: "Nunito", sans-serif;
}
.factimg {
width: 95%;
height: 80%;
}
.factpara {
font-size: 15px;
}
}
dont read the whole style.css just check the one with breakpoint of 1024
my index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="btn.css">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1592285788506158"
crossorigin="anonymous"></script>
<meta name="author" content="CaptainBeast#1394">
<meta name="description" content="Beast Bot.beast bot is a moderation and fun bot for your discord server make your discord server a fun and safe place">
<meta name="keywords" content="Discord bot, bot,beast bot,server,discord server">
<link rel="stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="google-site-verification" content="VbhoNStFz2rn8d52JV_RzL_0uAG7thWedllzb16m-wA" />
<link rel="icon" href="images/kisspng-portable-network-graphics-computer-icons-transpare-braingoodgames-5c9d9c5093e378.8617067815538330406058.png" type="image/x-icon">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript">
</script>
<div class="topnav">
<div class="hover-underline-animation">
<a class="active" href="index.html">Home</a>
Contact
About Us
Status
<img src="images/moon.png" id="icon">
</div>
</div>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Beast Bot</title>
</head>
<body>
<div class="container">
<div class="title">
<p class="infotit">Hover the title</p>
<P class="anime"><span>Beast Bot :)</span></P>
<div class="hideme">
<img class="img" src="images/kisspng-portable-network-graphics-computer-icons-transpare-braingoodgames-5c9d9c5093e378.8617067815538330406058.png">
</div>
</div>
<div class="hide me">
<h1 class="trust">Trusted by 10,000+ people</h1>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="hideme">
<div class="info">
<div class="hideme">
<p class="quote">A perfect moderation and fun bot<br>for your Discord Server</p>
</div>
<div class="btn">
<button onclick="location.href='https://discord.com/api/oauth2/authorize?client_id=876824416531664896&permissions=536870907895&scope=bot'" class="bttn-slant bttn-lg bttn-royal">Invite</button>
</div>
<br>
<BR>
<br>
<p class="quoto">Beast Bot is trusted by more than 10,000 people</p>
<div class="h11">
<h1>Features</h1>
<br>
<h3 class="h33">Moderation</h3>
<img src="images/features.png" class="features_img">
<p class="f_txt">A perfect moderation bot for your discord server with commands like ban,kick,mute,lock</p>
<br>
<br>
<h3 class="muchmore_txt">Much More</h3>
<img src="images/muchmore.png" class="muchmore">
<P class="more_txt">Many more fun and anime commands like animegif,meme,cute and many more</P>
</div>
</div>
</div>
<br>
<br>
</div>
<!--Updates-->
<div class="container2">
<div class="hideme">
<div class="title2">
<h1>The bot that makes your server a safe place</h1>
</div>
</div>
<div class="minecraft">
<p class="hideme" >Get status of any minecraft servers</p>
<div class="hideme">
<img class="mcimg" src="images/mcstats.PNG">
<div class="mcpara">
<p class="hideme">Beast bot gives you the ability to know the status of any minecraft server</p>
</div>
</div>
</div>
<div class="joke">
<p class="hideme">Have a nice laugh everyday</p>
<div class="hideme">
<img class="jokeimg" src="images/joke.PNG">
</div>
<div class="jokepara">
<p class="hideme">Have a good laugh every day with a Beast Bot use $joke for joke </p>
</div>
</div>
<div class="roast">
<p class="hideme">Roast your friends</p>
<div class="hideme">
<img class="roastimg" src="images/roast.PNG">
</div>
<div class="roastpara">
<p class="hideme">Hmm.Want a revenge on your firend do $roast #user to take a revenge on him</p>
</div>
</div>
<div class="animegif">
<p class="hideme">Sad anime gif</p>
<div class="hideme">
<img class="animeimg" src="https://media.tenor.com/images/8fef3aa41f9d27021e5f4105a7bd6768/tenor.gif">
</div>
<div class="animapara">
<P class="hideme">Sad :( emotional anime gif :( do $animegif</P>
</div>
</div>
<div class="meme">
<p class="hideme">Memes</p>
<div class="hideme">
<img class="memeimg" src="images/meme.jpeg">
</div>
<div class="memepara">
<P class="hideme">Cool memes for your discord server</P>
</div>
</div>
<div class="fact">
<p class="hideme">Random Facts</p>
<div class="hideme">
<img class="factimg" src="images/fact.PNG">
</div>
<div class="factpara">
<p class="hideme">Some cool random fact for you do $fact</p>
</div>
</div>
</div>
<script src="script.js"></script>
<script>
var icon = document.getElementById("icon");
icon.onclick = function(){
document.body.classList.toggle("dark-theme");
if(document.body.classList.contains("dark-theme")){
icon.src = "images/sun.png";
}else{
icon.src = "images/moon.png"
}
}
</script>
</body>
<script src="cookies.js"></script>
<div class="footer">
<br>
<br>
<footer><P><i class="fa fa-github" ></i> <i class="fa fa-copyright"></i> CaptainBeast#1394 - 2021</P></footer>
Join our official server
</div>
</html>
Here is a image of the problem - container2 is the thing with the text "The bot that makes your server a safe place"

How to show half of the middle section when scrolled to the top and bottom of the page?

I've written this code for a simple html page in which there are three sections. The top(first) and bottom(third) are full screen sections and the middle section has to be shown with both the top and bottom sections i.e., the upper half of the middle section with the top section and the bottom half with the third section.
I was able to show the first part correctly(when scroll position is at the top) but not the second part(which is when scroll position at the bottom).
Can anybody tell me how can I achieve that?
Full page: https://i.imgur.com/YDV1usM.png
When scroll position is at the top: https://i.imgur.com/Mngkqth.png
When scroll position is at the bottom: https://i.imgur.com/wugOxCY.png
* {
font-family: monospace;
}
h2 {
font-size: 100px;
font-family: monospace;
}
.section-1, .section-3 {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.section-2 h6 {
font-size: 18px;
position: relative;
margin: 80px 0 !important;
}
.section-2 p {
font-size: 20px;
position: relative;
}
.section-2 {
text-align: center;
margin-top: -145px;
}
.section-2 h6:after {
content: '';
position: absolute;
height: 60px;
width: 1px;
background: #000;
left: 50%;
top: 30px;
}
<div class="section-1">
<h2>SECTION 1</h2>
</div>
<div class="section-2">
<h6>Scroll</h6>
<p>Studio Liana Lalush</p>
</div>
<div class="section-3">
<h2>SECTION 3</h2>
</div>
Are you expecting like this:
Note: check out my answer in full screen mode
Demo:
* {
font-family: monospace;
}
h2 {
font-size: 100px;
font-family: monospace;
}
.section-1,
.section-3 {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.section-2 h6 {
font-size: 18px;
position: relative;
margin: 70px 0 !important;
}
.section-2 p {
font-size: 20px;
position: relative;
}
.section-2 {
text-align: center;
position: absolute;
top: 98%;
left: 50%;
transform: translate(-50%, -50%);
}
.section-2 h6:after {
content: '';
position: absolute;
height: 60px;
width: 1px;
background: #000;
left: 50%;
top: 25px;
}
<div class="section-1">
<h2>SECTION 1</h2>
</div>
<div class="section-2">
<h6>Scroll</h6>
<p>Studio Liana Lalush</p>
</div>
<div class="section-3">
<h2>SECTION 3</h2>
</div>
Try with this code. You only need to change in css code.
* {
font-family: monospace;
}
h2 {
font-size: 100px;
font-family: monospace;
}
.section-1 {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.section-3{
height: 90vh;
display: flex;
align-items: center;
justify-content: center;
}
.section-2 h6 {
font-size: 18px;
position: relative;
margin: 80px 0 !important;
}
.section-2 p {
font-size: 20px;
position: relative;
}
.section-2 {
text-align: center;
margin-top: -145px;
}
.section-2 h6:after {
content: '';
position: absolute;
height: 60px;
width: 1px;
background: #000;
left: 50%;
top: 30px;
}

Why is the text being pushed up?

I'm writing code for a new website. But I'm trying to fix a problem with one part of the webpage. The problem happens with text.
Everything is fine other than this div -
"statementtext-text-form-pgmiddle".
The text always gets pushed up and then to the right. I need the text to be aligned in the center just like the rest of the webpage. The text is ok only when the size of the window is very small. I was digging into the CSS code and can't find out why it happens. I've tried playing with padding and margin but without any results.
I know I could give you only the part of the code with that element but as I don't know where the issue is I can't really clear it.
#font-face {
font-family: 'familiar_probold';
src: url('fonts/FamiliarPro/familiar_pro-bold-webfont.woff2') format('woff2'), url('fonts/FamiliarPro/familiar_pro-bold-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'uni_sansheavy_caps';
src: url('fonts/UniSansHeavy/uni_sans_heavy-webfont.woff2') format('woff2'), url('fonts/UniSansHeavy/uni_sans_heavy-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'source_sans_problack';
src: url('fonts/SourceSans/sourcesanspro-black-webfont.woff2') format('woff2'), url('fonts/SourceSans/sourcesanspro-black-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
html {
scroll-behavior: smooth;
}
* {
margin: 0;
padding: 0;
}
*,
*::before,
*::after {
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
background: url("images/background.jpg");
background-size: cover;
font-family: sans-serif;
}
img {
width: 100%;
height: auto;
}
.navbar {
width: 100%;
background-color: #000;
}
.container {
max-width: 1140px;
margin: 0 auto;
height: 60px;
display: flex;
flex-wrap: wrap;
}
._Logo {
overflow: hidden;
text-align: center;
flex-basis: 230px;
}
._Logo img {
height: 100% !important;
width: 150px !important;
}
._Menus ul {
display: flex;
list-style: none;
padding: 0;
margin: 0;
flex-wrap: wrap;
}
._Menus ul li a {
display: block;
padding: 0 10px;
height: 60px;
line-height: 60px;
text-decoration: none;
color: #FFF;
outline: none;
font-family: 'uni_sansheavy_caps';
}
._Menus ul li a:hover {
background-color: #FFF;
color: #000;
}
._Iconbar {
display: none;
background-color: #000;
}
.menu-bar {
width: 45px;
align-self: center;
cursor: pointer;
}
.icon-bar {
height: 3px;
width: 100%;
background: #FFF;
margin: 7px 0;
display: block;
border-radius: 2px;
}
.image-background-cover-pgtop {
background-image: url("images/awpasiimov.jpeg");
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.container-element-unified-pgtop .container-text-informationwebsite-pgtop {
position: relative;
padding-top: 10%;
padding-left: 10%;
padding-bottom: 1%;
font-family: 'familiar_probold';
font-size: 200%;
color: grey;
}
.container-element-unified-pgtop .container-text-informationlow-pgtop {
position: relative;
padding-left: 10%;
font-family: 'uni_sansheavy_caps';
font-size: 500%;
color: white;
}
.container-element-unified-pgtop .container-text-informationtime-pgtop {
position: relative;
padding-left: 10%;
font-family: 'uni_sansheavy_caps';
font-size: 500%;
color: #82359C;
/* border-bottom: 6px solid #DCC98E;*/
padding-bottom: 1%;
}
.container-line-form-pgtop {
background: #82359C;
height: 6px;
border: none;
width: 45%;
margin-left: 10%;
position: relative;
}
.container-element-unified-pgtop-2 {
padding-top: 1%;
}
.container-element-unified-pgtop-2 .container-text-informationhow-pgtop a {
position: relative;
padding-left: 10%;
font-family: familiar_probold;
font-size: 200%;
color: #ffccff;
/*border-bottom: 3px solid #B9CDBE;*/
padding-bottom: 3px;
text-decoration: none;
}
.container-element-unified-pgtop-2 .container-text-informationcheck-pgtop {
position: relative;
padding-top: 2%;
padding-left: 10%;
font-family: 'Arial';
font-size: 200%;
color: white;
padding-bottom: 10%;
}
.container-form-line {
background: #82359C;
height: 8px;
border: none;
}
.icons-image-form-pgmiddle {
padding-top: 2%;
vertical-align: center;
text-align: center;
}
.wideicon-image-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
}
.safetyicon-image-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
}
.freeicon-image-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
}
.container-element-unified-pgmiddle {
padding-top: 2%;
padding-bottom: 2%;
vertical-align: center;
text-align: center;
}
.container-element-unified-pgmiddle .widetext-text-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
font-size: 150%;
font-family: familiar_probold;
color: #1B1C1E;
}
.widetext-text-form-pgmiddle br {
font-family: Arial;
}
.safetytext-text-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
font-family: familiar_probold;
font-size: 150%;
color: #1B1C1E;
}
.safetytext-text-form-pgmiddle br {
font-family: Arial;
}
.freetext-text-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
font-family: familiar_probold;
font-size: 150%;
color: #1B1C1E;
}
.tutorialtext-text-form-pgmiddle {
padding-top: 3%;
padding-bottom: 3%;
text-align: center;
font-family: 'uni_sansheavy_caps';
color: #1B1C1E;
font-size: 350%;
width: 100%;
}
.tutorialtext-text-form-pgmiddle p {
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
font-family: 'Arial';
color: grey;
font-size: 50%;
width: 100%;
}
.circles {
margin: 0 auto;
}
.circles>div {
overflow: hidden;
float: left;
width: auto;
height: auto;
position: relative;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
}
.circles>div>div {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
font-family: 'uni_sansheavy_caps';
font-size: 300%;
color: grey;
}
.circles>div>div>div {
display: table;
width: 100%;
height: 100%;
}
.circles>div>div>div>div {
display: table-cell;
text-align: center;
vertical-align: middle;
}
#media (max-width: 320px) {
.circles>div {
padding: 50%;
}
}
#media (min-width: 321px) and (max-width: 800px) {
.circles>div {
padding: 25%;
}
}
#media (min-width: 801px) {
.circles {
width: 800px
}
.circles>div {
padding: 12.5%;
}
}
.circlescontent {
margin: 0 auto;
}
.circlescontent>div {
overflow: hidden;
float: left;
width: auto;
height: auto;
position: relative;
}
.circlescontent>div>div {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
font-family: familiar_probold;
font-size: 200%;
color: grey;
}
.circlescontent>div>div>div {
display: table;
width: 100%;
height: 100%;
}
.circlescontent>div>div>div>div {
display: table-cell;
text-align: center;
vertical-align: middle;
}
#media (max-width: 320px) {
.circlescontent>div {
padding: 50%;
}
}
#media (min-width: 321px) and (max-width: 800px) {
.circlescontent>div {
padding: 25%;
}
}
#media (min-width: 801px) {
.circlescontent {
width: 800px
}
.circlescontent>div {
padding: 12.5%;
}
}
.container-form-pgmiddle {
padding-top: 4%;
padding-bottom: 4%;
}
.statementtext-text-form-pgmiddle {
text-align: center;
left: 50%;
font-family: 'uni_sansheavy_caps';
color: #1B1C1E;
font-size: 390%;
width: 100%;
}
.statementtext-text-form-pgmiddle p {
padding-top: 20px;
padding-bottom: 0;
text-align: center;
left: 50%;
font-family: familiar_probold;
color: white;
font-size: 50%;
width: 100%;
color: grey;
}
.statementtextdescription-text-form-pgmiddle {
padding-top: 4%;
padding-bottom: 4%;
text-align: center;
font-family: 'uni_sansheavy_caps';
color: #1B1C1E;
font-size: 350%;
}
.buttonbkg {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
height: 20vh;
padding-bottom: 4%;
}
.button {
width: 320px;
max-width: 100%;
overflow: hidden;
position: relative;
transform: translatez(0);
text-decoration: none;
box-sizing: border-box;
font-size: 130%;
font-weight: normal;
font-family: familiar_probold;
color: white;
box-shadow: 0 9px 18px rgba(0, 0, 0, 0.2);
display: inline-block;
margin: 3%;
align-content: center;
}
.steam {
text-align: center;
border-radius: 50px;
padding: 26px;
color: white;
background: #BD3381;
transition: all 0.2s ease-out 0s;
display: flex;
justify-content: center;
align-items: center;
}
.gradient {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
bottom: auto;
margin: auto;
z-index: -1;
background: radial-gradient(90px circle at top center, rgba(238, 88, 63, .8) 30%, rgba(255, 255, 255, 0));
transition: all 0s ease-out 0s;
transform: translatex(-140px);
animation: 18s linear 0s infinite move;
display: inline-block;
align-content: center;
}
.container-form-pgend {
background-color: #1B1C1E;
padding-top: 1.125%;
padding-bottom: 1.125%;
position: relative;
}
.text-form-pgend-rights {
color: white;
margin-left: 1.5%;
font-family: familiar_probold;
font-size: 107.5%;
position: relative;
}
#keyframes move {
0% {
transform: translatex(-140px);
}
25% {
transform: translatex(140px);
opacity: 0.3;
}
50% {
transform: translatex(140px);
opacity: 1;
background: radial-gradient(90px circle at bottom center, rgba(238, 88, 63, .5) 30%, rgba(255, 255, 255, 0));
}
75% {
transform: translatex(-140px);
opacity: 0.3;
}
100% {
opacity: 1;
transform: translatex(-140px);
background: radial-gradient(90px circle at top center, rgba(238, 88, 63, .5) 30%, rgba(255, 255, 255, 0));
}
}
#media (max-width: 900px) {
._Logo {
height: 60px;
}
._Menus {
flex: 100%;
background: #333;
height: 0;
overflow: hidden;
}
._Menus ul {
flex-direction: column;
}
._Menus ul li a {
height: 40px;
font-size: 14px;
text-transform: uppercase;
line-height: 40px;
}
._Menus ul li a:hover {
background-color: #81d742;
color: #FFF;
}
.container {
justify-content: space-between;
}
._Iconbar {
display: flex;
margin-right: 10px;
}
._Menus-show {
height: auto;
}
.brandimage {
display: none;
}
#media (max-width: 600px) {
._Logo {
height: 60px;
}
._Menus {
flex: 100%;
background: #333;
height: 0;
overflow: hidden;
}
._Menus ul {
flex-direction: column;
}
._Menus ul li a {
height: 40px;
font-size: 14px;
text-transform: uppercase;
line-height: 40px;
}
._Menus ul li a:hover {
background-color: #81d742;
color: #FFF;
}
.container {
justify-content: space-between;
}
._Iconbar {
display: flex;
margin-right: 10px;
}
._Menus-show {
height: auto;
}
.brandimage {
display: none;
}
}
}
<nav class="navbar">
<div class="container">
<section class="_Logo"><img src="images/brand.png" alt="REFF SKINS"></section>
<section class="_Iconbar">
<span class="menu-bar" onclick="showHide()">
<i class="icon-bar"></i>
<i class="icon-bar"></i>
<i class="icon-bar"></i>
</span>
</section>
<section class="_Menus" id="nav-lists">
<ul>
<li>ABOUT</li>
<li>HOW IT WORKS</li>
<li>FAQ</li>
<li>AVAILABLE SKINS</li>
<li>SIGN IN THROUGH STEAM</li>
</ul>
</section>
</div>
</nav>
<div class="image-background-cover-pgtop">
<div class="container-element-unified-pgtop">
<div class="container-text-informationwebsite-pgtop">WEBSITE WITH TRULY FREE SKINS</div>
<div class="container-text-informationlow-pgtop">LOW ON SKINS?</div>
<div class="container-text-informationtime-pgtop">TIME TO GET NEW FREE!</div>
<div class="container-line-form-pgtop"></div>
</div>
<div class="container-element-unified-pgtop-2">
<div class="container-text-informationhow-pgtop">HOW IS THIS WORKING?</div>
<div class="container-text-informationcheck-pgtop">check how it works page or visit our YouTube</div>
</div>
</div>
<div class="container-form-line"></div>
<div class="icons-image-form-pgmiddle">
<img class="wideicon-image-form-pgmiddle" src="images/searchicon.svg" alt="Easy Search">
<img class="safetyicon-image-form-pgmiddle" src="images/simpleicon.svg" alt="Super Simple">
<img class="freeicon-image-form-pgmiddle" src="images/rewards.svg" alt="Easy Rewards">
</div>
<div class="container-element-unified-pgmiddle">
<div class="widetext-text-form-pgmiddle">WIDE
<p>SKINS SUPPLY</p>
</div>
<div class="safetytext-text-form-pgmiddle">SAFETY<br>GUARANTEED</div>
<div class="freetext-text-form-pgmiddle">FREE<br>USER REWARDS</div>
</div>
<div class="tutorialtext-text-form-pgmiddle">HOW CAN I DO IT?
<p>If you want your new skins complete the four easy steps.</p>
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
1.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
2.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
3.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
4.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
SIGN IN WITH STEAM
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
DO THE REFERR PROCESS
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
CHOOSE WANTED SKINS
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
GET YOUR SKINS
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="container-form-pgmiddle"></div>
<div class="statementtext-text-form-pgmiddle">EASY AS THAT
<p>NO DEPOSITS, NO PAYMENT METHODS, NO RISKY GAMBLING, NO SKINS HOLDING</p>
</div>
<div class="statementtextdescription-text-form-pgmiddle">WE SAID NO TO CATCHES!</div>
<div class="buttonbkg">
<span class="gradient"></span>SIGN IN WITH STEAM
<span class="gradient"></span>AVAILABLE SKINS
<span class="gradient"></span>HOW IT WORKS
</div>
<div class="container-form-line"></div>
<div class="container-form-pgend">
<div class="text-form-pgend-rights">©2018-2019 “REFF SKINS” ALL RIGHTS RESERVED. FREE SKINS SERVICE.</div>
</div>
The issue is with the floated div inside each .circles and .cirlcescontent elements. They are being floated but they are not being cleared afterwards, so the rest of the document flow is breaking.
I have just added a wrapper around each group of .cirlces and .circlescontent and applied a :after pseudo element with clear:both;.
#font-face {
font-family: 'familiar_probold';
src: url('fonts/FamiliarPro/familiar_pro-bold-webfont.woff2') format('woff2'), url('fonts/FamiliarPro/familiar_pro-bold-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'uni_sansheavy_caps';
src: url('fonts/UniSansHeavy/uni_sans_heavy-webfont.woff2') format('woff2'), url('fonts/UniSansHeavy/uni_sans_heavy-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'source_sans_problack';
src: url('fonts/SourceSans/sourcesanspro-black-webfont.woff2') format('woff2'), url('fonts/SourceSans/sourcesanspro-black-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
/* ####### ADDED CSS START ####### */
.clearme:after {
content:"";
display:table;
clear:both;
}
/* ####### ADDED CSS END ####### */
html {
scroll-behavior: smooth;
}
* {
margin: 0;
padding: 0;
}
*,
*::before,
*::after {
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
background: url("images/background.jpg");
background-size: cover;
font-family: sans-serif;
}
img {
width: 100%;
height: auto;
}
.navbar {
width: 100%;
background-color: #000;
}
.container {
max-width: 1140px;
margin: 0 auto;
height: 60px;
display: flex;
flex-wrap: wrap;
}
._Logo {
overflow: hidden;
text-align: center;
flex-basis: 230px;
}
._Logo img {
height: 100% !important;
width: 150px !important;
}
._Menus ul {
display: flex;
list-style: none;
padding: 0;
margin: 0;
flex-wrap: wrap;
}
._Menus ul li a {
display: block;
padding: 0 10px;
height: 60px;
line-height: 60px;
text-decoration: none;
color: #FFF;
outline: none;
font-family: 'uni_sansheavy_caps';
}
._Menus ul li a:hover {
background-color: #FFF;
color: #000;
}
._Iconbar {
display: none;
background-color: #000;
}
.menu-bar {
width: 45px;
align-self: center;
cursor: pointer;
}
.icon-bar {
height: 3px;
width: 100%;
background: #FFF;
margin: 7px 0;
display: block;
border-radius: 2px;
}
.image-background-cover-pgtop {
background-image: url("images/awpasiimov.jpeg");
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.container-element-unified-pgtop .container-text-informationwebsite-pgtop {
position: relative;
padding-top: 10%;
padding-left: 10%;
padding-bottom: 1%;
font-family: 'familiar_probold';
font-size: 200%;
color: grey;
}
.container-element-unified-pgtop .container-text-informationlow-pgtop {
position: relative;
padding-left: 10%;
font-family: 'uni_sansheavy_caps';
font-size: 500%;
color: white;
}
.container-element-unified-pgtop .container-text-informationtime-pgtop {
position: relative;
padding-left: 10%;
font-family: 'uni_sansheavy_caps';
font-size: 500%;
color: #82359C;
/* border-bottom: 6px solid #DCC98E;*/
padding-bottom: 1%;
}
.container-line-form-pgtop {
background: #82359C;
height: 6px;
border: none;
width: 45%;
margin-left: 10%;
position: relative;
}
.container-element-unified-pgtop-2 {
padding-top: 1%;
}
.container-element-unified-pgtop-2 .container-text-informationhow-pgtop a {
position: relative;
padding-left: 10%;
font-family: familiar_probold;
font-size: 200%;
color: #ffccff;
/*border-bottom: 3px solid #B9CDBE;*/
padding-bottom: 3px;
text-decoration: none;
}
.container-element-unified-pgtop-2 .container-text-informationcheck-pgtop {
position: relative;
padding-top: 2%;
padding-left: 10%;
font-family: 'Arial';
font-size: 200%;
color: white;
padding-bottom: 10%;
}
.container-form-line {
background: #82359C;
height: 8px;
border: none;
}
.icons-image-form-pgmiddle {
padding-top: 2%;
vertical-align: center;
text-align: center;
}
.wideicon-image-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
}
.safetyicon-image-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
}
.freeicon-image-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
}
.container-element-unified-pgmiddle {
padding-top: 2%;
padding-bottom: 2%;
vertical-align: center;
text-align: center;
}
.container-element-unified-pgmiddle .widetext-text-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
font-size: 150%;
font-family: familiar_probold;
color: #1B1C1E;
}
.widetext-text-form-pgmiddle br {
font-family: Arial;
}
.safetytext-text-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
font-family: familiar_probold;
font-size: 150%;
color: #1B1C1E;
}
.safetytext-text-form-pgmiddle br {
font-family: Arial;
}
.freetext-text-form-pgmiddle {
width: 15%;
height: auto;
margin-left: 5%;
margin-right: 5%;
display: inline-block;
font-family: familiar_probold;
font-size: 150%;
color: #1B1C1E;
}
.tutorialtext-text-form-pgmiddle {
padding-top: 3%;
padding-bottom: 3%;
text-align: center;
font-family: 'uni_sansheavy_caps';
color: #1B1C1E;
font-size: 350%;
width: 100%;
}
.tutorialtext-text-form-pgmiddle p {
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
font-family: 'Arial';
color: grey;
font-size: 50%;
width: 100%;
}
.circles {
margin: 0 auto;
}
.circles>div {
overflow: hidden;
float: left;
width: auto;
height: auto;
position: relative;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
}
.circles>div>div {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
font-family: 'uni_sansheavy_caps';
font-size: 300%;
color: grey;
}
.circles>div>div>div {
display: table;
width: 100%;
height: 100%;
}
.circles>div>div>div>div {
display: table-cell;
text-align: center;
vertical-align: middle;
}
#media (max-width: 320px) {
.circles>div {
padding: 50%;
}
}
#media (min-width: 321px) and (max-width: 800px) {
.circles>div {
padding: 25%;
}
}
#media (min-width: 801px) {
.circles {
width: 800px
}
.circles>div {
padding: 12.5%;
}
}
.circlescontent {
margin: 0 auto;
}
.circlescontent>div {
overflow: hidden;
float: left;
width: auto;
height: auto;
position: relative;
}
.circlescontent>div>div {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
font-family: familiar_probold;
font-size: 200%;
color: grey;
}
.circlescontent>div>div>div {
display: table;
width: 100%;
height: 100%;
}
.circlescontent>div>div>div>div {
display: table-cell;
text-align: center;
vertical-align: middle;
}
#media (max-width: 320px) {
.circlescontent>div {
padding: 50%;
}
}
#media (min-width: 321px) and (max-width: 800px) {
.circlescontent>div {
padding: 25%;
}
}
#media (min-width: 801px) {
.circlescontent {
width: 800px
}
.circlescontent>div {
padding: 12.5%;
}
}
.container-form-pgmiddle {
padding-top: 4%;
padding-bottom: 4%;
}
.statementtext-text-form-pgmiddle {
text-align: center;
left: 50%;
font-family: 'uni_sansheavy_caps';
color: #1B1C1E;
font-size: 390%;
width: 100%;
}
.statementtext-text-form-pgmiddle p {
padding-top: 20px;
padding-bottom: 0;
text-align: center;
left: 50%;
font-family: familiar_probold;
color: white;
font-size: 50%;
width: 100%;
color: grey;
}
.statementtextdescription-text-form-pgmiddle {
padding-top: 4%;
padding-bottom: 4%;
text-align: center;
font-family: 'uni_sansheavy_caps';
color: #1B1C1E;
font-size: 350%;
}
.buttonbkg {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
height: 20vh;
padding-bottom: 4%;
}
.button {
width: 320px;
max-width: 100%;
overflow: hidden;
position: relative;
transform: translatez(0);
text-decoration: none;
box-sizing: border-box;
font-size: 130%;
font-weight: normal;
font-family: familiar_probold;
color: white;
box-shadow: 0 9px 18px rgba(0, 0, 0, 0.2);
display: inline-block;
margin: 3%;
align-content: center;
}
.steam {
text-align: center;
border-radius: 50px;
padding: 26px;
color: white;
background: #BD3381;
transition: all 0.2s ease-out 0s;
display: flex;
justify-content: center;
align-items: center;
}
.gradient {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
bottom: auto;
margin: auto;
z-index: -1;
background: radial-gradient(90px circle at top center, rgba(238, 88, 63, .8) 30%, rgba(255, 255, 255, 0));
transition: all 0s ease-out 0s;
transform: translatex(-140px);
animation: 18s linear 0s infinite move;
display: inline-block;
align-content: center;
}
.container-form-pgend {
background-color: #1B1C1E;
padding-top: 1.125%;
padding-bottom: 1.125%;
position: relative;
}
.text-form-pgend-rights {
color: white;
margin-left: 1.5%;
font-family: familiar_probold;
font-size: 107.5%;
position: relative;
}
#keyframes move {
0% {
transform: translatex(-140px);
}
25% {
transform: translatex(140px);
opacity: 0.3;
}
50% {
transform: translatex(140px);
opacity: 1;
background: radial-gradient(90px circle at bottom center, rgba(238, 88, 63, .5) 30%, rgba(255, 255, 255, 0));
}
75% {
transform: translatex(-140px);
opacity: 0.3;
}
100% {
opacity: 1;
transform: translatex(-140px);
background: radial-gradient(90px circle at top center, rgba(238, 88, 63, .5) 30%, rgba(255, 255, 255, 0));
}
}
#media (max-width: 900px) {
._Logo {
height: 60px;
}
._Menus {
flex: 100%;
background: #333;
height: 0;
overflow: hidden;
}
._Menus ul {
flex-direction: column;
}
._Menus ul li a {
height: 40px;
font-size: 14px;
text-transform: uppercase;
line-height: 40px;
}
._Menus ul li a:hover {
background-color: #81d742;
color: #FFF;
}
.container {
justify-content: space-between;
}
._Iconbar {
display: flex;
margin-right: 10px;
}
._Menus-show {
height: auto;
}
.brandimage {
display: none;
}
#media (max-width: 600px) {
._Logo {
height: 60px;
}
._Menus {
flex: 100%;
background: #333;
height: 0;
overflow: hidden;
}
._Menus ul {
flex-direction: column;
}
._Menus ul li a {
height: 40px;
font-size: 14px;
text-transform: uppercase;
line-height: 40px;
}
._Menus ul li a:hover {
background-color: #81d742;
color: #FFF;
}
.container {
justify-content: space-between;
}
._Iconbar {
display: flex;
margin-right: 10px;
}
._Menus-show {
height: auto;
}
.brandimage {
display: none;
}
}
}
<nav class="navbar">
<div class="container">
<section class="_Logo"><img src="images/brand.png" alt="REFF SKINS"></section>
<section class="_Iconbar">
<span class="menu-bar" onclick="showHide()">
<i class="icon-bar"></i>
<i class="icon-bar"></i>
<i class="icon-bar"></i>
</span>
</section>
<section class="_Menus" id="nav-lists">
<ul>
<li>ABOUT</li>
<li>HOW IT WORKS</li>
<li>FAQ</li>
<li>AVAILABLE SKINS</li>
<li>SIGN IN THROUGH STEAM</li>
</ul>
</section>
</div>
</nav>
<div class="image-background-cover-pgtop">
<div class="container-element-unified-pgtop">
<div class="container-text-informationwebsite-pgtop">WEBSITE WITH TRULY FREE SKINS</div>
<div class="container-text-informationlow-pgtop">LOW ON SKINS?</div>
<div class="container-text-informationtime-pgtop">TIME TO GET NEW FREE!</div>
<div class="container-line-form-pgtop"></div>
</div>
<div class="container-element-unified-pgtop-2">
<div class="container-text-informationhow-pgtop">HOW IS THIS WORKING?</div>
<div class="container-text-informationcheck-pgtop">check how it works page or visit our YouTube</div>
</div>
</div>
<div class="container-form-line"></div>
<div class="icons-image-form-pgmiddle">
<img class="wideicon-image-form-pgmiddle" src="images/searchicon.svg" alt="Easy Search">
<img class="safetyicon-image-form-pgmiddle" src="images/simpleicon.svg" alt="Super Simple">
<img class="freeicon-image-form-pgmiddle" src="images/rewards.svg" alt="Easy Rewards">
</div>
<div class="container-element-unified-pgmiddle">
<div class="widetext-text-form-pgmiddle">WIDE
<p>SKINS SUPPLY</p>
</div>
<div class="safetytext-text-form-pgmiddle">SAFETY<br>GUARANTEED</div>
<div class="freetext-text-form-pgmiddle">FREE<br>USER REWARDS</div>
</div>
<div class="tutorialtext-text-form-pgmiddle">HOW CAN I DO IT?
<p>If you want your new skins complete the four easy steps.</p>
</div>
<!-- Added wrapper START -->
<div class="clearme">
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
1.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
2.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
3.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circles">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
4.
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
</div>
<!-- Added wrapper END -->
<!-- Added wrapper START -->
<div class="clearme">
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
SIGN IN WITH STEAM
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
DO THE REFERR PROCESS
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
CHOOSE WANTED SKINS
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
<div class="circlescontent">
<div>
<div>
<div>
<div>
<!-- BEG Content -->
GET YOUR SKINS
<!-- END Content -->
</div>
</div>
</div>
</div>
<!-- ditto the above 3 more times -->
</div>
</div>
<!-- Added wrapper END -->
<div class="container-form-pgmiddle"></div>
<div class="statementtext-text-form-pgmiddle">EASY AS THAT
<p>NO DEPOSITS, NO PAYMENT METHODS, NO RISKY GAMBLING, NO SKINS HOLDING</p>
</div>
<div class="statementtextdescription-text-form-pgmiddle">WE SAID NO TO CATCHES!</div>
<div class="buttonbkg">
<span class="gradient"></span>SIGN IN WITH STEAM
<span class="gradient"></span>AVAILABLE SKINS
<span class="gradient"></span>HOW IT WORKS
</div>
<div class="container-form-line"></div>
<div class="container-form-pgend">
<div class="text-form-pgend-rights">©2018-2019 “REFF SKINS” ALL RIGHTS RESERVED. FREE SKINS SERVICE.</div>
</div>
The text is ok only when the size of the window is very small
As I understand this works fine for resolution less than 800px (of page width).
You use the size of .circles in pixels for '#media' here:
#media (min-width: 801px) {
.circlescontent {
width: 100px;
}
}
Twice. The percent usage also corrected your issue:
#media (min-width: 801px) {
.circlescontent {
width: 100%;
}
}
Look lines #347 and #403 in your CSS file.

Site doesn't fit the viewport

I am running into some issues with resizing of the window (shrinking). When I shrink it down, the background colors no longer stay at the edge of the viewport, and content goes beyond it.
I thought that setting the width on the entire body to 100% would fix that, but it didn't?
Here is a JSFiddle of my current code, for the index page and the stylesheet:
* {
margin: 0;
padding: 0;
}
body {
font-family: Segoe UI, helvetica, arial;
display: flex;
flex-direction: column;
min-height: 100vh;
font-size: 18px;
width: 100%;
}
a {
color: hsl(344, 69%, 70%);
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #67c3b2;
}
.menu-container {
background-color: rgba(150, 150, 150, 0.2);
padding: 20px 0;
display: flex;
justify-content: center;
text-transform: uppercase;
width: 100%;
}
.menu {
width: 90%;
display: flex;
top: 10px;
justify-content: space-between;
font-size: 16px;
overflow: hidden;
position: relative;
left: 10px;
}
.header-container {
background-color: rgba(150, 150, 150, 0.2);
display: flex;
justify-content: center;
height: 30px;
width: 100%;
position: relative;
}
.logo {
position: relative;
bottom: 37px;
z-index: 1;
}
.flex-container {
display: flex;
justify-content: center;
}
.flex-container p {
position: relative;
margin-left: 40px;
margin-right: 40px;
font-weight: bold;
top: 40px;
margin-top: 40px;
text-align: center;
}
.main {
display: flex;
color: #464646;
background: linear-gradient(to right, #77C9D4, #57BC90);
flex: 1;
}
.cakelist {
position: relative;
bottom: 50px;
display: flex;
font-weight: bold;
list-style-position: inside;
margin-top: 130px;
}
.cakelist ol,
table {
margin-left: 25px;
}
.cakelist h2 {
margin-left: 25px;
margin-top: 20px;
}
.carousel {
color: #464646;
top: 80px;
position: relative;
display: flex;
justify-content: center;
border: 3px outset gray;
align-items: center;
padding: 60px 60px 60px 60px;
}
.buttons {
position: relative;
width: 1600px;
margin-right: 25px;
justify-content: space-around;
display: flex;
top: 160px;
text-align: center;
}
.button a:hover {
opacity: 0.2;
}
.buttons p {
margin-top: 20px;
}
.buttons img {
padding-top: 25px;
height: 200px;
}
.gallery {
position: relative;
top: 80px;
}
.pricing {
display: flex;
position: relative;
top: 80px;
justify-content: center;
flex-direction: column;
padding-bottom: 140px;
}
.pricing p,
h1 {
margin-left: 250px;
text-align: left;
margin-top: 5px;
}
.pricing span {
opacity: 0;
user-select: none;
}
.order {
position: relative;
border-radius: 5px;
background: hsl(344, 69%, 70%);
top: 20px;
margin-top: 60px;
padding: 5px;
}
#order-link {
color: white;
text-decoration: none;
}
.order-button {
width: 180px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.footer-container {
display: flex;
justify-content: flex-end;
align-items: center;
background: #9A9A9A;
height: 90px;
max-height: 90px;
}
.footer-logo {
height: 80px;
position: relative;
right: 10px;
}
.subscribe {
border-radius: 25px;
background: hsl(344, 69%, 70%);
padding: 5px 20px 5px 20px;
width: 80px;
}
#subscribe-link {
position: relative;
color: white;
text-decoration: none;
right: 40px;
}
<div class="menu-container">
<div class="menu">
<div class="flex-item">About Us</div>
<div class="flex-item">Cakes</div>
<div class="flex-item">Cupcakes</div>
<div class="flex-item">Gallery</div>
<div class="flex-item">Prices/Order</div>
<div class="flex-item">Search</div>
</div>
</div>
<header class="header-container">
<img src="TCCLogo.png" class="logo" />
</header>
<div class="flex-container main">
<div class="container">
<div class="carousel">
Here is where I will have the quick gallery/carousel when I get to JS.
</div>
<div class="buttons">
<div class="button">
<img src="cake.png" />
<p>Check out our delicious cake options!</p>
</div>
<div class="button">
<img src="cupcake.png" />
<p>Check out our delicious cupcake options!</p>
</div>
<div class="button">
<img src="prices.png" />
<p>Check out our competitive pricing!</p>
</div>
</div>
</div>
</div>
<footer class="footer-container">
<a id="subscribe-link" target="_blank" href="#">
<div class="subscribe">
<p>Subscribe</p>
</div>
</a>
<img src="TCCLogo.png" class="footer-logo" />
</footer>
I have tried going through my stylesheet, changing the widths on anything I have set with pixels to percentages, but it didn't seem to fix it. The only thing that -sort of- worked was changing the body position to fixed, but then none of the content was view-able if it got shrunk down, all it fixed was keeping the background/header/footer colors the same.
I imagine maybe my coding is a bit messy - I tried my best to be extensible, but being 100% new at this made it difficult.
Your problem is that you have width:1600px in .buttons just remove it and also add box-sizing:border-box to all (pseudo-)elements
EDIT:
you also need to add max-width:100% to .container and flex-wrap:wrap in .buttons
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box
}
body {
font-family: Segoe UI, helvetica, arial;
display: flex;
flex-direction: column;
min-height: 100vh;
font-size: 18px;
}
a {
color: hsl(344, 69%, 70%);
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #67c3b2;
}
.menu-container {
background-color: rgba(150, 150, 150, 0.2);
padding: 20px 0;
display: flex;
justify-content: center;
text-transform: uppercase;
width: 100%;
}
.menu {
width: 90%;
display: flex;
top: 10px;
justify-content: space-between;
font-size: 16px;
overflow: hidden;
position: relative;
left: 10px;
}
.header-container {
background-color: rgba(150, 150, 150, 0.2);
display: flex;
justify-content: center;
height: 30px;
width: 100%;
position: relative;
}
.logo {
position: relative;
bottom: 37px;
z-index: 1;
}
.flex-container {
display: flex;
justify-content: center;
}
.flex-container p {
position: relative;
margin-left: 40px;
margin-right: 40px;
font-weight: bold;
top: 40px;
margin-top: 40px;
text-align: center;
}
.main {
display: flex;
color: #464646;
background: linear-gradient(to right, #77C9D4, #57BC90);
flex: 1;
}
.cakelist {
position: relative;
bottom: 50px;
display: flex;
font-weight: bold;
list-style-position: inside;
margin-top: 130px;
}
.cakelist ol,
table {
margin-left: 25px;
}
.cakelist h2 {
margin-left: 25px;
margin-top: 20px;
}
.container {
max-width: 100%
}
.carousel {
color: #464646;
top: 80px;
position: relative;
display: flex;
justify-content: center;
border: 3px outset gray;
align-items: center;
padding: 60px;
}
.buttons {
position: relative;
margin-right: 25px;
justify-content: space-around;
display: flex;
flex-wrap: wrap;
top: 160px;
text-align: center;
}
.button a:hover {
opacity: 0.2;
}
.buttons p {
margin-top: 20px;
}
.buttons img {
padding-top: 25px;
height: 200px;
}
.gallery {
position: relative;
top: 80px;
}
.pricing {
display: flex;
position: relative;
top: 80px;
justify-content: center;
flex-direction: column;
padding-bottom: 140px;
}
.pricing p,
h1 {
margin-left: 250px;
text-align: left;
margin-top: 5px;
}
.pricing span {
opacity: 0;
user-select: none;
}
.order {
position: relative;
border-radius: 5px;
background: hsl(344, 69%, 70%);
top: 20px;
margin-top: 60px;
padding: 5px;
}
#order-link {
color: white;
text-decoration: none;
}
.order-button {
width: 180px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.footer-container {
display: flex;
justify-content: flex-end;
align-items: center;
background: #9A9A9A;
height: 90px;
max-height: 90px;
}
.footer-logo {
height: 80px;
position: relative;
right: 10px;
}
.subscribe {
border-radius: 25px;
background: hsl(344, 69%, 70%);
padding: 5px 20px 5px 20px;
width: 80px;
}
#subscribe-link {
position: relative;
color: white;
text-decoration: none;
right: 40px;
}
<div class="menu-container">
<div class="menu">
<div class="flex-item">About Us</div>
<div class="flex-item">Cakes</div>
<div class="flex-item">Cupcakes</div>
<div class="flex-item">Gallery</div>
<div class="flex-item">Prices/Order</div>
<div class="flex-item">Search</div>
</div>
</div>
<header class="header-container">
<img src="TCCLogo.png" class="logo" />
</header>
<div class="flex-container main">
<div class="container">
<div class="carousel">
Here is where I will have the quick gallery/carousel when I get to JS.
</div>
<div class="buttons">
<div class="button">
<img src="cake.png" />
<p>Check out our delicious cake options!</p>
</div>
<div class="button">
<img src="cupcake.png" />
<p>Check out our delicious cupcake options!</p>
</div>
<div class="button">
<img src="prices.png" />
<p>Check out our competitive pricing!</p>
</div>
</div>
</div>
</div>
<footer class="footer-container">
<a id="subscribe-link" target="_blank" href="#">
<div class="subscribe">
<p>Subscribe</p>
</div>
</a>
<img src="TCCLogo.png" class="footer-logo" />
</footer>
I have made it proper as you needed. And it's working for me.
Please add below css
.container, .buttons {
max-width: 100%;
}

How do I position a link at the bottom of a responsive landing page with CSS

I'm trying to position a circular instagram icon so it is always centered towards the bottom of a landing page. All my efforts so far such as using position:fixed; have resulted in the icon not remaining underneath the rest of my content when the screen size changes.
My html is like this:
<!DOCTYPE html>
<html>
<head>
<title>RBM Makeup</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<section class="intro">
<div class="inner">
<div class="content">
<h1> Rebecca Bermingham Maguire</h1>
<div class="container">
Portfolio
Contact
About Me
</div>
</div>
</div>
<div class="footer">
<div class="instagram">
</div>
</div>
</section>
</body>
</html>
And my CSS is like this:
:root{
--maroon: #85144b;
--fuchsia: #f012be;
--purple: #b10dc9;
--lime: #01ff70;
--black: #000000;
--white: #ffffff;
--blue: #89cff0;
}
#font-face{
font-family: 'milkshake';
src:url(fonts/Milkshake.ttf);
font-style: normal;
font-weight: 100;
}
#font-face{
font-family: 'amble';
src:url(fonts/Amble-Regular.ttf);
font-style: normal;
font-weight: 100;
}
html, body{
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
/**/
.intro{
height:100%;
width:100%;
margin-right: 20px;
margin: auto;
background: url("images/eye.jpg") no-repeat 50% 50%;
display: table;
top: 0;
background-size: cover;
opacity: 0.92;
}
.intro .inner{
display: table-cell;
vertical-align: middle;
width: 100%;
max-width: none;
}
.content h1{
color: var(--black);
font-size: 350%;
margin: 0px 0px;
text-align: center;
text-transform: bold;
font-family: milkshake;
font-weight: 100;
}
.container{
display: flex;
flex-wrap: wrap;
overflow: hidden;
justify-content: center;
margin-top: 50px;
}
.container a{
border-radius: 9px;
color: var(--black);
font-size: 135%;
padding: 10px 20px;
text-decoration: none;
border: solid var(--black) 5px;
text-transform: uppercase;
margin: 20px 40px;
font-family: amble;
font-weight: 150;
font-style: bold;
}
/*Instagram Icon*/
.fa {
padding: 20px;
font-size: 55px;
width: 40px;
text-align: center;
text-decoration: none;
border-radius: 50%;
align-content: center;
}
.fa:hover{
opacity:0.7;
}
.fa-instagram {
background: var(--black);
color: var(--white);
}
.footer{
position: fixed;
bottom: 0;
width: 100%;
height: 100px;
left: 47.5%;
}
Any help would be greatly appreciated, thanks :)
Modified two places of your code.
1. .foot
left: 50% plus margin-left: - { width } / 2 can make footer align center no matter how the window changes.
```
.footer {
position: fixed;
bottom: 0;
width: 95px; // here
height: 100px;
left: 50%; // here
margin-left: calc(-95px / 2); // here
}
```
2. .fa
In your code, the Instagram icon is not aligning center inside the black circle, so I make some changes for it.
As the Instagram icon is square, you should not set the width 40px when it's font-size is 55px.
```
.fa {
padding: 20px;
font-size: 55px;
width: 55px; /* here */
text-align: center;
text-decoration: none;
border-radius: 50%;
align-content: center;
}
```
If you have more questions about my answer, feel free to contact me :)
:root {
--maroon: #85144b;
--fuchsia: #f012be;
--purple: #b10dc9;
--lime: #01ff70;
--black: #000000;
--white: #ffffff;
--blue: #89cff0;
}
#font-face {
font-family: 'milkshake';
src: url(fonts/Milkshake.ttf);
font-style: normal;
font-weight: 100;
}
#font-face {
font-family: 'amble';
src: url(fonts/Amble-Regular.ttf);
font-style: normal;
font-weight: 100;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
/**/
.intro {
height: 100%;
width: 100%;
margin-right: 20px;
margin: auto;
background: url("images/eye.jpg") no-repeat 50% 50%;
display: table;
top: 0;
background-size: cover;
opacity: 0.92;
}
.intro .inner {
display: table-cell;
vertical-align: middle;
width: 100%;
max-width: none;
}
.content h1 {
color: var(--black);
font-size: 350%;
margin: 0px 0px;
text-align: center;
text-transform: bold;
font-family: milkshake;
font-weight: 100;
}
.container {
display: flex;
flex-wrap: wrap;
overflow: hidden;
justify-content: center;
margin-top: 50px;
}
.container a {
border-radius: 9px;
color: var(--black);
font-size: 135%;
padding: 10px 20px;
text-decoration: none;
border: solid var(--black) 5px;
text-transform: uppercase;
margin: 20px 40px;
font-family: amble;
font-weight: 150;
font-style: bold;
}
/*Instagram Icon*/
.fa {
padding: 20px;
font-size: 55px;
width: 55px; /* need to fit the font-size */
text-align: center;
text-decoration: none;
border-radius: 50%;
align-content: center;
}
.fa:hover {
opacity: 0.7;
}
.fa-instagram {
background: var(--black);
color: var(--white);
}
.footer {
position: fixed;
bottom: 0;
width: 95px;
height: 100px;
left: 50%;
margin-left: calc(-95px / 2);
}
<section class="intro">
<div class="inner">
<div class="content">
<h1> Rebecca Bermingham Maguire</h1>
<div class="container">
Portfolio
Contact
About Me
</div>
</div>
</div>
<div class="footer">
<div class="instagram">
</div>
</div>
</section>
set the parent as
.intro {
width:100%;
height:100vh;
position:relative;
}
and the icon element as
.footer {
position:absolute;
bottom:0;
left:50%;
width:40px;
margin-left:-20px;
}
as an alternative:
.footer {
position:absolute;
bottom:0;
left:0;
width:100%;
text-align:center;
}
.footer > div {
display:inline-block;
}
this will do better as you can add other elements if you end up wanting to add other links