Why won't my content center - html

Hi I'm creating a header with a full page image, naviagetion ect. Overlaying the image I have text which welcomes the user to the site, shows the address, shows the opening times during the weekdays and the weekend, and also displays the phone number of the business.
However I can't get the content to center on the image, it's stuck on the left hand side. Any idea why this may be the case? I'm trying to center #openingContent, and #addressHours
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
h2,
h3,
h4,
h5 {
margin-top: 0;
}
h3 {
display: inline-block;
}
.main-header {}
/* ---- Navigation ---- */
.main-nav {
position: absolute;
top: 1em;
right: 15.9em;
z-index: 1;
}
.main-nav li {
font-size: 17.5px;
display: inline-block;
list-style-type: none;
}
.main-nav li,
.name,
{
font-family: 'Montserrat', sans-serif;
}
.main-nav a {
font-size: .95em;
color: #fff;
text-transform: uppercase;
}
.main-nav a:hover {
color: #FFAB0F;
}
.name a,
.main-nav a {
padding: 10px 15px;
text-align: center;
display: block;
text-decoration: none;
}
.name {
font-size: .95em;
color: #fff;
display: inline-block;
position: absolute;
top: 1.34em;
left: 6em;
z-index: 1;
line-height: 18px;
}
.name a {
color: #fff;
margin-top: -25px;
}
.contactButton {
top: 1.24em;
right: 6em;
z-index: 1;
position: absolute;
border-radius: 100%;
background-color: #004C4C;
color: #fff;
border: none;
padding: 5px 10px;
}
.contactButton:hover {
background-color: #fff;
color: #000;
}
/*Image Header*/
#openingContent {
font-family: 'EB Garamond', serif;
color: #fff;
position: absolute;
z-index: 1;
top: 5em;
text-align: center;
}
.headline {
font-size: 55px
}
.headline2 {
margin-top: 6%;
font-size: 85px;
}
#addressHours {
color: #fff;
position: absolute;
z-index: 1;
top: 15.5em;
line-height: 1.8;
font-style: italic;
text-align: center;
}
.mainImage {
filter: brightness(50%);
}
.fullPageImage {
height: 100%;
width: 100%;
margin: auto;
display: table;
top: 0;
background-size: cover;
}
<header class="main-header">
<h1 class="name">Title</h1>
<nav class="main-nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Menu</li>
<li>Enquiries</li>
<li>Reviews</li>
<li>Location</li>
</ul>
</nav>
<input type="button" class="contactButton" value="Bookings">
<div id="mix">
<div id="openingContent">
<h1 class="headline">Welcome to</h1>
<h2 class="headline2">Our restaurant</h1>
</div>
<div id="addressHours">
<span class="address">This is our address.........</span><br>
<span class="hours">Monday - Friday: <span class="time">7am - 8pm</span></span><br>
<span class="hours">Saturday & Sunday: <span class="time">10am - 4pm</span></span><br>
<span class="phone"><span class="call">(Call)</span>: +1 610-312-9123</span>
</div>
</div>
<img src="http://lorempixel.com/200/200" class="fullPageImage mainImage"/>
</header>
<div class="about">
<h2 class="customertitle">What our customers love about us!</h2>
<section class="section">
<h3 class="section-title">Great Coffee</h3>
<p class="para">Enjoy our award winning coffee, while you relax at our great scenic location.</p>
<img src="http://lorempixel.com/15/15" class="image">
</section>
<section class="section">
<h3 class="section-title">Free Wifi!</h3>
<p class="para">Free Wifi to enable you to work away to your hearts content, or hire space for meetings.</p>
<img src="http://lorempixel.com/15/15" class="image">
</section>
<section class="section">
<h3 class="section-title">Loyalty Cards</h3>
<p class="para">We like to rewards our loyal customers. For every 9 coffees, enjoy your 10th for free.</p>
<img src="http://lorempixel.com/15/15" class="image">
</section>
</div>

Add left: 50%; and ´transform: translateX(-50%); to the absolutely positioned #openingContent to move it into the horizontal center of its container:
(BTW: Don't use a closing tag on img elements!)
* {
box-sizing: border-box;
}
html,body {
margin:0;
padding:0;
height: 100%;
width: 100%;
}
h2, h3, h4, h5 {
margin-top: 0;
}
h3 {
display: inline-block;
}
.main-header{
}
/* ---- Navigation ---- */
.main-nav {
position: absolute;
top: 1em;
right: 15.9em;
z-index: 1;
}
.main-nav li{
font-size: 17.5px;
display: inline-block;
list-style-type: none;
}
.main-nav li,
.name,
{
font-family: 'Montserrat', sans-serif;
}
.main-nav a {
font-size: .95em;
color: #fff;
text-transform: uppercase;
}
.main-nav a:hover {
color: #FFAB0F;
}
.name a,
.main-nav a {
padding: 10px 15px;
text-align: center;
display: block;
text-decoration: none;
}
.name {
font-size: .95em;
color: #fff;
display: inline-block;
position: absolute;
top: 1.34em;
left: 6em;
z-index: 1;
line-height: 18px;
}
.name a {
color: #fff;
margin-top: -25px;
}
.contactButton {
top: 1.24em;
right: 6em;
z-index: 1;
position: absolute;
border-radius: 100%;
background-color: #004C4C;
color: #fff;
border: none;
padding: 5px 10px;
}
.contactButton:hover {
background-color: #fff;
color: #000;
}
/*Image Header*/
#openingContent {
font-family: 'EB Garamond', serif;
color: #fff;
position: absolute;
z-index: 1;
top: 5em;
text-align: center;
left: 50%;
transform: translateX(-50%);
}
.headline {
font-size: 55px
}
.headline2 {
margin-top: 6%;
font-size: 85px;
}
#addressHours {
color: #fff;
position: absolute;
z-index: 1;
top: 15.5em;
line-height: 1.8;
font-style: italic;
text-align: center;
}
.mainImage {
filter: brightness(50%);
}
.fullPageImage {
height: 100%;
width: 100%;
margin: auto;
display: table;
top: 0;
background-size: cover;
}
<!DOCTYPE html>
<html>
<head>
<title>Wake Cup Coffee House | Dublin</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="normalize.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat|Varela+Round|EB+Garamond|Roboto|Neuton|Slabo+27px" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<script src="Analytics/analytics.js"></script>
</head>
<body>
<header class="main-header">
<h1 class="name">Title</h1>
<nav class="main-nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Menu</li>
<li>Enquiries</li>
<li>Reviews</li>
<li>Location</li>
</ul>
</nav>
<input type="button" class="contactButton" value="Bookings">
<div id="mix">
<div id="openingContent">
<h1 class="headline">Welcome to</h1>
<h2 class="headline2">Our restaurant</h1>
</div>
<div id="addressHours">
<span class="address">This is our address.........</span><br>
<span class="hours">Monday - Friday: <span class="time">7am - 8pm</span></span><br>
<span class="hours">Saturday & Sunday: <span class="time">10am - 4pm</span></span><br>
<span class="phone"><span class="call">(Call)</span>: +1 610-312-9123</span>
</div>
</div>
<img src="http://placehold.it/600x600/fca" class="fullPageImage mainImage">
</header>
<div class="about">
<h2 class="customertitle">What our customers love about us!</h2>
<section class="section">
<h3 class="section-title">Great Coffee</h3>
<p class="para">Enjoy our award winning coffee, while you relax at our great scenic location.</p>
<img src="images/coffee.png" class="image">
</section>
<section class="section">
<h3 class="section-title">Free Wifi!</h3>
<p class="para">Free Wifi to enable you to work away to your hearts content, or hire space for meetings.</p>
<img src="images/wifi.png" class="image">
</section>
<section class="section">
<h3 class="section-title">Loyalty Cards</h3>
<p class="para">We like to rewards our loyal customers. For every 9 coffees, enjoy your 10th for free.</p>
<img src="images/savings.png" class="image">
</section>
</div>
</body>
</html>

