I have a simple page created using html and css, when I shrink the browser the button small-button goes outside of the div and I don't know why, I want to keep it in the div no matter how much I shrink the browser so that it is responsive. How can I do that?
here is my code:
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
.nav {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50%;
}
.header {
height: 8%;
}
.nav-h1 {
text-align: center;
margin-top: 27px;
font-size: 40px;
}
a {
display: inline-block;
margin: 10px;
font-family: 'Segoe UI',sans-serif;
font-family: SegoeUI;
font-size: 16px;
font-weight: bold;
color: black;
font-weight: bold;
}
.a-container {
margin-left: 10%;
margin-top: 27px;
}
.footer {
background-color: #e8e8e8;
height: 288px;
width: 100%;
}
.alignleft {
float: left;
margin-left: 8%;
font-family: SegoeUI;
font-size: 18px;
font-weight: 900;
color: #000000;
}
.alignright {
float: right;
margin-right: 8%;
display: flex;
flex-direction: row;
}
.logo-section {
margin-top: 1.3%;
margin-left: 2%;
}
.logo-img {
padding: 6px;
}
.first-section {
width: 100%;
height: 800px;
background-image: url("/assets/images/first-image.png");
background-repeat: no-repeat;
background-size: contain;
position: relative;
float: left;
}
.first-section-p {
width: 400px;
height: 314px;
margin-left: 10%;
padding-top: 10%;
font-family: SegoeUI;
font-weight: 900;
font-size: 4vh;
font-weight: 900;
text-align: center;
color: #262262;
}
.small-button {
width: 331px;
height: 92px;
margin-left: 12%;
background-color: #e7af17;
font-family: SegoeUI;
font-size: 18px;
font-weight: 900;
color: white;
border: none;
}
.second-section-text {
color: #e8e8e8;
font-weight: 900;
font-size: 70px;
line-height: 0.7;
font-family: SegoeUI;
margin-left: 12%;
}
#media (min-width: 1281px) {
.first-section {
width: 100%;
height: 800px;
background-image: url("/assets/images/first-image.png");
background-repeat: no-repeat;
background-size: cover;
}
.small-button {
width: 331px;
height: 92px;
margin-top: 8%;
margin-left: 12%;
background-color: #e7af17;
font-family: SegoeUI;
font-size: 18px;
font-weight: 900;
color: white;
border: none;
}
}
<div class="main-container">
<div class="headers">
<div class="nav">
<h1 class="nav-h1">Logo</h1>
<div class="a-container">
<a>About</a>
<a>Vision</a>
<a>Solutions</a>
<a>Technology</a>
<a>Contact</a>
</div>
<div class="logo-section">
<img class="logo-img" src="/assets/images/facebook.png" alt="facebook logo">
<img class="logo-img" src="/assets/images/linkedin.png" alt="linkedin logo">
</div>
</div>
</div>
<div class="content">
<div class="content-inside">
<div class="first-section">
<p class="first-section-p">Turnkey platforms <br> for businesses looking to rule the online market
</p>
<button class="small-button">LEARN MORE</button>
</div>
<div class="second-section">
<p class="second-section-text">WHAT</p>
<p class="second-section-text">WHE DO</p>
<p class="second-section-text">BEST</p>
</div>
</div>
</div>
<div class="footer"></div>
</div>
make you sure that you have this meta in html file <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> and trying to change the sizes and position of the elements that you want to resize but don't define all properties
just define the properties that want to change
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
.nav {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50%;
}
.header {
height: 8%;
}
.nav-h1 {
text-align: center;
margin-top: 27px;
font-size: 40px;
}
a {
display: inline-block;
margin: 10px;
font-family: 'Segoe UI', sans-serif;
font-family: SegoeUI;
font-size: 16px;
font-weight: bold;
color: black;
font-weight: bold;
}
.a-container {
margin-left: 10%;
margin-top: 27px;
}
.footer {
background-color: #e8e8e8;
height: 288px;
width: 100%;
}
.alignleft {
float: left;
margin-left: 8%;
font-family: SegoeUI;
font-size: 18px;
font-weight: 900;
color: #000000;
}
.alignright {
float: right;
margin-right: 8%;
display: flex;
flex-direction: row;
}
.logo-section {
margin-top: 1.3%;
margin-left: 2%;
}
.logo-img {
padding: 6px;
}
.first-section {
width: 100%;
height: 800px;
background-image: url("/assets/images/first-image.png");
background-repeat: no-repeat;
background-size: contain;
position: relative;
float: left;
}
.first-section-p {
width: 400px;
height: 314px;
margin-left: 10%;
padding-top: 10%;
font-family: SegoeUI;
font-weight: 900;
font-size: 4vh;
font-weight: 900;
text-align: center;
color: #262262;
}
.small-button {
width: 331px;
height: 92px;
margin-left: 12%;
background-color: #e7af17;
font-family: SegoeUI;
font-size: 18px;
font-weight: 900;
color: white;
border: none;
}
.second-section-text {
color: #e8e8e8;
font-weight: 900;
font-size: 70px;
line-height: 0.7;
font-family: SegoeUI;
margin-left: 12%;
}
#media (min-width: 1281px) {
.first-section {
width: 100%;
height: 800px;
background-image: url("/assets/images/first-image.png");
background-repeat: no-repeat;
background-size: cover;
}
.small-button {
width: 321px;
height: 82px;
margin-top: -28%;
margin-left: 12%;
background-color: #e7af17;
font-family: SegoeUI;
font-size: 18px;
font-weight: 900;
color: white;
border: none;
}
}
#media (max-width: 800px) {
.small-button {
margin-top: -30%;
margin-left: 14%;
}
}
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<div class="main-container">
<div class="headers">
<div class="nav">
<h1 class="nav-h1">Logo</h1>
<div class="a-container">
<a>About</a>
<a>Vision</a>
<a>Solutions</a>
<a>Technology</a>
<a>Contact</a>
</div>
<div class="logo-section">
<img class="logo-img" src="/assets/images/facebook.png" alt="facebook logo">
<img class="logo-img" src="/assets/images/linkedin.png" alt="linkedin logo">
</div>
</div>
</div>
<div class="content">
<div class="content-inside">
<div class="first-section">
<p class="first-section-p">Turnkey platforms <br> for businesses looking to rule the online market
</p>
<button class="small-button">LEARN MORE</button>
</div>
<div class="second-section">
<p class="second-section-text">WHAT</p>
<p class="second-section-text">WHE DO</p>
<p class="second-section-text">BEST</p>
</div>
</div>
</div>
<div class="footer"></div>
</div>
Try setting the viewport with a meta tag.
See this resource: https://www.w3schools.com/html/html_responsive.asp
You can use the the #media css rule:
#media only screen and (max-width: 'your device width') {
.element{
//styling rules here
}
}
You can use this rule more than one time to make your website responsive for more device widths.
Related
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"
I need help for placing an image behind the div (container_3_text).The image has to cover the whole div (container_3) that is behind the text div. I tried position relative and absolute but it does not work or maybe I'm doing it wrong.
My image is from my Wordpress account so I don't write it in the link.
Please help a student :) thanks
.fixfloat {
clear: both;
}
.container_3 {
margin-bottom: 63px;
}
.container_3 img {
height: 830px;
width: 1840px;
}
.container_3_text {
margin-right: 63px;
margin-top: 290px;
margin-bottom: 60px;
padding-top: 50px;
padding-bottom: 60px;
background: white;
display: inline-block;
max-width: 500px;
float: right;
}
.container_3_text .padding {
padding-left: 30px;
padding-right: 70px;
}
.container_3_text .text {
min-height: 130px;
}
.container_3_heading {
margin-bottom: 46px;
}
.container_3_heading .date {
font-size: 20px;
font-weight: 500px;
float: right;
}
.container_3_heading .focus {
background: #04fbc7;
font-size: 20px;
font-weight: 500px;
letter-spacing: 0.025em;
padding-right: 6px;
padding-left: 12px;
color: white;
}
.container_3_title {
font-size: 50px;
margin-bottom: 38px;
line-height: 1;
}
.column_text3 {
width: 790px;
margin: 0 auto;
}
.column_text3 span {
font-size: 36px;
font-weight: 500;
}
.column_text3 p {
font-size: 20px;
margin-top: 18px;
color: #b2b2b2;
}
<div class="grid_big">
<div class="container_3">
<img src="Image from Wordpress account" />
<div class="container_3_text">
<div class="padding">
<div class="container_3_heading">
<span class="focus">In focus</span>
<span class="date">2018 09 05</span>
</div>
<div class="container_3_title">
<p>Production/p>
</div>
<div class="text"> jdejdiefbghewfgewf
</div>
<div class="readmore">
<span class="readmore_text">gihegegkoeef</span>
<span class="arrow bgimgsprite"></span>
</div>
</div>
</div>
<div class="fixfloat"></div>
</div>
</div>
You can use:
div.background_image{
background: url('some_ulr');
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
try this
.container_3_text{
background: url('some_ulr');
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
Make .container_3_text absolute, as per your html.
.fixfloat {
clear: both;
}
.container_3 {
margin-bottom: 63px;
}
.container_3 img {
height: 830px;
width: 1840px;
}
.container_3_text {
right: 63px;
top: 290px;
margin-bottom: 60px;
padding-top: 50px;
padding-bottom: 60px;
background: white;
display: block;
max-width: 500px;
position: absolute;
}
.container_3_text .padding {
padding-left: 30px;
padding-right: 70px;
}
.container_3_text .text {
min-height: 130px;
}
.container_3_heading {
margin-bottom: 46px;
}
.container_3_heading .date {
font-size: 20px;
font-weight: 500px;
float: right;
}
.container_3_heading .focus {
background: #04fbc7;
font-size: 20px;
font-weight: 500px;
letter-spacing: 0.025em;
padding-right: 6px;
padding-left: 12px;
color: white;
}
.container_3_title {
font-size: 50px;
margin-bottom: 38px;
line-height: 1;
}
.column_text3 {
width: 790px;
margin: 0 auto;
}
.column_text3 span {
font-size: 36px;
font-weight: 500;
}
.column_text3 p {
font-size: 20px;
margin-top: 18px;
color: #b2b2b2;
}
<div class="grid_big">
<div class="container_3">
<img src="https://via.placeholder.com/830x1840" />
<div class="container_3_text">
<div class="padding">
<div class="container_3_heading">
<span class="focus">In focus</span> <span class="date">2018 09 05</span>
</div>
<div class="container_3_title">
<p>Production/p>
</div>
<div class="text"> jdejdiefbghewfgewf
</div>
<div class="readmore">
<span class="readmore_text">gihegegkoeef</span> <span class="arrow bgimgsprite"></span>
</div>
</div>
</div>
<div class="fixfloat"></div>
</div>
</div>
Just use background-image: url(); and background-size: cover
.fixfloat {
clear: both;
}
.container_3 {
background-image: url(https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/rOWJ-45_eiyypas7p/film-production-light-turning-on-smoke-background_ribhftic_l_thumbnail-full03.png);
background-position: center;
background-size:cover;
margin-bottom: 63px;
}
.container_3_text {
margin-right: 63px;
margin-top: 290px;
margin-bottom: 60px;
padding-top: 50px;
padding-bottom: 60px;
background: white;
display: inline-block;
max-width: 500px;
float: right;
}
.container_3_text .padding {
padding-left: 30px;
padding-right: 70px;
}
.container_3_text .text {
min-height: 130px;
}
.container_3_heading {
margin-bottom: 46px;
}
.container_3_heading .date {
font-size: 20px;
font-weight: 500px;
float: right;
}
.container_3_heading .focus {
background: #04fbc7;
font-size: 20px;
font-weight: 500px;
letter-spacing: 0.025em;
padding-right: 6px;
padding-left: 12px;
color: white;
}
.container_3_title {
font-size: 50px;
margin-bottom: 38px;
line-height: 1;
}
.column_text3 {
width: 790px;
margin: 0 auto;
}
.column_text3 span {
font-size: 36px;
font-weight: 500;
}
.column_text3 p {
font-size: 20px;
margin-top: 18px;
color: #b2b2b2;
}
<div class="grid_big">
<div class="container_3">
<div class="container_3_text">
<div class="padding">
<div class="container_3_heading">
<span class="focus">In focus</span>
<span class="date">2018 09 05</span>
</div>
<div class="container_3_title">
<p>Production/p>
</div>
<div class="text"> jdejdiefbghewfgewf
</div>
<div class="readmore">
<span class="readmore_text">gihegegkoeef</span>
<span class="arrow bgimgsprite"></span>
</div>
</div>
</div>
<div class="fixfloat"></div>
</div>
</div>
I am not much of a web designer, more of a backend developer. However, the frontend designer left me with a problem I am facing. I have a login and register links and navigation links on the right. I want these links to line up and display in the same navigation bar. At the moment, my links are distorted. They appear in the middle of the page I am dealing with. I want the login/register links to align to the left side of the navigation bar and I also want the right navigation tp sit within the main navigation. Neither of these things are happening (screenshot provided). how do I get th e user links to align to the left of the top navigation bar an the other links to stay to the right?
Here is a link to my screenshot: https://s30.postimg.org/tlkvrcv5t/Screen_Shot_2017_01_05_at_11_11_55_AM.png
and here is my code:
app.blade.php:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="{!! asset('css/stylesheet.css') !!}" />
</head>
<body>
<div class="mainheader">
<div class="subcontainer">
<div class="subcontainer-left">
<div class="subcontainter-title">Cryptoflip</div>
#if (Auth::guest())
<div class="subcontainer-button">
Login
</div>
<div class="subcontainer-button">
Register
</div>
#else
<div class="subcontainer-button">
<a href="/user/{{$user->name}}"Your Profile</a>
</div>
<div class="subcontainer-button">
Logout
</div>
#endif
</div>
</div>
<div class="subcontainer-right noselect">
<div class="subcontainer-button">
Support
</div>
<div class="subcontainer-button">
<a>Provably Fair</a>
</div>
<div class="subcontainer-button">
<a>Dice</a>
</div>
<div class="subcontainer-button bt-active">
Coinflip
</div>
</div>
</div>
<!-- Decoration -->
<!--<div style="height: 10px; width: 200px; margin: auto; margin-top: -50px; background-color: gold"></div>-->
</div>
<div class="maincontainer">
#yield('content')
</div>
</body>
</html>
stylesheet.css;
#font-face {
font-family: NexaBold;
src: url(NexaBold.otf); }
#font-face {
font-family: NexaLight;
src: url(NexaLight.otf); }
#font-face {
font-family: OpenSans;
src: url(OpenSans-Regular.ttf); }
body {
margin: 0;
background-color: #ecf0f1; }
.mainheader {
height: 75px;
font-family: NexaBold;
font-size: 28px;
line-height: 75px;
text-align: center;
vertical-align: middle;
background-color: #dce0e1; }
.menu {
height: 40px; }
.subcontainer-left {
height: 75px;
float: left; }
.subcontainer {
height: 75px;
margin: auto; }
.subcontainer-right {
height: 75px;
width: auto;
float: right; }
.subcontainer-button {
height: 75px;
width: 100px;
float: right;
padding-left: 12px;
padding-right: 12px;
text-align: center;
vertical-align: middle;
line-height: 75px;
font-family: OpenSans;
font-size: 14px; }
.subcontainer-button a {
text-decoration: none;
color: black; }
.subcontainer-button a:visited {
text-decoration: none;
color: black; }
.subcontainer-button a:active {
color: black; }
.subcontainer-button a:hover {
border-bottom: 3px solid gray;
cursor: pointer; }
.subcontainer-title {
height: 75px;
float: left;
padding-left: 12px;
padding-right: 12px;
text-align: center;
vertical-align: middle;
line-height: 75px;
font-family: OpenSans;
font-size: 14px; }
.bt-active a {
border-bottom: 3px solid gold; }
.noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.maincontainer {
height: 700px; }
.textheader {
height: 180px;
text-align: center;
vertical-align: middle;
line-height: 180px;
font-family: NexaLight;
font-size: 48px; }
.ongoing-header {
width: 700px;
margin: auto;
height: 70px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
background-color: #bcc0c1; }
.subheader {
height: 70px;
width: 260px;
font-family: OpenSans;
font-weight: bold;
font-size: 22px;
text-align: center;
line-height: 70px;
vertical-align: middle;
float: left; }
.subheader-menu {
height: 36px;
background-color: #ccd0d1; }
.button {
height: 36px;
width: auto;
margin: auto;
padding-left: 12px;
padding-right: 12px;
text-align: center;
vertical-align: middle;
line-height: 36px;
font-family: OpenSans;
cursor: pointer;
border-radius: 4px;
transition: 0.3s; }
.button:hover {
background-color: #ecf0f1; }
.subheader-right {
float: right;
padding-top: 16px;
width: 260px;
margin: auto;
margin-right: 24px; }
.ongoing-container {
width: 700px;
margin: auto; }
.ongoing-game {
height: 40px;
line-height: 40px;
vertical-align: middle;
text-align: center;
cursor: pointer;
font-family: OpenSans;
transition: 0.3s; }
.ongoing-game:nth-child(even):hover {
background-color: #f3f9fa; }
.ongoing-game:nth-child(odd):hover {
background-color: #f3f9fa; }
.ongoing-game:nth-child(even) {
background-color: #d3d9da; }
.ongoing-game:nth-child(odd) {
background-color: #dce0e1; }
.iconholder {
height: 20px;
width: 20px;
float: left;
margin-top: 4px;
margin-right: 4px; }
#username {
float: left;
height: 40px;
width: 220px;
text-align: left;
padding-left: 24px; }
#btcamount {
float: left;
height: 40px;
width: 220px;
text-align: right;
padding-right: 24px; }
#ongoing {
height: 40px;
width: 212px;
float: left; }
.bitcoinlogo {
height: 15px; }
.helpcontainer {
height: 600px;
width: 500px;
margin: auto;
font-family: OpenSans; }
.helpform {
margin-top: 20px;
height: 400px;
font-size: 12px; }
.helpform textarea {
resize: none;
font-family: OpenSans; }
#issuetext {
height: 100px;
width: 480px; }
#emailtext {
height: 18px;
width: 220px;
font-family: OpenSans; }
.submitbutton {
height: 40px;
width: 180px;
float: none;
margin: auto;
margin-top: 20px;
border: 1px solid gray;
background-color: white;
text-align: center;
vertical-align: middle;
line-height: 40px;
font-size: 14px;
cursor: pointer;
border-radius: 3px;
transition: 0.2s background-color; }
.submitbutton:hover {
background-color: lightgrey; }
/*# sourceMappingURL=stylesheet.css.map */
EDIT:Updated code.
Get rid of width on .subcontainer-left. Then give a width to .subcontainer-button.
.subcontainer-left {
height: 75px;
/* width: 200px; */
float: left;
}
.subcontainer-button {
height: 75px;
width: 100px;
...
}
You need to place "Cryptoflip" inside a div, for example "subcontainer-title":
<div class="subcontainer">
<div class="subcontainer-left">
<div class="subcontainer-title">Cryptoflip</div>
<div class="subcontainer-button">
Login
</div>
<div class="subcontainer-button">
Register
</div>
</div>
</div>
Then add the style for it copying ".subcontainer-button" and modify the content to match what you want it to look (float: left in first place):
.subcontainer-title {
height: 75px;
width: auto;
float: left;
padding-left: 12px;
padding-right: 12px;
text-align: center;
vertical-align: middle;
line-height: 75px;
font-family: OpenSans;
font-size: 14px;
}
And change the width of subcontainer-left:
.subcontainer-left {
height: 75px;
width: 400px;
float: left;
}
How would i be able to align my navigation links to the header?
This is what i currently have:
But, I'd really like to have the links vertically aligned within the header, like this:
How would i do this?
Below is my CSS & HTML.
html, body {
margin: 0;
padding: 0;
}
body {
font-family: 'Open Sans', sans-serif;
}
.wrapper {
width: 1100px;
max-width: 90%;
margin: 0 auto;
}
#top_header {
position: fixed;
left: 0px;
top: 0px;
right: 0px;
background-color: #26ABF5;
height: 70px;
vertical-align: middle;
}
#logo_top {
display: inline-block;
width: 53px;
padding-top: 8px;
}
#main_nav {
display: inline-block;
font-size: 12px;
padding-left: 170px;
}
#main_nav a {
color: #fff;
font-weight: 400;
text-decoration: none;
margin-left: 6em;
}
.button {
float: right;
justify-content: center;
display: flex;
width: 101px;
margin-top: 14px;
padding-top: 9px;
padding-bottom: 9px;
border-radius: 2px;
background-color: #fff;
text-decoration: none;
font-family: 'Open Sans', sans-serif;
color: #26abf5;
font-size: 13px;
font-weight: 600;
}
<body>
<header id="top_header">
<div class="wrapper">
<img id="logo_top" draggable="false" src="images/logo1.png">
<nav id="main_nav">
FORSIDE
HVAD TILBYDER VI?
PRISER
OM OS
</nav>
<a class="button" href="#">LOG IND</a>
</div>
</body>
Use line-height for vertical-align. Im add the line in #main_nav.
Edit: add float: left; for your logo image.
html, body {
margin: 0;
padding: 0;
}
body {
font-family: 'Open Sans', sans-serif;
}
.wrapper {
width: 1100px;
max-width: 90%;
margin: 0 auto;
}
#top_header {
position: fixed;
left: 0px;
top: 0px;
right: 0px;
background-color: #26ABF5;
height: 70px;
vertical-align: middle;
}
#logo_top {
display: inline-block;
float: left;
width: 53px;
padding-top: 8px;
}
#main_nav {
display: inline-block;
font-size: 12px;
line-height: 70px;
padding-left: 170px;
}
#main_nav a {
color: #fff;
font-weight: 400;
text-decoration: none;
margin-left: 6em;
}
.button {
float: right;
justify-content: center;
display: flex;
width: 101px;
margin-top: 14px;
padding-top: 9px;
padding-bottom: 9px;
border-radius: 2px;
background-color: #fff;
text-decoration: none;
font-family: 'Open Sans', sans-serif;
color: #26abf5;
font-size: 13px;
font-weight: 600;
}
<body>
<header id="top_header">
<div class="wrapper">
<img id="logo_top" draggable="false" src="images/logo1.png">
<nav id="main_nav">
FORSIDE
HVAD TILBYDER VI?
PRISER
OM OS
</nav>
<a class="button" href="#">LOG IND</a>
</div>
</body>
I want to sharpen my HTML & CSS skills by recreating the Bootstrap homepage in pure HTML & CSS. I am almost finished, but I seem to be having trouble with my footer. Everything else is positioned the way I would like it, but everything on the footer shoots up to the top and middle of my page. Can anyone tell me what I am missing here?
HTML
<header>
<div class="top-bar">
<p>Aww yeah, Bootstrap 4 is coming!</p>
</div>
<nav>
<div class="nav-bar">
<div class="logo">
Bootstrap
</div>
<div class="left-nav">
<ul>
<li>Getting Started</li>
<li>CSS</li>
<li>Components</li>
<li>JavaScript</li>
<li>Customize</li>
</ul>
</div>
<div class="right-nav">
<ul>
<li>Themes</li>
<li>Expo</li>
<li>Blog</li>
</ul>
</div>
</div>
<nav>
</header>
</div>
<center>
<main>
<section>
<div class="head-component">
<div class="b-logo">
<p>B</p>
</div>
<div class="short-description">
<p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.</p>
</div>
<div class="download-button">
<button class="dwn">Download Bootstrap</button>
</div>
<div class="current">
<p>Currently v3.3.5</p>
</div>
</div>
</section>
<section>
<div class="mid-section">
<div class="mid-info">
<h2>Designed for everyone, everywhere.</h2>
<p>Bootstrap makes front-end web development faster and easier. It's made for folks of all skill levels, devices of all shapes, and projects of all sizes.</p>
</div>
<hr class="hz-line" />
<div class="column-left">
<img src="http://getbootstrap.com/assets/img/sass-less.png" />
<h4>Preprocessors</h4>
<p>Bootstrap ships with vanilla CSS, but its source code utilizes the two most popular CSS preprocessors, Less and Sass. Quickly get started with precompiled CSS or build on the source.</p>
</div>
<div class="column-middle">
<img src="http://getbootstrap.com/assets/img/devices.png" />
<h4>One framework, every device.</h4>
<p>Bootstrap easily and efficiently scales your websites and applications with a single code base, from phones to tablets to desktops with CSS media queries.</p>
</div>
<div class="column-right">
<img src="http://getbootstrap.com/assets/img/components.png" />
<h4>Full of features</h4>
<p>With Bootstrap, you get extensive and beautiful documentation for common HTML elements, dozens of custom HTML and CSS components, and awesome jQuery plugins.</p>
</div>
<div class="clear"></div>
<hr class="hz-line" />
<div class="github">
<p>Bootstrap is open source. It's hosted, developed, and maintained on GitHub.</p>
</div>
<div class="github-button">
<button class="view-git">View the Github Project</button>
</div>
<div class="clear"></div>
<div class="spacer"></div>
<div class="clear"></div>
<div class="photo-section">
<hr class="hrln-full" />
<div class="second-mid-info">
<h2>Built with Bootstrap.</h2>
<p>Millions of amazing sites across the web are being built with Bootstrap. Get started on your own with our growing collection of examples or by exploring some of our favorites.</p>
</div>
<hr class="hz-line" />
<div class="photos">
<img src="http://expo.getbootstrap.com/thumbs/lyft-thumb.jpg" />
<img src="http://expo.getbootstrap.com/thumbs/vogue-thumb.jpg" />
<img src="http://expo.getbootstrap.com/thumbs/riot-thumb.jpg" />
<img src="http://expo.getbootstrap.com/thumbs/newsweek-thumb.jpg" />
</div>
<hr class="hz-line" />
<div class="expo-button">
<p>We showcase dozens of inspiring projects built with Bootstrap on the Bootstrap Expo.</p>
<button class="expo">Explore the Expo</button>
</div>
<hr class="hrln-full" />
</div>
</div>
<div class="clearfooter"></div>
</section>
</main>
<div class="clear"></div>
<footer>
<p>Designed and built with all the love in the world by #mdo and #fat.
<br /> Maintained by the core team with the help of our contributors.
<br /> Code licensed under MIT, documentation under CC BY 3.0.</p>
<ul>
<li>Github</li>
<li>Examples</li>
<li>v2.3.2 docs</li>
<li>About</li>
<li>Expo</li>
<li>Blog</li>
<li>Releases</li>
</ul>
</footer>
</center>
CSS
*, *:before, *:after {
box-sizing: border-box;
}
html, body, #wrap {
height: 100%;
}
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #fff;
}
h1 {
font-size: 50px;
}
h2 {
font-size: 40px;
}
h3 {
font-size: 30px;
}
h4 {
font-size: 22px;
font-weight: 100px;
}
h5 {
font-size: 15px;
}
h6 {
font-size: 14px;
}
#container {}
ul {
list-style: none;
}
li {
list-style: none;
display: inline;
padding: 10px;
}
a {
list-style: none;
color: inherit;
text-decoration: none;
padding-top: 15px;
padding-bottom: 15px;
margin: 0;
}
main {
padding-bottom: 150px;
display: block;
margin: 0 auto;
}
.top-bar {
margin: 0;
padding: 15px 0;
background-color: #0275D8;
text-align: center;
}
.top-bar p {
color: #fff;
font-size: 15px;
font-weight: 600;
text-align: center;
margin: 0;
}
.top-bar:hover {
margin: 0;
padding: 15px 0;
background-color: #0269C2;
text-align: center;
}
.nav-bar {
background-color: #fff;
position: relative;
color: #583F7E;
display: block;
width: 100%;
height: 50px;
}
.logo {
position: absolute;
font-size: 20px;
font-weight: 700;
color: #583F7E;
padding: 15px;
line-height: 0.8em;
margin-left: 100px;
}
.left-nav {
float: left;
font-size: 15px;
font-weight: 500;
text-align: center;
margin-left: 200px;
}
.right-nav {
float: right;
text-align: right;
font-size: 15px;
font-weight: 500;
margin-right: 120px;
}
.left-nav a:hover {
background-color: #f9f9f9;
}
.right-nav a:hover {
background-color: #f9f9f9;
}
.head-component {
background-color: #583F7E;
height: 700px;
display: block;
margin: 0 auto;
}
.b-logo {
margin: 0 auto;
padding-top: 5px;
width: 160px;
height: 300px;
display: block;
}
.b-logo p {
font-size: 130px;
font-weight: 700;
color: #fff;
border: 1px solid #fff;
border-radius: 25px;
text-align: center;
}
.short-description {}
.short-description p {
font-size: 30px;
color: #fff;
font-weight: 300;
width: 850px;
text-align: center;
display: block;
margin: 0 auto;
padding-top: 40px;
}
.download-button {
padding-top: 40px;
}
.dwn {
background: none;
font-size: 20px;
padding: 15px;
color: #fff;
font-weight: 400;
border: 1px solid #fff;
border-radius: 5px;
text-align: center;
display: block;
margin: 0 auto;
}
.dwn:hover {
background: #fff;
font-size: 20px;
padding: 15px;
color: #583F7E;
font-weight: 400;
border: 1px solid #fff;
border-radius: 5px;
text-align: center;
display: block;
margin: 0 auto;
}
.current p {
color: #9781A9;
font-size: 14px;
padding-bottom: 75px;
padding-top: 20px;
display: block;
margin: 0 auto;
text-align: center;
}
.mid-section {
height: 100%;
background-color: #fff;
display: block;
margin: 0 auto;
}
.mid-info {
padding-top: 75px;
font-weight: 300;
color: #333;
width: 900px;
text-align: center;
display: block;
margin: 0 auto;
}
.mid-info p {
font-weight: 400;
font-size: 22px;
color: #555;
padding-bottom: 20px;
display: block;
margin: 0 auto;
text-align: center;
}
.hz-line {
width: 10%;
color: #f3f3f3;
opacity: 0.5;
}
.column-left {
width: 32%;
float: left;
padding-top: 25px;
padding-left: 75px;
font-weight: 100;
color: #333;
}
.column-left img {
width: 100%;
}
.column-left p {
font-weight: 400;
font-size: 16px;
color: #555;
padding-bottom: 20px;
}
.column-middle {
width: 32%;
float: left;
padding-top: 25px;
padding-left: 75px;
font-weight: 100;
color: #333;
}
.column-middle img {
width: 100%;
}
.column-middle p {
font-weight: 400;
font-size: 16px;
color: #555;
padding-bottom: 20px;
}
.column-right {
width: 32%;
float: left;
padding-top: 25px;
padding-left: 75px;
font-weight: 100;
color: #333;
}
.column-right img {
width: 100%;
}
.column-right p {
font-weight: 400;
font-size: 16px;
color: #555;
padding-bottom: 20px;
}
.clear {
clear: both;
}
.github {
padding-top: 15px;
font-weight: 300;
color: #333;
width: 1024px;
display: block;
margin: 0 auto;
text-align: center;
}
.github p {
font-weight: 400;
font-size: 18px;
color: #555;
padding-bottom: 20px;
text-align: center;
}
.view-git {
background: none;
font-size: 20px;
padding: 10px;
color: #583F7E;
font-weight: 400;
border: 1px solid #583F7E;
border-radius: 5px;
text-align: center;
display: block;
margin: 0 auto;
}
.view-git:hover {
background: #583F7E;
font-size: 20px;
padding: 10px;
color: #fff;
font-weight: 400;
border: 1px solid #fff;
border-radius: 5px;
text-align: center;
display: block;
margin: 0 auto;
}
.hrln-full {
color: #f3f3f3;
opacity: 0.5;
}
.spacer {
height: 60px;
}
.second-mid-info {
padding-top: 75px;
font-weight: 300;
color: #333;
width: 900px;
display: block;
margin: 0 auto;
text-align: center;
}
.second-mid-info p {
font-weight: 400;
font-size: 22px;
color: #555;
text-align: center;
display: block;
margin: 0 auto;
padding-bottom: 30px;
}
.photo-section {
height: 100%;
display: block;
margin: 0 auto;
}
.photos {
padding: 30px;
padding-left: 115px;
}
.photos img {
width: 23%;
}
.expo-button {
padding-top: 15px;
padding-bottom: 120px;
font-weight: 300;
color: #333;
width: 1024px;
display: block;
margin: 0 auto;
}
.expo-button p {
font-weight: 300;
font-size: 22px;
color: #555;
padding-bottom: 30px;
text-align: center;
display: block;
margin: 0 auto;
}
.expo {
background: none;
font-size: 20px;
padding: 10px;
color: #583F7E;
font-weight: 400;
border: 1px solid #583F7E;
border-radius: 5px;
text-align: center;
display: block;
margin: 0 auto;
}
.expo:hover {
background: #583F7E;
font-size: 20px;
padding: 10px;
color: #fff;
font-weight: 400;
border: 1px solid #fff;
border-radius: 5px;
text-align: center;
display: block;
margin: 0 auto;
}
.clearfooter {
height: 130px;
clear: both;
}
footer {
text-align: center;
bottom: 0;
height: 100%;
left: 0;
width: 100%;
display: block;
margin: 0 auto;
}
footer p {
text-align: center;
}
footer ul {
position: relative;
}
footer li {
color: #489FD6;
}
footer li:hover {
color: #23517C;
text-decoration: underline;
}
footer a {}
From what I can tell I believe its because of two main reasons.
You have set fixed heights for elements with content that is height than the fixed height.
.mid-section {
height: 500px;
background-color: #fff;
margin: 0;
}
.photo-section {
height:500px;
}
The footer has position: absolute but isn't contained by a parent with position: relative. If you would like the footer to stick to the bottom use position: fixed instead.
footer {
text-align: center;
bottom: 0;
height: 100px;
left: 0;
position: absolute;
width: 100%;
}