If I'm getting your question right then, you should not use <img> for background image. Instead use CSS body { background-image: url("your_image.jpeg"); }
Then align text to center might be by using CSS property text-align: center

Maybe change it like this?
<div class="parent">
<div class="child">
(copy your content here)
</div>
</div>
so that the parent container has a background image, and the child has all the content. And the child is really centered in the parent
.parent {
position: relative;
background-image: url("img/image.png");
background-color: #cccccc;
}
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
See https://css-tricks.com/centering-css-complete-guide/
specifically this https://codepen.io/chriscoyier/pen/lgFiq

Related

can i let a fixed text dissapear after the banner?

At the moment i have a fixed text, and a fixed navbar in my banner.
i would like the text to dissapear after the banner image. the navbar is alright to stay fixed for the entire page. but i would prefer the text to disappear after the image! is there a way to set a boundary for a fixed element. or else is there a way to get the fixed text on the background so it will not appears over my main content but rather behind it. Thanks guy's!!
body {
margin: 0;
padding: 0;
font: font-family: myriad-pro, sans-serif;
position:relative;
}
.text {
display: inline-block;
width: 100%;
text-align: center;
position:fixed;
top: 200px;
color: white;
border-style: none;
border: 0;
padding: 0;
margin: 0;
opacity: 80%;
font-family: myriad-pro, sans-serif;
font-weight: 100;
font-size: 35px;
font-style: italic;
border-style: none;
}
#text2{
margin-left: 200px;
font-weight: 100;
opacity: 60%;
margin-top: -40px;
}
.image {
filter: brightness(40%);
}
li:hover{
background-color: darkgrey;
}
li {
list-style-type: none;
color: aqua;
float: right;
padding-left: 5px;
padding-right: 5px;
margin-top: 17px;
font-family: myriad-pro, sans-serif;
font-weight: lighter;
}
a.list{
color: black;
text-decoration: none;
white-space: 20px;
}
.navbar {
display: inline-block;
text-align: right;
background-color: white;
opacity: 53%;
width: 100%;
position:static;
top: 20%;
border-style: none;
position: fixed;
top: 25px;
width: 100%;
white-space: 80px;
z-index: 9;
}
.logo{
text-align: left;
padding-left: 20px;
margin-top: -11px;
}
.marcel{
display: block;
background-color: antiquewhite;
margin: 250px 250px;
text-align: center;
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<link rel="stylesheet" href="./test.css">
<link rel="stylesheet" href="https://use.typekit.net/wbf4zoi.css">
<title>Edusolut</title>
</head>
<body>
<nav class="navbar">
<ul>
<li><a class="list" href="#"> Home</a></li>
<li><a class="list" href="#"> Service</a></li>
<li><a class="list" href="#"> Contact</a></li>
<li><a class="list" href="#"> Training</a></li>
</ul>
<div class="logo">
<img src="logo3.png" width="120px" />
</div>
</nav>
<div role="banner">
<div class="image">
<img src="./computer-2565478_1280.jpg" alt="computer" height="630rem" width="100%">
</div>
<div class="text">
<h1>Edusolut</h1>
<div id="text2">
<p>Your Education Solution.</p>
</div>
</div>
</div>
</body>
<body id="main">
<div class = "marcel" >
<img src="./marcel.png">
<h3> Netwerk en Trainig consultancy</h3>

How do I fix my form from breaking it's container and the inputs being centered?

I am working on a mobile first design approach, so please resize the screen to mobile size or inspect and set to any phone.
I am having trouble getting this form to behave. It won't center and the submit button won't align with the right side of the forms.
And when I switch between phone screens different border edges on the form inputs will be issing. On one screen its the top border for the name input that's missing, on one its all the right borders for each box, etc.
How do you fix this?
css
.container {
padding: 0 2em;
}
main {
position: relative;
top: -20%;
}
body, html {
width: 100%;
margin: 0;
padding: 0;
font-family: 'Raleway', sans-serif;
text-align: center;
overflow-x: hidden;
/*background: #CE2026;*/
}
/*-- ---------------------------------------------------------------- -->
<!-- NAVIGATION -->
<!-- --------------------------------------------------------------- --*/
.navbar {
background-color: #FFFFFF;
width: 100%;
height: 78px;
border-bottom: 8px solid #CE2026;
position: relative;
z-index: 1;
}
.navbar-links {
display: none;
}
#logo {
display: none;
}
.open-slide {
float: right;
margin-top: 25px;
margin-right: 20px;
display: block;
z-index: 4;
position: absolute;
right: 0;
}
.side-nav {
width: 0;
display: none;
height: 100%;
position: absolute;
top: 0;
background-color: #fff;
transition: 0.5s;
right: -1px;
text-align: right;
z-index: 15;
margin-top: 5%;
}
#side-hidden {
background-color: #000;
opacity: 0.9;
height: 100%;
position: absolute;
top: 0;
transition: 0.5s;
left: 0
margin: 0;
width: 0;
z-index: 6;
}
.side-nav ul {
display: block;
text-decoration: none;
z-index: 6;
/* Added this */
padding: 0;
position: relative;
top: -8%;
list-style: none;
}
/* Added this */
.nav-item {
display:block;
margin: 0;
}
.side-nav ul a {
position: relative;
width: 100%;
/* Changed this */
/* padding: 10px 130px 10px 100px;*/
padding: 20px 15px;
text-decoration: none;
color: #000;
margin-right: 20px;
z-index: 6;
/* Removed this */
/* right: 30px; */
text-align: right;
/* Added these */
display: block;
box-sizing: border-box;
}
.btn-close {
display: block;
background: #fff;
position: absolute;
top: 0;
/* Changed this */
/* left: 22px; */
left: 0;
font-size: 36px;
text-decoration: none;
color: #ccc;
right: 7px;
top: -10px;
}
.btn-close {
background: #fff;
color:#2F2E2E;
position: relative;
padding: 0;
margin: 0;
}
.btn-close a:hover {
color: #444;
cursor: pointer;
background: #fff;
}
.side-nav .btn-close:hover {
color: #fff
}
.side-nav li a:hover {
color: #fff;
background: #CE2026;
}
.side-active {
color: #ffffff !important;
background: #CE2026;
}
.mobile-logo {
position: relative;
top: 10%;
right: 0%;
padding: 0;
}
/*-- -------------------------------------------- -->
<!-- HERO STRIP -->
<!-- -------------------------------------------- -*/
#hero {
height: 100%;
width: 100%;
position: relative;
background:url("images/Landing.jpg") no-repeat center center fixed;
padding: 0;
margin: 0;
color: #fff;
border-bottom: 1px solid #CE2026;
}
#home-h {
width: 100%;
font-weight: 900;
font-size: 2.7em;
padding-top: .8em;
line-height: 1.4em;
margin-top: 0;
}
#home-p {
font-size: 1.25em;
padding-bottom: .8em;
font-weight: 350;
animation-delay: 0.3s;
margin: 0;
}
.learn {
display: inline-block;
border-style: solid;
border-width: 2px;
border-color: #FFFFFF;
font-size: 17px;
margin: 28px 0;
padding: 18px 80px;
color: #FFFFFF;
text-decoration: none;
animation-delay: 0.6s;
}
.heroText a:hover {
background: #fff;
border-color: #fff;
color: #CE2026;
transition: background 0.4s ease 0s;
transition-property: background;
transition-duration: 0.4s;
transition-timing-function: ease;
transition-delay: 0s;
cursor: pointer;
}
/*-- -------------------------------------------- -->
<!-- RED STRIP -->
<!-- -------------------------------------------- -*/
#red-strip {
background: #CE2026;
color: #fff;
height: 100%;
padding: 0;
margin: 0;
padding-bottom: 0em;
}
#strip-1 {
margin-top: 0;
padding-top: 0;
}
#strip-1 h3 {
font-size: 1.313em;
}
#strip-1 p {
line-height: 1.4em;
}
.top h3 {
margin-top: 0;
padding-top: 0;
}
.strip-1-center {
padding: 1.8em;
}
.strip-1-center h3 {
padding-top: 1em;
}
/*-- -------------------------------------------- -->
<!-- GIVE CALL -->
<!-- -------------------------------------------- -*/
#give-call {
margin-top: 1em;
padding: 0;
background: #fff;
height: 100%;
}
.gcn-call, .gcn-number {
font-size: 1.375em;
}
.gcn-call {
margin-bottom: 0;
padding-top: 3em;
}
.gcn-number {
margin-top: .4em;
}
.gcn-p {
line-height: 1.5em;
margin-bottom: 3em;
}
.give-call-number {
margin-bottom: 5em;
}
.give-call-number a {
border: 2px solid #000;
border-radius: 25px;
position: relative;
padding: 15px 25%;
margin-top: 2em;
margin-bottom: 2em;
text-decoration: none;
color:#2F2E2E;
}
.give-call-number a:hover {
background: #CE2026;
color: #fff;
border-color: #CE2026;
}
.give-call-email {
display: flex;
flex-direction: column;
padding-bottom: 3em;
}
#give-call img {
width: auto;
}
/*-- -------------------------------------------- -->
<!-- ICONS -->
<!-- -------------------------------------------- -*/
#icons {
background: #EEF0E4;
color: #2F2E2E;
height: 100%;
}
#icons i {
color: #CE2026;
}
.top-margin {
margin-top: 0;
padding-top: 3em;
font-size: 1.375em;
}
.margin-bottom {
margin-bottom: 3.5em;
}
#icons p {
line-height: 1.5em;
}
/*-- -------------------------------------------- -->
<!-- PARALLAX -->
<!-- -------------------------------------------- -*/
#parallax {
color: #fff;
height: 100%;
padding-bottom: 3em;
background: #CE2026;
}
.parallax-right h3 {
font-size: 2.375em;
margin-bottom: 0;
}
.parallax-margin-top {
margin-top: .2em;
}
.parallax-margin-top-1 {
margin-top: 0em;
padding-top: 1em;
}
.parallax-p {
line-height: 1.5em;
}
.parallax-p a {
text-decoration: none;
border: 2px solid #fff;
padding: 1em 25%;
color: #fff;
margin-top: 2em;
margin-bottom: 4em;
}
.parallax a:hover {
cursor: pointer;
background: white;
color: #CE2026;
}
/*-- -------------------------------------------- -->
<!-- CONTACT -->
<!-- -------------------------------------------- -*/
#contact-info {
text-align: left;
background: white;
color: #605E5E;
font-weight: 300;
padding-top: 3em;
height: 100%;
padding-bottom: 3.6em;
}
#adress p {
margin-bottom: 0;
margin-top: 0;
}
.red {
color: #ce2026;
font-weight: 400;
}
.form h6 {
font-size: 1.375em;
margin-bottom: 1em;
text-align: center;
}
.form {
width: 100%;
margin: .3em;
}
input, textarea {
margin: .4em;
font-size: 14px;
font-family: 'Raleway', sans-serif;
white-space: pre;
}
input[type=submit] {
background: #CE2026;
color: #fff;
font-size: 14px;
float: right;
padding: 7px 13px;
margin-right: 0;
border: none;
}
input[type=submit]:hover {
background: #831517;
cursor: pointer;
}
::-webkit-input-placeholder { /* Chrome */
color: #605E5E;
opacity: .5;
padding-left: 5px;
}
:-ms-input-placeholder { /* IE 10+ */
color: #605E5E;
opacity: .5;
margin-left: 5px;
padding-left: 5px;
}
::-moz-placeholder { /* Firefox 19+ */
color: #605E5E;
opacity: .5;
margin-left: 5px;
padding-left: 5px;
}
:-moz-placeholder { /* Firefox 4 - 18 */
color: red;
opacity: .5;
margin-left: 5px;
padding-left: 5px;
}
/*-- -------------------------------------------- -->
<!-- FOOTER -->
<!-- -------------------------------------------- -*/
footer {
color: #A0A09F;
background: #2F2E2E;
}
footer h3 {
font-size: 1em;
}
footer p {
font-size: .875em;
line-height: 1.5em;
}
footer li {
font-size: .875em;
line-height: 1.5em;
}
footer ul {
list-style: none;
text-align: center;
padding: 0;
}
.footer-item {
padding-top: 2em;
}
.margin-p {
margin-bottom: 0;
}
.facebook {
padding: 2em 0;
}
.facebook i {
color: #3b5998;
}
.copyright {
background: #242323;
color: #A0A09F;
}
.copy-center {
padding: 2em 0;
margin: 0;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,500,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Brushworks NW Inc.</title>
</head>
<body id="noScroll">
<!-- ----------------------------------------------------------------------------------- -->
<!-- NAVIGATION -->
<!-- ----------------------------------------------------------------------------------- -->
<nav class="navbar grid animated fadeIn ">
<div class="open-slide">
<div>
<a href="#" onclick="toggleNav()">
<svg width="30" height="30">
<path d="M0,5 35,5" stroke="#000" stroke-width="2"/>
<path d="M0,14 35,14" stroke="#000" stroke-width="2"/>
<path d="M0,23 35,23" stroke="#000" stroke-width="2"/>
</svg>
</a>
</div>
</div>
<img class="mobile-logo container" src="images/brushworks_logo.png" width="91px" height="91px">
<ul class="navbar-links">
<li><a class="active" href="#">HOME</a></li>
<li>ABOUT US</li>
<li>SERVICES</li>
<li>GALLERY</li>
<li>CONTACT US</li>
<li id="number">(360) 679-4444</li>
</ul>
</nav>
<div id="side-hidden-parent">
<div id="side-hidden"></div>
</div>
<div id="side-menu" class="side-nav">
<ul class="on-top">
<li>×</li>
<li class="nav-item"><a class="side-active" href="#">Home</a></li>
<li class="nav-item">About</li>
<li class="nav-item">Services</li>
<li class="nav-item">Contact</li>
</ul>
</div>
<main>
<section id="hero" class="grid">
<div class="container">
<img id="logo" class="animated fadeInRight" src="images/brushworks_logo.png" alt="brush roller">
<div class="heroText">
<h1 id="home-h" class="animated fadeInUp">The Best Painters For Your
Home or Business</h1>
<h2 id="home-p" class="animated fadeInUp">See why we're trusted for over 30 years to service Whidbey Island. Our results speak for themselves</h2>
<a class="learn animated fadeInRight href=">Services</a>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- RED STRIP -->
<!-- -------------------------------------------- -->
<section id="red-strip" class="grid">
<div class="container">
<div id="strip-1" class="strip-1-center animated slideInUp">
<div class="top">
<h3>Residential</h3>
<p>Our qualified staff are trained to use the techniques and materials that are best suited for each individual home.</p>
</div>
<div class="line"></div>
<div class="flex-1">
<h3>Commercial</h3>
<p>No matter what business you're in or how big you facility is, we have the staff and equipment to get it done</p>
</div>
<div class="line"></div>
<div class="flex-1">
<h3>Interior/Exterior</h3>
<p>Whether it's inside or out, we have you covered. Our staff can manage any texture and any material</p>
</div>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- GIVE CALL -->
<!-- -------------------------------------------- -->
<section id="give-call" class="grid">
<div class="container">
<div class="give-call-number">
<h3 class="gcn-call">Give us a call!</h3>
<h3 class="gcn-number">(360)679-444</h3>
<p class="gcn-p">We love working on Whidbey Island and the surrounding area. The diverse, eclectic and highly creative customer base keeps our staff and crew challenged and motivated to exceed our customers expectations.</p>
Contact Us
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- ICONS -->
<!-- -------------------------------------------- -->
<section id="icons" class="grid">
<div class="container">
<div class="icons-top">
<div>
<h4 class="top-margin">OFFERING YOU THE BEST SOLUTION FOR YOUR PROJECT</h4>
</div>
<div>
<p class="margin-bottom">We provide many painting services to our customers. All of our work is performed by our highly qualified staff and backed by our 100% customer satisfaction
guarantee.</p>
</div>
</div>
<div class="center-3">
<div class="local">
<div class="circle">
<i class="fas fa-map-pin fa-2x"></i>
</div>
<h2>LOCALLY OWNED</h2>
<p class="margin-bottom">With over 30 years experience as professional painters, we are one of the largest residential and commercial painting companies on Whidbey Island.</p>
</div>
<div class="value">
<div class="circle">
<i class="fas fa-dollar-sign fa-2x"></i>
</div>
<h2>BEST VALUE</h2>
<p class="margin-bottom">We are confident that we provide the highest quality work for the price. We take great pride in the work we do and refuse to let you pay for work that does not meet expectations.</p>
</div>
<div class="qualified">
<div class="circle">
<i class="fas fa-medal fa-2x"></i>
</div>
<h2>PROFESSIONALLY QUALIFIED</h2>
<p class="margin-bottom">We provide many painting services to our customers. All of our work is performed by our highly qualified staff and backed by our 100% customer satisfaction guarantee.</p>
</div>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- PARALLAX -->
<!-- -------------------------------------------- -->
<section id="parallax" class="grid">
<div class="container">
<div class="parallax-left">
</div>
<div class="parallax-right">
<h3 class="parallax-margin-top-1">Any Project,</h3>
<h3 class="parallax-margin-top">Any Size</h3>
<div class="parallax-p">
<p>Our shop can handle projects from small to large. Over that last 30 years we have seen it all and done it all. </p><br>
<a class="read" href="#">READ MORE</a>
</div>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- CONTACT INFO -->
<!-- -------------------------------------------- -->
<section id="contact-info" class="grid">
<div class="container">
<div id="adress">
<p class="red">Address</p>
<p class="regular">Brushworks NW <br>
691 Oak St. Unit I <br>
Oak Harbor, WA 98277
</p><br>
<p class="red">Telephone</p>
<p class="regular">Tel: (360) 679-4444 <br>
Fax: (360) 679-5026
</p><br>
<p class="red">Email</p>
<p class="regular">bwnwinc#gmail.com</p><br>
<p class="red">Opening Hours</p>
<p class="regular">Mon - Fri: 7am - 5pm</p>
</div>
<div class="form">
<div>
<h6>Call Or Email Us Today!</h6>
</div>
<form>
<input class="" type="text" name="name" placeholder="Full name" style="width: 100%; height: 30px"><br>
<input class="form" type="text" name="email" placeholder="Email" style="width: 100%; height: 30px"><br>
<textarea class="form" name="message" placeholder="Message" style="width: 99.5%; height: 100px"></textarea>
<input type="submit" value="Send">
</form>
</div>
</div>
</section>
</main>
</body>
</html>
Its better to use flex-box.
.container {
padding: 0 2em;
}
main {
position: relative;
top: -20%;
}
body, html {
width: 100%;
margin: 0;
padding: 0;
font-family: 'Raleway', sans-serif;
text-align: center;
overflow-x: hidden;
/*background: #CE2026;*/
}
/*-- ---------------------------------------------------------------- -->
<!-- NAVIGATION -->
<!-- --------------------------------------------------------------- --*/
.navbar {
background-color: #FFFFFF;
width: 100%;
height: 78px;
border-bottom: 8px solid #CE2026;
position: relative;
z-index: 1;
}
.navbar-links {
display: none;
}
#logo {
display: none;
}
.open-slide {
float: right;
margin-top: 25px;
margin-right: 20px;
display: block;
z-index: 4;
position: absolute;
right: 0;
}
.side-nav {
width: 0;
display: none;
height: 100%;
position: absolute;
top: 0;
background-color: #fff;
transition: 0.5s;
right: -1px;
text-align: right;
z-index: 15;
margin-top: 5%;
}
#side-hidden {
background-color: #000;
opacity: 0.9;
height: 100%;
position: absolute;
top: 0;
transition: 0.5s;
left: 0
margin: 0;
width: 0;
z-index: 6;
}
.side-nav ul {
display: block;
text-decoration: none;
z-index: 6;
/* Added this */
padding: 0;
position: relative;
top: -8%;
list-style: none;
}
/* Added this */
.nav-item {
display:block;
margin: 0;
}
.side-nav ul a {
position: relative;
width: 100%;
/* Changed this */
/* padding: 10px 130px 10px 100px;*/
padding: 20px 15px;
text-decoration: none;
color: #000;
margin-right: 20px;
z-index: 6;
/* Removed this */
/* right: 30px; */
text-align: right;
/* Added these */
display: block;
box-sizing: border-box;
}
.btn-close {
display: block;
background: #fff;
position: absolute;
top: 0;
/* Changed this */
/* left: 22px; */
left: 0;
font-size: 36px;
text-decoration: none;
color: #ccc;
right: 7px;
top: -10px;
}
.btn-close {
background: #fff;
color:#2F2E2E;
position: relative;
padding: 0;
margin: 0;
}
.btn-close a:hover {
color: #444;
cursor: pointer;
background: #fff;
}
.side-nav .btn-close:hover {
color: #fff
}
.side-nav li a:hover {
color: #fff;
background: #CE2026;
}
.side-active {
color: #ffffff !important;
background: #CE2026;
}
.mobile-logo {
position: relative;
top: 10%;
right: 0%;
padding: 0;
}
/*-- -------------------------------------------- -->
<!-- HERO STRIP -->
<!-- -------------------------------------------- -*/
#hero {
height: 100%;
width: 100%;
position: relative;
background:url("images/Landing.jpg") no-repeat center center fixed;
padding: 0;
margin: 0;
color: #fff;
border-bottom: 1px solid #CE2026;
}
#home-h {
width: 100%;
font-weight: 900;
font-size: 2.7em;
padding-top: .8em;
line-height: 1.4em;
margin-top: 0;
}
#home-p {
font-size: 1.25em;
padding-bottom: .8em;
font-weight: 350;
animation-delay: 0.3s;
margin: 0;
}
.learn {
display: inline-block;
border-style: solid;
border-width: 2px;
border-color: #FFFFFF;
font-size: 17px;
margin: 28px 0;
padding: 18px 80px;
color: #FFFFFF;
text-decoration: none;
animation-delay: 0.6s;
}
.heroText a:hover {
background: #fff;
border-color: #fff;
color: #CE2026;
transition: background 0.4s ease 0s;
transition-property: background;
transition-duration: 0.4s;
transition-timing-function: ease;
transition-delay: 0s;
cursor: pointer;
}
/*-- -------------------------------------------- -->
<!-- RED STRIP -->
<!-- -------------------------------------------- -*/
#red-strip {
background: #CE2026;
color: #fff;
height: 100%;
padding: 0;
margin: 0;
padding-bottom: 0em;
}
#strip-1 {
margin-top: 0;
padding-top: 0;
}
#strip-1 h3 {
font-size: 1.313em;
}
#strip-1 p {
line-height: 1.4em;
}
.top h3 {
margin-top: 0;
padding-top: 0;
}
.strip-1-center {
padding: 1.8em;
}
.strip-1-center h3 {
padding-top: 1em;
}
/*-- -------------------------------------------- -->
<!-- GIVE CALL -->
<!-- -------------------------------------------- -*/
#give-call {
margin-top: 1em;
padding: 0;
background: #fff;
height: 100%;
}
.gcn-call, .gcn-number {
font-size: 1.375em;
}
.gcn-call {
margin-bottom: 0;
padding-top: 3em;
}
.gcn-number {
margin-top: .4em;
}
.gcn-p {
line-height: 1.5em;
margin-bottom: 3em;
}
.give-call-number {
margin-bottom: 5em;
}
.give-call-number a {
border: 2px solid #000;
border-radius: 25px;
position: relative;
padding: 15px 25%;
margin-top: 2em;
margin-bottom: 2em;
text-decoration: none;
color:#2F2E2E;
}
.give-call-number a:hover {
background: #CE2026;
color: #fff;
border-color: #CE2026;
}
.give-call-email {
display: flex;
flex-direction: column;
padding-bottom: 3em;
}
#give-call img {
width: auto;
}
/*-- -------------------------------------------- -->
<!-- ICONS -->
<!-- -------------------------------------------- -*/
#icons {
background: #EEF0E4;
color: #2F2E2E;
height: 100%;
}
#icons i {
color: #CE2026;
}
.top-margin {
margin-top: 0;
padding-top: 3em;
font-size: 1.375em;
}
.margin-bottom {
margin-bottom: 3.5em;
}
#icons p {
line-height: 1.5em;
}
/*-- -------------------------------------------- -->
<!-- PARALLAX -->
<!-- -------------------------------------------- -*/
#parallax {
color: #fff;
height: 100%;
padding-bottom: 3em;
background: #CE2026;
}
.parallax-right h3 {
font-size: 2.375em;
margin-bottom: 0;
}
.parallax-margin-top {
margin-top: .2em;
}
.parallax-margin-top-1 {
margin-top: 0em;
padding-top: 1em;
}
.parallax-p {
line-height: 1.5em;
}
.parallax-p a {
text-decoration: none;
border: 2px solid #fff;
padding: 1em 25%;
color: #fff;
margin-top: 2em;
margin-bottom: 4em;
}
.parallax a:hover {
cursor: pointer;
background: white;
color: #CE2026;
}
/*-- -------------------------------------------- -->
<!-- CONTACT -->
<!-- -------------------------------------------- -*/
#contact-info {
text-align: left;
background: white;
color: #605E5E;
font-weight: 300;
padding-top: 3em;
height: 100%;
padding-bottom: 3.6em;
}
#adress p {
margin-bottom: 0;
margin-top: 0;
}
.red {
color: #ce2026;
font-weight: 400;
}
.form h6 {
font-size: 1.375em;
margin-bottom: 1em;
text-align: center;
}
.form {
/* width: 100%; */ // <-- Not required
margin: .3em;
}
/* Make the form flex box */
form {
display: flex;
flex-flow: row wrap;
}
input, textarea {
margin: .4em;
font-size: 14px;
font-family: 'Raleway', sans-serif;
white-space: pre;
}
input[type=submit] {
background: #CE2026;
color: #fff;
font-size: 14px;
float: right;
padding: 7px 13px;
/* margin-right: 0; */ // <-- Not required
border: none;
flex: 1 1 auto; // <-- If you want button of full width
}
input[type=submit]:hover {
background: #831517;
cursor: pointer;
}
::-webkit-input-placeholder { /* Chrome */
color: #605E5E;
opacity: .5;
padding-left: 5px;
}
:-ms-input-placeholder { /* IE 10+ */
color: #605E5E;
opacity: .5;
margin-left: 5px;
padding-left: 5px;
}
::-moz-placeholder { /* Firefox 19+ */
color: #605E5E;
opacity: .5;
margin-left: 5px;
padding-left: 5px;
}
:-moz-placeholder { /* Firefox 4 - 18 */
color: red;
opacity: .5;
margin-left: 5px;
padding-left: 5px;
}
/*-- -------------------------------------------- -->
<!-- FOOTER -->
<!-- -------------------------------------------- -*/
footer {
color: #A0A09F;
background: #2F2E2E;
}
footer h3 {
font-size: 1em;
}
footer p {
font-size: .875em;
line-height: 1.5em;
}
footer li {
font-size: .875em;
line-height: 1.5em;
}
footer ul {
list-style: none;
text-align: center;
padding: 0;
}
.footer-item {
padding-top: 2em;
}
.margin-p {
margin-bottom: 0;
}
.facebook {
padding: 2em 0;
}
.facebook i {
color: #3b5998;
}
.copyright {
background: #242323;
color: #A0A09F;
}
.copy-center {
padding: 2em 0;
margin: 0;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,500,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Brushworks NW Inc.</title>
</head>
<body id="noScroll">
<!-- ----------------------------------------------------------------------------------- -->
<!-- NAVIGATION -->
<!-- ----------------------------------------------------------------------------------- -->
<nav class="navbar grid animated fadeIn ">
<div class="open-slide">
<div>
<a href="#" onclick="toggleNav()">
<svg width="30" height="30">
<path d="M0,5 35,5" stroke="#000" stroke-width="2"/>
<path d="M0,14 35,14" stroke="#000" stroke-width="2"/>
<path d="M0,23 35,23" stroke="#000" stroke-width="2"/>
</svg>
</a>
</div>
</div>
<img class="mobile-logo container" src="images/brushworks_logo.png" width="91px" height="91px">
<ul class="navbar-links">
<li><a class="active" href="#">HOME</a></li>
<li>ABOUT US</li>
<li>SERVICES</li>
<li>GALLERY</li>
<li>CONTACT US</li>
<li id="number">(360) 679-4444</li>
</ul>
</nav>
<div id="side-hidden-parent">
<div id="side-hidden"></div>
</div>
<div id="side-menu" class="side-nav">
<ul class="on-top">
<li>×</li>
<li class="nav-item"><a class="side-active" href="#">Home</a></li>
<li class="nav-item">About</li>
<li class="nav-item">Services</li>
<li class="nav-item">Contact</li>
</ul>
</div>
<main>
<section id="hero" class="grid">
<div class="container">
<img id="logo" class="animated fadeInRight" src="images/brushworks_logo.png" alt="brush roller">
<div class="heroText">
<h1 id="home-h" class="animated fadeInUp">The Best Painters For Your
Home or Business</h1>
<h2 id="home-p" class="animated fadeInUp">See why we're trusted for over 30 years to service Whidbey Island. Our results speak for themselves</h2>
<a class="learn animated fadeInRight href=">Services</a>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- RED STRIP -->
<!-- -------------------------------------------- -->
<section id="red-strip" class="grid">
<div class="container">
<div id="strip-1" class="strip-1-center animated slideInUp">
<div class="top">
<h3>Residential</h3>
<p>Our qualified staff are trained to use the techniques and materials that are best suited for each individual home.</p>
</div>
<div class="line"></div>
<div class="flex-1">
<h3>Commercial</h3>
<p>No matter what business you're in or how big you facility is, we have the staff and equipment to get it done</p>
</div>
<div class="line"></div>
<div class="flex-1">
<h3>Interior/Exterior</h3>
<p>Whether it's inside or out, we have you covered. Our staff can manage any texture and any material</p>
</div>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- GIVE CALL -->
<!-- -------------------------------------------- -->
<section id="give-call" class="grid">
<div class="container">
<div class="give-call-number">
<h3 class="gcn-call">Give us a call!</h3>
<h3 class="gcn-number">(360)679-444</h3>
<p class="gcn-p">We love working on Whidbey Island and the surrounding area. The diverse, eclectic and highly creative customer base keeps our staff and crew challenged and motivated to exceed our customers expectations.</p>
Contact Us
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- ICONS -->
<!-- -------------------------------------------- -->
<section id="icons" class="grid">
<div class="container">
<div class="icons-top">
<div>
<h4 class="top-margin">OFFERING YOU THE BEST SOLUTION FOR YOUR PROJECT</h4>
</div>
<div>
<p class="margin-bottom">We provide many painting services to our customers. All of our work is performed by our highly qualified staff and backed by our 100% customer satisfaction
guarantee.</p>
</div>
</div>
<div class="center-3">
<div class="local">
<div class="circle">
<i class="fas fa-map-pin fa-2x"></i>
</div>
<h2>LOCALLY OWNED</h2>
<p class="margin-bottom">With over 30 years experience as professional painters, we are one of the largest residential and commercial painting companies on Whidbey Island.</p>
</div>
<div class="value">
<div class="circle">
<i class="fas fa-dollar-sign fa-2x"></i>
</div>
<h2>BEST VALUE</h2>
<p class="margin-bottom">We are confident that we provide the highest quality work for the price. We take great pride in the work we do and refuse to let you pay for work that does not meet expectations.</p>
</div>
<div class="qualified">
<div class="circle">
<i class="fas fa-medal fa-2x"></i>
</div>
<h2>PROFESSIONALLY QUALIFIED</h2>
<p class="margin-bottom">We provide many painting services to our customers. All of our work is performed by our highly qualified staff and backed by our 100% customer satisfaction guarantee.</p>
</div>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- PARALLAX -->
<!-- -------------------------------------------- -->
<section id="parallax" class="grid">
<div class="container">
<div class="parallax-left">
</div>
<div class="parallax-right">
<h3 class="parallax-margin-top-1">Any Project,</h3>
<h3 class="parallax-margin-top">Any Size</h3>
<div class="parallax-p">
<p>Our shop can handle projects from small to large. Over that last 30 years we have seen it all and done it all. </p><br>
<a class="read" href="#">READ MORE</a>
</div>
</div>
</div>
</section>
<!-- -------------------------------------------- -->
<!-- CONTACT INFO -->
<!-- -------------------------------------------- -->
<section id="contact-info" class="grid">
<div class="container">
<div id="adress">
<p class="red">Address</p>
<p class="regular">Brushworks NW <br>
691 Oak St. Unit I <br>
Oak Harbor, WA 98277
</p><br>
<p class="red">Telephone</p>
<p class="regular">Tel: (360) 679-4444 <br>
Fax: (360) 679-5026
</p><br>
<p class="red">Email</p>
<p class="regular">bwnwinc#gmail.com</p><br>
<p class="red">Opening Hours</p>
<p class="regular">Mon - Fri: 7am - 5pm</p>
</div>
<div class="form">
<div>
<h6>Call Or Email Us Today!</h6>
</div>
<form>
<input class="" type="text" name="name" placeholder="Full name" style="width: 100%; height: 30px"><br>
<input class="form" type="text" name="email" placeholder="Email" style="width: 100%; height: 30px"><br>
<textarea class="form" name="message" placeholder="Message" style="width: 99.5%; height: 100px"></textarea>
<input type="submit" value="Send">
</form>
</div>
</div>
</section>
</main>
</body>
</html>

Correct way to animate div resize with text in it

What is the correct way of resizing divs with text in it? I use the code below, but it leaves me with noticeable font distortion when resizing. Its kinda like the font has changed during animation. Also there is a flicker inside the circles. The effect isn't really visible on OSX, but it is on windows machines. How do I fix it?
.content-no-btn {
transition: all .2s ease-in-out;
}
.content-no-btn:hover {
transform: scale(1.05);
}
.entry-content {
border-style: solid;
border-color: #bbb;
border-width: 0px 3px 3px 3px;
padding-top: 20px;
}
#price {
text-align: center;
}
.plan {
display: inline-block;
margin: 10px 1%;
font-family: 'Lato', Arial, sans-serif;
}
.plan-inner {
background: #fff;
margin: 0 auto;
min-width: 280px;
max-width: 100%;
position: relative;
}
.entry-title {
background: #53CFE9;
height: 140px;
position: relative;
text-align: center;
color: #fff;
margin-bottom: 0px;
}
.entry-title>h3 {
background: #20BADA;
font-size: 20px;
padding: 5px 0;
text-transform: uppercase;
font-weight: 700;
margin: 0;
}
.entry-title .price {
position: absolute;
bottom: -25px;
background: #20BADA;
height: 95px;
width: 95px;
margin: 0 auto;
left: 0;
right: 0;
overflow: hidden;
border-radius: 50px;
border: 4px solid #fff;
line-height: 80px;
font-size: 23px;
font-weight: 700;
}
.price span {
position: absolute;
font-size: 8px;
bottom: -10px;
left: 30px;
font-weight: 400;
}
.entry-content {
color: #323232;
padding-top: 20px;
}
.entry-content ul {
margin: 0;
padding: 0;
list-style: none;
text-align: center;
}
.entry-content li {
border-bottom: 1px solid #E5E5E5;
padding: 10px 0;
}
.entry-content li:last-child {
border: none;
}
.btn {
padding: 5em 0 5em 0;
text-align: center;
}
.btn a {
background: #323232;
padding: 10px 30px;
color: #fff;
text-transform: uppercase;
font-weight: 700;
text-decoration: none
}
.hot {
position: absolute;
top: -7px;
background: #F80;
color: #fff;
text-transform: uppercase;
z-index: 2;
padding: 2px 5px;
font-size: 9px;
border-radius: 2px;
right: 10px;
font-weight: 700;
}
.basic .entry-title {
background: #f37920;
}
.basic .entry-title > h3 {
background: #E7680C;
}
.basic .price {
background: #f37920;
}
.standard .entry-title {
background: #4484c1;
}
.standard .entry-title > h3 {
background: #3772aa;
}
.standard .price {
background: #3772aa;
}
.ultimite .entry-title > h3 {
background: #DD4B5E;
}
.ultimite .entry-title {
background: #F75C70;
}
.ultimite .price {
background: #DD4B5E;
}
.gratitude {
padding: 5em 20px 5em 20px;
height: 300px;
text-align: center;
background-color: #f8f9f9;
}
.orderDetailsContent {
max-width: 800px;
text-align: center;
display: table;
position: relative;
margin: auto;
}
<div id="price">
<!--price tab-->
<div class="plan">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title first-entry-title">
<h3>WHATUP </h3>
<div class="price">$0.99<span></span>
</div>
</div>
<div class="entry-content first-entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan basic">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title">
<h3>YEAH </h3>
<div class="price">$1.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan standard">
<div class="plan-inner">
<div class="content-no-btn">
<div class="hot">hot</div>
<div class="entry-title">
<h3>Superduper</h3>
<div class="price">$2.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan ultimite">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title">
<h3>JustGreat</h3>
<div class="price">$3.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
</div>
<div class="gratitude"></div>
Scale transformations of such a small percentage are notorious for this. The only way around it is better browsers.
Instead, consider a translate animation with a whole number of pixels, perhaps upwards. You can also get some scale effect by setting position:relative on .content-no-btn then adding an absolutely positioned ::before with 100% width and height, and scaling only that pseudo-element on hover.

Footer ~ Positioning//With a twist

So I took use of the 'Sticky Footer' code which automatically places the footer below all of the content, my problem is that my content height is set to 1300 pixels, meaning if you have a screen with a height more than 1300 pixels the footer will not appear at the bottom of the screen but rather below the content.
Here's my code:
#import 'https://fonts.googleapis.com/css?family=PT+Mono';
body {
font-family: 'PT Mono', monospace;
background: linear-gradient(to bottom, #1D4350 , #A43931);
background-attachment: scroll;
}
#content {
height: 1300px;
width: 100%;
}
html, #wrapper {
max-width: 100%;
min-height: 100%;
min-width: 960px;
margin: 0 auto;
width: 100%;
}
#wrapper {
position: relative;
}
.Octagon {
color: #2aa186;
text-align: center;
line-height: 30%;
margin-top: 25px;
}
.LT {
text-align: center;
color: #3a5454;
line-height: 0%;
font-style: italic;
}
.boi {
cursor: pointer;
margin-right: 30px;
padding: 8px 18px;
border: 1px solid #204156;
border-color: #52AEC9;
color: #52AEC9;
position: absolute;
top: 8px;
right: 16px;
}
.boi:active {
top: 2px;
}
.iob {
cursor: pointer;
margin-left: 30px;
padding: 8px 18px;
border: 1px solid #204156;
border-color: #52AEC9;
color: #52AEC9;
position: absolute;
top: 8px;
}
#verr {
}
.boi:active,
.iob:active {
top: 2px;
}
#manyarms {
position: absolute;
margin-top: 30px;
margin-left: 31px;
}
#sensible {
position: absolute;
margin-top: 30px;
margin-right: 31px;
right: 10px;
}
.boi:hover,
.iob:hover {
text-shadow: 0 0 10px #a193ff;
}
#footer {
text-align: right;
margin-right: 10px;
}
<html>
<head>
<title>The Pragmatic Octopus</title>
<meta charset="utf-8"/>
<link rel='stylesheet' href='style.css'/>
<script src='script.js'></script>
</head>
<body>
<div id="wrapper">
<div id="header">
<h1 class="Octagon">The Pragmatic Octopus</h1>
<p class="LT">Lee Townsend</p>
<a href="www.google.com">
<p class="boi">Contact</p>
</a>
<a href="www.google.com">
<p class="iob">Information</p>
</a>
</div>
<div id="content">
<div id="manyarms">
<img src="https://s32.postimg.org/406x38nlh/imageedit_1_3827627792 .jpg" alt="mmm~" style="width:310px; height:250px;">
<p style="color: #6458b7;" id="verr">Here comes a very special boi!</p>
</div>
<div id="sensible">
<img src="http://www.wonderslist.com/wp-content/uploads/2014/07/Blue-ringed-octopus.jpg" alt="~mmm" style="width:310px; height:250px;">
<p style="color:#6458b7;">He loves to pose for photos!</p>
</div>
</div>
</div>
<div id="footer">
© Hecc
</div>
</body>
</html>
I apologize if my wording makes this problem difficult to visualize.
Any help is greatly appreciated!
Your question is a little ambiguous - I think you are asking "how do I fix my footer to the bottom of the screen (window), not below the content?".
You can use position fixed for that.
article {
height: 1300px;
}
footer {
position: fixed;
width: 100%;
left: 0;
bottom: 0;
background: lightpink;
padding: 0 1rem;
}
<body>
<article>
<p>This is the page content</p>
</article>
<footer>
<p>I am a fixed footer</p>
</footer>
</body>

Why is my div being pushed down?

I'm trying to move the white box, topBoxFlag up to the top of its parent topBox. However, due to the relative layout it's being pushed down below the red box. How would I push it upwards? I tried an absolute layout, but decided this wouldn't work as it'd occur for all of my other boxes and I feel it'd be extremely inefficient. Is there something like float that can push it right to the top of its parent?
body
{
background-color: #C6E0F5;
}
#wrapper
{
position: relative;
margin: auto;
width: 1000px;
height: 2900px;
max-width: 1000px;
background-color: #C6E0F5;
}
#header
{
position: relative;
width: 100%;
height: 170px;
background-color: #00247D;
}
#navbar
{
position: relative;
width: auto;
bottom: 20px;
height: 35px;
text-align: center;
background-color: #CF142B;
}
#navbar ul li
{
list-style-type: none;
padding: 20px;
text-align: center;
font-family: "Trebuchet MS";
font-size: 25px;
display: inline;
}
#navbar ul li a
{
text-decoration: none;
font-weight: bold;
color: #fff;
}
.topbox
{
height: 400px;
width: 800;
margin: auto;
background-color: #00247D;
}
.topbox h1
{
font-size: 35px;
font-family: "Trebuchet MS";
text-align: center;
color: #fff;
width: 500px;
background-color: #CF142B;
}
.topbox #topboxFlag
{
float: right;
width: 300px;
height: 400px;
background-color: #fff;
}
.partybox
{
height: 400px;
width: 800;
margin: auto;
background-color: #00247D;
margin-top: 15px;
}
.partybox h1
{
font-size: 35px;
font-family: "Trebuchet MS";
text-align: center;
color: #fff;
width: 500px;
background-color: #CF142B;
}
<html>
<head>
<title>Learn which parties are doing what</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id = "wrapper">
<div id = "header">
<div id = "logo"></div>
</div>
<div id = "navbar">
<ul>
<li>Major Parties</li>
<li>Minor Parties</li>
<li>Why Vote</li>
<li>About Us</li>
</ul>
</div>
<div class = "topbox">
<h1>The Conservative Party</h1>
<div id = "topboxFlag"></div>
</div>
<div class = "partybox">
<h1>The Labour Party</h1>
<div id = "partyboxFlag"></div>
</div>
<div class = "partybox">
<h1>The Liberal Democrats</h1>
</div>
<div class = "partybox">
<h1>The UK Independence Party</h1>
</div>
<div class = "partybox">
<h1>The Green Party</h1>
</div>
<div class = "partybox">
<h1>The Scottish National Party</h1>
</div>
</div>
</body>
</html>
Just add one more css to you stylesheet and you are good to go.
.topbox h1{
margin:0;
float: left;
}
Since you topboxFlag class has a float, you should also add float to your heading.
body {
background-color: #C6E0F5;
}
#wrapper {
position: relative;
margin: auto;
width: 1000px;
height: 2900px;
max-width: 1000px;
background-color: #C6E0F5;
}
#header {
position: relative;
width: 100%;
height: 170px;
background-color: #00247D;
}
#navbar {
position: relative;
width: auto;
bottom: 20px;
height: 35px;
text-align: center;
background-color: #CF142B;
}
#navbar ul li {
list-style-type: none;
padding: 20px;
text-align: center;
font-family: "Trebuchet MS";
font-size: 25px;
display: inline;
}
#navbar ul li a {
text-decoration: none;
font-weight: bold;
color: #fff;
}
.topbox {
height: 400px;
width: 800;
margin: auto;
background-color: #00247D;
}
.topbox h1 {
font-size: 35px;
font-family: "Trebuchet MS";
text-align: center;
color: #fff;
width: 500px;
background-color: #CF142B;
}
.topbox #topboxFlag {
float: right;
width: 300px;
height: 400px;
background-color: #fff;
}
.partybox {
height: 400px;
width: 800;
margin: auto;
background-color: #00247D;
margin-top: 15px;
}
.partybox h1 {
font-size: 35px;
font-family: "Trebuchet MS";
text-align: center;
color: #fff;
width: 500px;
background-color: #CF142B;
}
.topbox h1 {
margin: 0;
float: left;
}
<html>
<head>
<title>Learn which parties are doing what</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo"></div>
</div>
<div id="navbar">
<ul>
<li>Major Parties
</li>
<li>Minor Parties
</li>
<li>Why Vote
</li>
<li>About Us
</li>
</ul>
</div>
<div class="topbox">
<h1>The Conservative Party</h1>
<div id="topboxFlag"></div>
</div>
<div class="partybox">
<h1>The Labour Party</h1>
<div id="partyboxFlag"></div>
</div>
<div class="partybox">
<h1>The Liberal Democrats</h1>
</div>
<div class="partybox">
<h1>The UK Independence Party</h1>
</div>
<div class="partybox">
<h1>The Green Party</h1>
</div>
<div class="partybox">
<h1>The Scottish National Party</h1>
</div>
</div>
</body>
</html>
Can you make the flag div first?
<div class="topbox">
<div id="topboxFlag></div>
<h1>The Conservative Party</h1>
</div>