Q1
Firstly, how can I move down and without affecting the content within section 1 so the icons will be inline with the navigation bar text "Liam Docherty's Digital Portfolio" using bootstrap?
Here is a picture of how my site currently looks so you can see the current issue at hand.
JSFiddle
<style>
body {
margin: 0;
padding: 0;
}
.navbar.navbar-default {
background-color: #4D5061;
height: 10vh;
z-index: 100;
}
.navbar.navbar-default ul {
list-style-type: none;
text-align: right;
}
.navbar.navbar-default ul li {
display: inline-block;
}
.dropdown-menu li {
text-align: center
}
.dropdown .dropdown-menu {
background-color: #4D5061;
}
.dropdown .dropdown-menu a {
color: white;
}
.navbar.navbar-default ul li a {
display: inline-block;
padding: 3.5vh 8px 4px;
color: white;
text-decoration: none;
font-size: 14pt;
font-family: 'Roboto', sans-serif;
}
.navbar.navbar-default ul li:after {
content: '';
position: absolute;
right: 50%;
bottom: 0;
left: 50%;
height: 3px;
background-color: #FFFFFF;
border-radius: 9px;
transition: all .2s;
}
.navbar.navbar-default ul li a:hover {
color: white;
background-color: rgba(20, 50, 40, 0.5)
}
.nav.navbar-nav,
.nav.navbar-nav>li {
float: none;
}
.navbar.navbar-default ul li:hover:after {
right: 0;
left: 0;
}
.nav-title {
font-size: 14pt;
margin: 0;
top: 35px;
left: 50px;
width: 100%;
position: absolute;
text-align: center;
color: white;
font-family: 'Roboto', sans-serif;
}
.navbar.navbar-default ul.dropdown-menu li,
.navbar.navbar-default ul.dropdown-menu li a {
position: relative;
display: block;
}
#logo {
padding-top: 2vh;
padding-left: 20px;
float: left;
}
.hero {
background: url("https://static.pexels.com/photos/48727/pexels-photo-48727.jpeg") center center no-repeat;;
background-attachment: fixed;
position: relative;
background-size: cover;
width: 100%;
max-width: 100%;
width: 100vw;
height: 100%;
}
section {
position: relative;
padding:10vh 0 0;
min-height:100vh;
}
.section1 {
height: 100vh;
text-align: center;
color: white;
}
.section2 {
background-color: #FFFFFF;
text-align: center;
color: white;
min-height:90vh;
}
.fa-angle-down {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.fa-angle-up {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.icon-style {
position: relative;
top:20px;
}
.footer {
height: 3vh;
background-color: #4D5061;
padding: 0;
right: 0;
bottom: 0;
left: 0;
}
.footertext {
font-size: 14pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.profile.box {
bottom: 0;
height: 50%;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 50%;
}
.shape {
border-radius: 25px;
display: inline-block;
background: #4D5061;
content: url(http://i1126.photobucket.com/albums/l611/ldocherty1/IMG_0730_zpsiz4dqc47.jpg);
color: white;
height: 250px;
margin: auto;
padding: 3px;
width: 250px;
}
.shape2 {
background: linear-gradient(35deg, #4D5061, #4D5061);
border-radius: 85px;
color: white;
height: 40px;
margin: 1% auto;
opacity: 0.9;
display: inline-block;
padding: 0px;
width: 250px;
}
.fa {
padding: 20px;
font-size: 20px;
text-align: center;
text-decoration: none;
margin: 7px 6px;
border-radius: 50%;
}
.fa:hover {
opacity: 0.7;
}
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa-linkedin {
background: #007bb5;
color: white;
}
#import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
#feedback-page{
text-align:center;
}
#form-main{
width:100%;
float:left;
padding-top:0px;
}
#form-div {
background-color:rgba(72,72,72,0.4);
padding-left:35px;
padding-right:35px;
padding-top:35px;
padding-bottom:50px;
width: 850px;
height: 500px;
float: left;
left: 50%;
position: absolute;
margin-top:30px;
margin-left: -260px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.feedback-input {
color:#3c3c3c;
font-family: Helvetica, Arial, sans-serif;
font-weight:500;
font-size: 18px;
border-radius: 0;
line-height: 22px;
background-color: #fbfbfb;
padding: 13px 13px 13px 54px;
margin-bottom: 10px;
width:100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
border: 3px solid rgba(0,0,0,0);
}
.feedback-input:focus {
background: #fff;
box-shadow: 0;
border: 3px solid #3498db;
color: #3498db;
outline: none;
padding: 13px 13px 13px 54px;
}
.focused{
color:#30aed6;
border:#30aed6 solid 3px;
}
#name {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#name:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 8px 5px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#comment {
background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
textarea {
width: 100%;
height: 150px;
line-height: 150%;
resize:vertical;
}
input:hover, textarea:hover,
input:focus, textarea:focus {
background-color:white;
}
#button-blue {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
float:left;
width: 100%;
border: #fbfbfb solid 4px;
cursor:pointer;
background-color: #3498db;
color:white;
font-size:24px;
padding-top:22px;
padding-bottom:22px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top:-4px;
font-weight:700;
}
#button-blue:hover {
background-color: rgba(0,0,0,0);
color: #0493bd;
}
.submit:hover {
color: #3498db;
}
.ease {
width: 0px;
height: 74px;
background-color: #fbfbfb;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
.submit:hover .ease {
width:100%;
background-color:white;
}
#media only screen and (max-width: 580px) {
#form-div {
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h1 class="nav-title">Liam Docherty's Digital Portfolio</h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Home
</li>
<li class="dropdown">
About Me <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Contact
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li class="dropdown">
Units <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Another action
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li>Clients
</li>
<li>Contact Me
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<section id="section1" class="section1">
<div class="hero">
<div class="profile box">
<div class="shape"></div>
<div class="shape2">
<p>kjjjjjjjjjkjjjkkjkj</p>
</div>
</div>
</div>
<i class="fa fa-angle-down" style="font-size:100px;"></i>
</section>
<section id="contact-me" class="contact_section section2">
<h2 class="contact-text">Contact Me Now!</h2>
<div id="form-main">
<div id="form-div">
<form class="form" id="form1">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
</p>
<div class="submit">
<input type="submit" value="SEND" id="button-blue"/>
<div class="ease"></div>
</div>
</form>
</div>
<i class="fa fa-angle-up" style="font-size:100px;"></i>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<footer>
<div class="footer">
<h2 class="footertext">Copyright © 2017 Liam Docherty's Site. All rights reserved.</h2>
</div>
</footer>
</body>
</html>
The fiddle is not displaying properly so its tough to say, but try the following CSS to the .fa elements:
position: relative;
top: 10px;
adjust top to whatever works
You can try and add this to your css. You can adjust margin-top according to your needs, this should work since you got simple links.
.navbar-header a.fa-twitter, .navbar-header a.fa-linkedin {
display:inline-block;
margin-top:5px;
}
Try this:
HTML
CSS
.icon-style {
position: relative;
top:20px;
}
Related
body {
font-family: Bahnschrift SemiBold, sans-serif;
background-color: #fcfefe;
width: 100%;
height: 100%;
overflow-x: hidden;
}
*{
margin:0; padding: 0;
}
.logonav{
position: top;
left: 0px;
width: 250px;
height: 65px;
padding-top: 70px;
padding-bottom: 20px;
padding-left: 40px;
}
.content{
position: absolute;
bottom: 330px;
left: 30px;
text-align: justify;
font-size: 20px;
font-family: 'Titillium Web', sans-serif;
color: #ffffff;
}
.bn632-hover {
position: absolute;
bottom: 200px;
left: 1200px;
width: 160px;
font-size: 16px;
font-weight: 600;
color: #00bbf0;
cursor: pointer;
margin: 20px;
height: 55px;
text-align:center;
color: whitesmoke;
border: none;
background-size: 300% 100%;
border-radius: 50px;
moz-transition: all .4s ease-in-out;
-o-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out;
transition: all .4s ease-in-out;
}
.bn632-hover:hover {
background-position: 100% 0;
moz-transition: all .4s ease-in-out;
-o-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out;
transition: all .4s ease-in-out;
}
.bn632-hover:focus {
outline: none;
}
.bn632-hover.bn18 {
background-image: linear-gradient(
to right,
#25aae1,
#00bbf0,
#00bbf0,
#00bbf0
);
box-shadow: 0 4px 15px 0 rgba(49, 196, 190, 0.75);
}
.image_container.img{
max-height: 100vh;
max-width: 100%;
object-fit: cover;
object-position: bottom;
}
.pozadina{
background-color: #83a3c7;
background-image: url("womandoctor.jpg");
background-size: cover;
width: 110%;
background-blend-mode: normal;
position: relative;
padding-top: 450px;
padding-bottom: 100px;
}
.hornav1{
overflow: hidden;
width: 100%;
background-color: #00bbf0;
list-style-type: none;
margin: 0px;
padding: 0px;
border-bottom: solid 2px #eaf6f6;
size: 100px;
position:fixed;
top:0;
z-index:100;
}
.hornav1 a{
float: right;
color: whitesmoke;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
box-sizing: border-box;
margin-left: 5px 10 px;
}
.hornav1 i{
color: whitesmoke;
}
#pocetna{
padding-right: 1000px;
font-size: 20px;
}
.hornav2{
overflow: hidden;
width: 100%;
background-color: #ffffff;
list-style-type: none;
margin: 0px;
padding: 0px;
position: sticky;
top: 0px;
border-bottom: solid 2px #eaf6f6;
}
.hornav2 a{
float: right;
color: #333;
text-align: center;
padding: 14px 16px;
font-size: 17px;
box-sizing: border-box;
margin-left: 5px 10 px;
}
.hornav3{
overflow: hidden;
width: 100%;
background-color: #00bbf0;
list-style-type: none;
margin: 0px;
padding: 10px;
position:sticky;
border-bottom: solid 2px #eaf6f6;
size: 150px;
}
.hornav3 a{
position: relative;
color: whitesmoke;
text-align: center;
padding-left: 50px;
text-decoration: none;
font-size: 24px;
box-sizing: border-box;
right : -270px;
}
.navcontainer{
top:0;
width:100%;
z-index:100;
}
.hornav3 a::before{
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 0;
height: 2px;
background-color: whitesmoke;
transition: width 0.6s cubic-bezier(0.5, 1, 0.5, 1);
}
#media (hover: hover) and (pointer: fine) {
.hornav3 a:hover::before{
left: 0.5;
right: auto;
width: 70%;
}
}
.pregledi{
background-color: #fafafa;
}
.pregledi .heading{
padding-top: 40px;
text-transform: uppercase;
color: deepskyblue;
text-align: center;
font-size: 35px;
}
.pregledi .heading2{
padding-top: 5px;
text-align: center;
font-size: 20px;
font-family: unset;
color: #2c5d63;
}
.pregledi .box-container{
padding-top: 30px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(20rem, 7fr));
gap:4rem;
margin-left: 60px;
margin-right: 30px;
}
.pregledi .box-container .box h3{
padding-top: 10px;
color: deepskyblue;
text-transform: uppercase;
font-size: 2.1rem;
}
.pregledi .box-container .box p{
padding-top: 10px;
font-family: sans-serif;
font-size: 1rem;
line-height: 1;
}
.pregledi .box-container .box a{
position: relative;
top: 10px;
}
.bn111 {
margin-top: 10px;
padding: 1.3em 0.01em;
font-size: 12px;
text-transform: uppercase;
text-indent: 10px;
letter-spacing: 2.5px;
font-weight: 500;
color: #ffffff;
background-color: #00bbf0;
border: none;
border-radius: 45px;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
transition: all 0.24s ease 0s;
cursor: pointer;
outline: none;
}
.bn111:hover {
background-color: #00bbf0;
box-shadow: 0px 15px 20px rgba(34, 180, 255, 0.4);
color: #ffffff;
transform: translateX(7px) translateY(-1.1px);
}
.bn111:active {
transform: translateY(-1px);
}
.bn111 i{
color: #ffffff;
font-size: 1.3em;
padding-right: 4px;
}
.izborna{
background-color: #83a3c7;
background-size: cover;
width: 100%;
background-blend-mode: normal;
opacity: 1;
display: block;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
.containerslike{
position: relative;
width: 100%;
max-width: 400px;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .3s ease;
background-color: #ececec;
}
.containerslike:hover .overlay {
opacity: 0.5;
}
.ikona {
color: deepskyblue;
font-size: 40px;
position: absolute;
top: 100%;
left: 45%;;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
opacity: 1;
}
.fa-magnifying-glass{
position: absolute;
top: 100px;
}
.bn112 {
margin-top: 10px;
padding: 1.3em 0.01em;
font-size: 18px;
text-transform: uppercase;
text-indent: 10px;
letter-spacing: 2.5px;
font-weight: 500;
color: #ffffff;
background-color: #00bbf0;
border: none;
border-radius: 45px;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
transition: all 0.24s ease 0s;
cursor: pointer;
outline: none;
width: 400px;
}
.bn112:hover {
background-color: #00bbf0;
box-shadow: 0px 15px 20px rgba(34, 180, 255, 0.4);
color: #ffffff;
transform: translateY(-1.1px);
}
.bn112:active {
transform: translateY(-1px);
}
.bn112 i{
color: #ffffff;
font-size: 1.3em;
padding-right: 4px;
}
.podnopregled{
margin-left: 500px;
}
.infodiv{
margin-top: 30px;
background-color: deepskyblue;
}
.row {
display: flex;
width: 100%;
}
.noMargin {
margin: 1px;
}
.one {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 30px;
}
.two {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 30px;
}
.three {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 10px;
}
.four {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 10px;
}
.noMargin p{
text-align: center;
margin-top: 100px;
}
#media only screen and (max-width:800px) {
/* For tablets: */
.main {
width: 80%;
padding: 0;
}
.right {
width: 100%;
}
}
#media only screen and (max-width:500px) {
/* For mobile phones: */
.menu, .main, .right {
width: 100%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>VivaMed medicina rada i sporta</title>
<script src="https://kit.fontawesome.com/60681a69ff.js" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="VivamedCSS.css">
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:wght#300&display=swap" rel="stylesheet">
</head>
<body>
<div class="navcontainer">
<div class="hornav1">
<i class="fas fa-envelope" style="font-size:20px;"></i> info#vivamed.hr
<i class="fa-solid fa-phone"style="font-size:20px;" ></i> +385 1 233 55 00
Početna
</div>
<div class="hornav2">
<img src="vivalogo.webp" alt="logo" class="logonav">
<a class="active" style="font-size: 20px; padding-right: 550px; padding-top: 100px; font-family: 'Titillium Web', sans-serif; font-style: italic; font-weight: bolder;"> Zdrav radnik je uspješan i produktivan radnik.</a>
</div>
<div class="hornav3">
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-envelope" style="font-size:20px;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-cloud" style="font-size:20px; color: whitesmoke;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-comment" style="font-size:20px;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-car" style="font-size:20px;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/galerija"><i class="fas fa-bolt" style="font-size:20px;"></i> O nama</a>
<a class="active" href="file:///C:/Users/Admin/Desktop/Vivamed/VIVAMED%20JEDAN.html#slide-2"><i class="fas fa-envelope"></i> Početna</a>
</div>
</div>
<div class="pozadina">
<div class="content">
<h3>Dobro došli na stranicu Medicine rada i sporta VivaMed!</h3>
<p>Pogledajte sve profesionalne usluge koje nudi
<br>naš tim vrhunskih i renomiranih stručnjaka!
</p>
</div>
<button class="bn632-hover bn18">Naručite se!</button>
</div>
<section class="pregledi" id="pregledi">
<h1 class="heading"> <span> Stručno, brzo i povoljno! </span> </h1>
<h2 class="heading2"> <span>Izdvojeni pregledi</span></h3>
<div class="box-container">
<div class="box">
<div class="containerslike">
<img src="pexels-pixabay-262524.jpg" class="izborna">
<div class="overlay">
<a href="https://www.vivamed.hr/usluge/pregledi" class="ikona">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
<h3>Pregled sportaša</h3>
<p>Rekreativci, amateri, profesionalci</p>
<button class="bn111" id="bn111"> Opširnije<i class="fa-solid fa-arrow-right"></i></button>
</div>
<div class="box">
<div class="containerslike">
<img src="delivery-driver-smiling-camera-his-van_13339-235836.jpg" class="izborna">
<div class="overlay">
<a href="https://www.vivamed.hr/usluge/pregledi" class="ikona">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
<h3>Pregled vozača</h3>
<p>Sve vrste kategorija i pregleda</p>
<button class="bn111" id="bn111"> Opširnije<i class="fa-solid fa-arrow-right"></i></button>
</div>
<div class="box">
<div class="containerslike">
<img src="happy-graduate-woman-mantle-rejoicing-laughing-smiling_176420-14226.webp" class="izborna">
<div class="overlay">
<a href="https://www.vivamed.hr/usluge/pregledi" class="ikona">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
<h3>Učenici i studenti</h3>
<p>Upisi u srednje škole, fakultete i druge akadamske ustanove</p>
<button class="bn111" id="bn111"> Opširnije<i class="fa-solid fa-arrow-right"></i></button>
</div>
<div class="podnopregled">
<button class="bn112" id="bn112"> Svi pregledi<i class="fa-solid fa-arrow-right"></i></button>
</div>
</div>
</section>
<!--
-->
<div class="infodiv">
<div class="row noMargin">
<div class="one">
<p>Radno vrijeme<br>
ponedjeljak 07 - 15
utorak 07 - 18
srijeda 07 - 14
četvrtak 07 - 14
petak 07 - 14
i prema dogovoru </p>
</div>
<div class="two">
<p>Adresa<br>
Krešićeva ul. 32/1. Kat (okretište tramvaja Borongaj)</p>
</div>
</div>
<div class="row noMargin">
<div class="three">
<p>Email<br>
info#vivamed.hr</p>
</div>
<div class="four">
<p>Telefon<br>
+385 1 233 55 00</p>
</div>
</div>
</div>
</body>
</html>
I've been coding a website in html,css and used some javascript scripts to do it. It is a medical website and so far I've done a lot to the main page which is my main problem here. I am self-taught and all the paddings, margins and screen-fits that I've coded into it are were actually applying only to the screen size that is on my laptop, and not others. I've tested this by uploading the files to InfintyFree and making it online just for the sake of testing it on other screens, and what happens is that all the content is scattered around the screen. I've put some pictures to show how it looks in comparison with my laptop, other laptop that I have and my phone. Also I've put the html and css code if you can check it out and see where I screwed up and just point me to the core because I really cannot comprehend what is going on.
Thank in advance, and sorry if there was a question like this before, because I haven't found one.[][]
I have tried putting the *{} and changing properties with it, in the body{}, height, width, overflow, padding, margins, Media only screen, everything. Still, everything fixed but only on my laptop on which it was built.
This is my first time writing in html and css, so sorry if it's confusing and dumb.
I'm trying to make that sticks to the bottom and covers the length of the page, the problem is that i tried everything i could, from padding to width:100% other thant searching online, what can i do?
I'm using angular and i have installed bootstrap, please don't hesitate to ask any question or to ask me to explain myself (i'm not a native speaker), have a nice day and thank you!
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#300;400;500;600;700&display=swap');
body {
width: 100%;
height: 100%;
line-height: 1;
font-family: 'Poppins', sans-serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 2270px;
margin: 0 auto;
}
.row {
display: flex;
flex-wrap: wrap;
}
ul {
list-style: none;
}
.footer {
background-color: #24262b;
padding: 20px 0;
}
.footer-col {
width: 25%;
padding: 0;
}
.footer-col h4 {
font-size: 18px;
color: #ffffff;
text-transform: capitalize;
margin-bottom: 35px;
font-weight: 500;
position: relative;
}
.footer-col h4::before {
content: '';
position: absolute;
left: 0;
bottom: -10px;
background-color: #e91e63;
height: 2px;
box-sizing: border-box;
width: 50px;
}
.footer-col ul li:not(:last-child) {
margin-bottom: 10px;
}
.footer-col ul li a {
font-size: 16px;
text-transform: capitalize;
color: #ffffff;
text-decoration: none;
font-weight: 300;
color: #bbbbbb;
display: block;
transition: all 0.3s ease;
}
.footer-col ul li a:hover {
color: #ffffff;
padding-left: 8px;
}
.footer-col .social-links a {
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(255, 255, 255, 0.2);
margin: 0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #ffffff;
transition: all 0.5s ease;
}
.footer-col .social-links a:hover {
color: #24262b;
background-color: #ffffff;
}
.siteFooterBar {
position: fixed;
bottom: 0;
padding-top: 10px;
width: 100%;
box-shadow: 0px 0px 25px rgb(207, 207, 207);
height: 78px;
color: #9B9B9B;
background: #F3F3F3;
}
.content {
display: block;
padding: 10px;
margin: 0px auto;
text-align: center;
font: 25px Georgia, "Times New Roman", Times, serif;
font-size: 14px;
width: 300px;
display: flex;
}
.foot {
display: inline;
line-height: 70px;
}
.content img {
height: 150px;
width: 150px;
float: left;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-webkit-transition: all .6s ease-in-out;
transition: 0.6s;
}
.content img:hover {
filter: invert(400%);
filter: brightness(4);
-webkit-filter: grayscale(-100);
-webkit-transform: scale(1.10);
}
/*responsive*/
#media(max-width: 100%) {
.footer-col {
width: 100%;
margin-bottom: 0px;
}
}
#media(max-width: 100%) {
.footer-col {
width: 100%;
}
}
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col">
<div class="content">
<a href="#">
<img src="https://i.imgur.com/1yvwx9I.png">
</a>
</div>
</div>
<div class="footer-col">
<h4>Azienda</h4>
<ul>
<li>Chi Siamo</li>
<li>Contattaci</li>
<li>Placeholder</li>
<li>PlaceHolder</li>
</ul>
</div>
<div class="footer-col">
<h4>Aiuto</h4>
<ul>
<li>FAQ</li>
<li>Consegne</li>
<li>Reso</li>
<li>Informatica privacy</li>
</ul>
</div>
<div class="footer-col">
<h4>Seguici su</h4>
<div class="social-links">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-linkedin-in"></i>
</div>
</div>
</div>
</div>
</footer>
The standard way to align a footer at the bottom of a webpage is just by setting it to position: relative;. However, this entails that there is more content that is equal to or greater than the viewport height. Hence, aligning the footer after the content and at the bottom.
If you don't have content, use position: absolute; on footer. Then you can set bottom: 0px; to get it at the bottom. Then set left and right to 0 to get it the full width. See below.
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#300;400;500;600;700&display=swap');
body {
width: 100%;
height: 100%;
line-height: 1;
font-family: 'Poppins', sans-serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 2270px;
margin: 0 auto;
}
.row {
display: flex;
flex-wrap: wrap;
}
ul {
list-style: none;
}
/* new */
footer {
position: absolute;
bottom: 0px;
right: 0px;
left: 0px;
}
/* end new */
.footer {
background-color: #24262b;
padding: 20px 0;
}
.footer-col {
width: 25%;
padding: 0;
}
.footer-col h4 {
font-size: 18px;
color: #ffffff;
text-transform: capitalize;
margin-bottom: 35px;
font-weight: 500;
position: relative;
}
.footer-col h4::before {
content: '';
position: absolute;
left: 0;
bottom: -10px;
background-color: #e91e63;
height: 2px;
box-sizing: border-box;
width: 50px;
}
.footer-col ul li:not(:last-child) {
margin-bottom: 10px;
}
.footer-col ul li a {
font-size: 16px;
text-transform: capitalize;
color: #ffffff;
text-decoration: none;
font-weight: 300;
color: #bbbbbb;
display: block;
transition: all 0.3s ease;
}
.footer-col ul li a:hover {
color: #ffffff;
padding-left: 8px;
}
.footer-col .social-links a {
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(255, 255, 255, 0.2);
margin: 0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #ffffff;
transition: all 0.5s ease;
}
.footer-col .social-links a:hover {
color: #24262b;
background-color: #ffffff;
}
.siteFooterBar {
position: fixed;
bottom: 0;
padding-top: 10px;
width: 100%;
box-shadow: 0px 0px 25px rgb(207, 207, 207);
height: 78px;
color: #9B9B9B;
background: #F3F3F3;
}
.content {
display: block;
padding: 10px;
margin: 0px auto;
text-align: center;
font: 25px Georgia, "Times New Roman", Times, serif;
font-size: 14px;
width: 300px;
display: flex;
}
.foot {
display: inline;
line-height: 70px;
}
.content img {
height: 150px;
width: 150px;
float: left;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-webkit-transition: all .6s ease-in-out;
transition: 0.6s;
}
.content img:hover {
filter: invert(400%);
filter: brightness(4);
-webkit-filter: grayscale(-100);
-webkit-transform: scale(1.10);
}
/*responsive*/
#media(max-width: 100%) {
.footer-col {
width: 100%;
margin-bottom: 0px;
}
}
#media(max-width: 100%) {
.footer-col {
width: 100%;
}
}
<main>
fooo
</main>
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col">
<div class="content">
<a href="#">
<img src="https://i.imgur.com/1yvwx9I.png">
</a>
</div>
</div>
<div class="footer-col">
<h4>Azienda</h4>
<ul>
<li>Chi Siamo</li>
<li>Contattaci</li>
<li>Placeholder</li>
<li>PlaceHolder</li>
</ul>
</div>
<div class="footer-col">
<h4>Aiuto</h4>
<ul>
<li>FAQ</li>
<li>Consegne</li>
<li>Reso</li>
<li>Informatica privacy</li>
</ul>
</div>
<div class="footer-col">
<h4>Seguici su</h4>
<div class="social-links">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-linkedin-in"></i>
</div>
</div>
</div>
</div>
</footer>
When I am trying view my web pages on Ipad or Ipad Pro(using google chrome developer tools) the footer is not staying at the bottom at the page. I have no issue whatsoever when viewing on mobile devices/smartphones and desktop.
I have only included the CSS code that concerns the footer.
Can anyone give me a hand with this please?
footer {
background: #212529;
color: white;
bottom: 0;
}
footer a {
color: #fff;
font-size: 14px;
transition-duration: 0.2s;
}
footer a:hover {
color: #ced3d7;
text-decoration: none;
}
.copy {
font-size: 12px;
padding: 10px;
border-top: 1px solid #FFFFFF;
}
.footer-middle {
padding-top: 2em;
color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="assets/css/style.css" type="text/css" />
<title>Home|The Monkees</title>
</head>
<body>
<header>
<!--------------------Navigation-->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark stroke">
<a class="navbar-brand" href="index.html">
<img src="assets/image/LOGO.png" id="logo-transparent" alt="logo" style="width:143px;">
</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link " id="navbar-select-color" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color2" href="photos.html">Photos</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color3" href="video.html">Video</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color4" href="contact.html">Contact</a>
</li>
</ul>
</div>
</nav>
</header>
<!-- Contact Us Section -->
<section class="Material-contact-section section-padding section-dark">
<div class="container">
<div class="row ">
<!-- Section Title -->
<div class="col-md-12 wow animated fadeInLeft" data-wow-delay=".2s">
<h1 class="section-title">Love to Hear From You</h1>
</div>
</div>
<!-- contact form -->
<div class="col-md-12 wow animated fadeInRight " data-wow-delay=".2s" id="centerForm">
<form class="shake" role="form" method="post" id="contactForm" name="contact-form" data-toggle="validator">
<!-- Name -->
<div class="form-group label-floating">
<label class="control-label" for="name">Name</label>
<input class="form-control" id="name" type="text" name="name" required data-error="Please enter your name">
<div class="help-block with-errors"></div>
</div>
<!-- email -->
<div class="form-group label-floating">
<label class="control-label" for="email">Email</label>
<input class="form-control" id="email" type="email" name="email" required data-error="Please enter your Email">
<div class="help-block with-errors"></div>
</div>
<!-- Subject -->
<div class="form-group label-floating">
<label class="control-label">Subject</label>
<input class="form-control" id="msg_subject" type="text" name="subject" required data-error="Please enter your message subject">
<div class="help-block with-errors"></div>
</div>
<!-- Message -->
<div class="form-group label-floating">
<label for="message" class="control-label">Message</label>
<textarea class="form-control" rows="3" id="message" name="message" required data-error="Write your message"></textarea>
<div class="help-block with-errors"></div>
</div>
<!-- Form Submit -->
<div class="form-submit mt-5">
<button class="btn btn-common" type="submit" id="form-submit"><i class="material-icons mdi mdi-message-outline"></i> Send Message</button>
<div id="msgSubmit" class="h3 text-center hidden"></div>
<div class="clearfix"></div>
</div>
</form>
</div>
</div>
</div>
</section>
<footer class="mainfooter bg-dark" role="contentinfo">
<div class="footer-middle">
<ul class="social-network social-circle">
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-youtube"></i></li>
</ul>
<div class="col-md-12 copy">
<p class="text-center">© Copyright 2019 - The Monkees. All rights reserved. // About // Terms of Use // Contact </p>
</div>
</div>
</footer>
</body>
</html>
Bei adding
position: absolute;
width: 100%;
to your footer it will be on the bottom and 100% width - so your css should look like:
footer {
position: absolute;
width: 100%;
background: #212529;
color: white;
bottom: 0;
}
footer a {
color: #fff;
font-size: 14px;
transition-duration: 0.2s;
}
footer a:hover {
color: #ced3d7;
text-decoration: none;
}
.copy {
font-size: 12px;
padding: 10px;
border-top: 1px solid #FFFFFF;
}
.footer-middle {
padding-top: 2em;
color: white;
}
you had an extra div closing tag just before the closing section tag. Try deleting that and see if that solves the problem. If not, we can try position:absolute
footer {
background: #212529;
color: white;
bottom: 0;
}
body{
height:100%;
border:solid 1px red;
}
footer a {
color: #fff;
font-size: 14px;
transition-duration: 0.2s;
}
footer a:hover {
color: #ced3d7;
text-decoration: none;
}
.copy {
font-size: 12px;
padding: 10px;
border-top: 1px solid #FFFFFF;
}
.footer-middle {
padding-top: 2em;
color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="assets/css/style.css" type="text/css" />
<title>Home|The Monkees</title>
</head>
<body>
<header>
<!--------------------Navigation-->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark stroke">
<a class="navbar-brand" href="index.html">
<img src="assets/image/LOGO.png" id="logo-transparent" alt="logo" style="width:143px;">
</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link " id="navbar-select-color" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color2" href="photos.html">Photos</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color3" href="video.html">Video</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color4" href="contact.html">Contact</a>
</li>
</ul>
</div>
</nav>
</header>
<!-- Contact Us Section -->
<section class="Material-contact-section section-padding section-dark">
<div class="container">
<div class="row ">
<!-- Section Title -->
<div class="col-md-12 wow animated fadeInLeft" data-wow-delay=".2s">
<h1 class="section-title">Love to Hear From You</h1>
</div>
</div>
<!-- contact form -->
<div class="col-md-12 wow animated fadeInRight " data-wow-delay=".2s" id="centerForm">
<form class="shake" role="form" method="post" id="contactForm" name="contact-form" data-toggle="validator">
<!-- Name -->
<div class="form-group label-floating">
<label class="control-label" for="name">Name</label>
<input class="form-control" id="name" type="text" name="name" required data-error="Please enter your name">
<div class="help-block with-errors"></div>
</div>
<!-- email -->
<div class="form-group label-floating">
<label class="control-label" for="email">Email</label>
<input class="form-control" id="email" type="email" name="email" required data-error="Please enter your Email">
<div class="help-block with-errors"></div>
</div>
<!-- Subject -->
<div class="form-group label-floating">
<label class="control-label">Subject</label>
<input class="form-control" id="msg_subject" type="text" name="subject" required data-error="Please enter your message subject">
<div class="help-block with-errors"></div>
</div>
<!-- Message -->
<div class="form-group label-floating">
<label for="message" class="control-label">Message</label>
<textarea class="form-control" rows="3" id="message" name="message" required data-error="Write your message"></textarea>
<div class="help-block with-errors"></div>
</div>
<!-- Form Submit -->
<div class="form-submit mt-5">
<button class="btn btn-common" type="submit" id="form-submit"><i class="material-icons mdi mdi-message-outline"></i> Send Message</button>
<div id="msgSubmit" class="h3 text-center hidden"></div>
<div class="clearfix"></div>
</div>
</form>
</div>
</div>
</section>
<footer class="mainfooter bg-dark" role="contentinfo">
<div class="footer-middle">
<ul class="social-network social-circle">
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-youtube"></i></li>
</ul>
<div class="col-md-12 copy">
<p class="text-center">© Copyright 2019 - The Monkees. All rights reserved. // About // Terms of Use // Contact </p>
</div>
</div>
</footer>
</body>
</html>
#DCR This would be the complete CSS code.
#import url('https://fonts.googleapis.com/css?family=Gloria+Hallelujah:100,200,300,400,500,600,700|Special+Elite:100,200,300,400,500,600,700');
/*---------------------------------Navigation Bar*/
/*----Navbar Buttons*/
.navbar-nav li a {
color: #ffffff !important;
font-family: "Gloria Hallelujah" , sans-serif;
text-transform: uppercase;
font-size: large;
font-weight: 500;
text-decoration: none;
border:none;
padding: 8px 8px;
margin:4px 2px;
}
nav li a,
nav li a:after,
nav li a:before {
transition: all .5s;
}
#navbar-select-color:hover {
color: #c8c8c8 !important;
}
#navbar-select-color2:hover {
color: #c8c8c8 !important;
}
#navbar-select-color3:hover {
color: #c8c8c8 !important;
}
#navbar-select-color4:hover {
color: #c8c8c8 !important;
}
#logo-transparent {
opacity: 1.0;
filter: alpha(opacity=50);
transition-timing-function: ease-in-out;
transition: all .5s;
}
#logo-transparent:hover {
opacity: 0.8;
filter: alpha(opacity=100);
transition-timing-function: ease-in-out;
transition: all .5s;
}
/*----Navbar Animation*/
nav.stroke ul li a {
position: relative;
}
nav.stroke ul li a:after {
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 0%;
content: '.';
color: transparent;
background: #aaa;
height: 1px;
}
nav.stroke ul li a:hover:after {
width:100%;
}
/*---------------------------------Footer*/
footer {
background: #212529;
color: white;
bottom: 0;
position: absolute;
}
footer a {
color: #fff;
font-size: 14px;
transition-duration: 0.2s;
}
footer a:hover {
color: #ced3d7;
text-decoration: none;
}
.copy {
font-size: 12px;
padding: 10px;
border-top: 1px solid #FFFFFF;
}
.footer-middle {
padding-top: 2em;
color: white;
}
/*---------------------------------Social Icons*/
/* footer social icons */
ul {
list-style-type: none;
display: flex;
justify-content: center;
}
ul .social-network {
display: inline;
margin-left: 0 !important;
padding: 0;
float: inherit;
}
ul .social-network li {
display: inline;
margin: 0 5px;
list-style: none;
}
.social-network a.icoTwitter:hover i {
color: #007bb7;
}
.social-network a.icoFacebook:hover i {
color: #3B5998;
}
.social-network a.icoYoutube:hover i {
color: #c4302b;
}
.social-circle li a {
display: block;
position: relative;
margin: 15px 15px 15px;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
text-align: center;
width: 65px;
height: 65px;
font-size:40px;
}
.social-circle li i {
margin: 0;
line-height: 30px;
text-align: center;
}
.social-circle li a:hover i,
.triggeredHover {
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-ms--transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-o-transition: all 0.2s;
-ms-transition: all 0.2s;
transition: all 0.2s;
}
.social-circle i {
color: #595959;
-webkit-transition: all 0.8s;
-moz-transition: all 0.8s;
-o-transition: all 0.8s;
-ms-transition: all 0.8s;
transition: all 0.8s;
}
.social-network a {
background-color: #F9F9F9;
}
/*---------------------------------Background*/
#div-with-bg {
background-image: url("https://i.imgur.com/qv5ZwaO.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
position: relative;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
}
#footer {
position: relative;
bottom: 0;
width: 100%;
margin: 0 auto;
}
.image-box {
position: relative;
}
.image-box__background,
.image-box__overlay {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.image-box__background {
background: var(--image-url) center no-repeat;
background-size: cover;
z-index: 1
}
.image-box__overlay {
background: rgba(0, 0, 0, 0.5);
z-index: 2;
}
.image-box__content {
position: relative;
z-index: 3;
/* Finally, style and place the content */
color: white;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
html{
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
body, html {
height: 100%;
}
img {
width:100%;
height: auto;
position: relative;
}
#bg {
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
width: 100%;
min-height: 100vh;
position: relative;
}
/*---------------------------------Text*/
.band_biography {
margin-left: auto;
margin-right: 30%;
margin-top: 10%;
width: 20em;
color: white;
background: rgba(0, 0, 0, 0.6);
}
.bio_image {
border-radius: 50%;
max-width:15%;
margin-top: 12%;
margin-left: 32%;
background-size: contain;
float: left;
background: rgba(0, 0, 0, 0.6);
}
/*---------------------------------Contact Form*/
.section-padding {
padding: 45px 0;
}
.form-submit {
background: #B9DFFF;
color: #fff;
border: 1px solid #eee;
border-radius: 20px;
box-shadow: 5px 5px 5px #eee;
text-shadow:none;
width: 35%;
position: relative;
margin-left: 35%;
text-align: center;
}
.form-submit:hover {
background: #016ABC;
color: #fff;
border: 1px solid #eee;
border-radius: 20px;
width: 35%;
box-shadow: 5px 5px 5px #eee;
text-shadow:none;
}
.section-dark {
background-color: #f9f9f9;
z-index: -2;
}
.form-control,
.form-group .form-control {
border: 0;
background-image: -webkit-gradient(linear, left top, left bottom, from(#009688), to(#009688)), -webkit-gradient(linear, left top, left bottom, from(#D2D2D2), to(#D2D2D2));
background-image: -webkit-linear-gradient(#009688, #009688), -webkit-linear-gradient(#D2D2D2, #D2D2D2);
background-image: -o-linear-gradient(#009688, #009688), -o-linear-gradient(#D2D2D2, #D2D2D2);
background-image: linear-gradient(#009688, #009688), linear-gradient(#D2D2D2, #D2D2D2);
-webkit-background-size: 0 2px, 100% 1px;
background-size: 0 2px, 100% 1px;
background-repeat: no-repeat;
background-position: center bottom, center -webkit-calc(100% - 1px);
background-position: center bottom, center calc(100% - 1px);
background-color: rgba(0, 0, 0, 0);
-webkit-transition: background 0s ease-out;
-o-transition: background 0s ease-out;
transition: background 0s ease-out;
float: none;
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 0
}
.form-control::-moz-placeholder,
.form-group .form-control::-moz-placeholder {
color: #BDBDBD;
font-weight: 400
}
.form-control:-ms-input-placeholder,
.form-group .form-control:-ms-input-placeholder {
color: #BDBDBD;
font-weight: 400
}
.form-control::-webkit-input-placeholder,
.form-group .form-control::-webkit-input-placeholder {
color: #BDBDBD;
font-weight: 400
}
.form-control[disabled],
.form-control[readonly],
.form-group .form-control[disabled],
.form-group .form-control[readonly],
fieldset[disabled] .form-control,
fieldset[disabled] .form-group .form-control {
background-color: rgba(0, 0, 0, 0)
}
.form-control[disabled],
.form-group .form-control[disabled],
fieldset[disabled] .form-control,
fieldset[disabled] .form-group .form-control {
background-image: none;
border-bottom: 1px dotted #D2D2D2
}
.form-group {
position: relative
}
.form-group.label-floating label.control-label,
.form-group.label-placeholder label.control-label,
.form-group.label-static label.control-label {
position: absolute;
pointer-events: none;
-webkit-transition: .3s ease all;
-o-transition: .3s ease all;
transition: .3s ease all
}
.form-group.label-floating label.control-label {
will-change: left, top, contents
}
.form-group.label-placeholder:not(.is-empty) label.control-label {
display: none
}
.form-group .help-block {
position: absolute;
display: none
}
.form-group.is-focused .form-control {
outline: 0;
background-image: -webkit-gradient(linear, left top, left bottom, from(#009688), to(#009688)), -webkit-gradient(linear, left top, left bottom, from(#D2D2D2), to(#D2D2D2));
background-image: -webkit-linear-gradient(#009688, #009688), -webkit-linear-gradient(#D2D2D2, #D2D2D2);
background-image: -o-linear-gradient(#009688, #009688), -o-linear-gradient(#D2D2D2, #D2D2D2);
background-image: linear-gradient(#009688, #009688), linear-gradient(#D2D2D2, #D2D2D2);
-webkit-background-size: 100% 2px, 100% 1px;
background-size: 100% 2px, 100% 1px;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition-duration: .3s;
-o-transition-duration: .3s;
transition-duration: .3s
}
.form-group.is-focused .form-control .material-input:after {
background-color: #009688
}
.form-group.is-focused label,
.form-group.is-focused label.control-label {
color: #009688
}
.form-group.is-focused.label-placeholder label,
.form-group.is-focused.label-placeholder label.control-label {
color: #BDBDBD
}
.form-group.is-focused .help-block {
display: block
}
.form-group.has-warning .form-control {
-webkit-box-shadow: none;
box-shadow: none
}
.form-group.has-warning.is-focused .form-control {
background-image: -webkit-gradient(linear, left top, left bottom, from(#ff5722), to(#ff5722)), -webkit-gradient(linear, left top, left bottom, from(#D2D2D2), to(#D2D2D2));
background-image: -webkit-linear-gradient(#ff5722, #ff5722), -webkit-linear-gradient(#D2D2D2, #D2D2D2);
background-image: -o-linear-gradient(#ff5722, #ff5722), -o-linear-gradient(#D2D2D2, #D2D2D2);
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#D2D2D2, #D2D2D2)
}
.form-group.has-warning .help-block,
.form-group.has-warning label.control-label {
color: #ff5722
}
.form-group.has-error .form-control {
-webkit-box-shadow: none;
box-shadow: none
}
.form-group.has-error .help-block,
.form-group.has-error label.control-label {
color: #f44336
}
.form-group.has-success .form-control {
-webkit-box-shadow: none;
box-shadow: none
}
.form-group.has-success.is-focused .form-control {
background-image: -webkit-gradient(linear, left top, left bottom, from(#4caf50), to(#4caf50)), -webkit-gradient(linear, left top, left bottom, from(#D2D2D2), to(#D2D2D2));
background-image: -webkit-linear-gradient(#4caf50, #4caf50), -webkit-linear-gradient(#D2D2D2, #D2D2D2);
background-image: -o-linear-gradient(#4caf50, #4caf50), -o-linear-gradient(#D2D2D2, #D2D2D2);
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#D2D2D2, #D2D2D2)
}
.form-group.has-success .help-block,
.form-group.has-success label.control-label {
color: #4caf50
}
.form-group.has-info .form-control {
-webkit-box-shadow: none;
box-shadow: none
}
.form-group.has-info.is-focused .form-control {
background-image: -webkit-gradient(linear, left top, left bottom, from(#03a9f4), to(#03a9f4)), -webkit-gradient(linear, left top, left bottom, from(#D2D2D2), to(#D2D2D2));
background-image: -webkit-linear-gradient(#03a9f4, #03a9f4), -webkit-linear-gradient(#D2D2D2, #D2D2D2);
background-image: -o-linear-gradient(#03a9f4, #03a9f4), -o-linear-gradient(#D2D2D2, #D2D2D2);
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#D2D2D2, #D2D2D2)
}
.form-group.has-info .help-block,
.form-group.has-info label.control-label {
color: #03a9f4
}
.form-group textarea {
resize: none
}
.form-group textarea~.form-control-highlight {
margin-top: -11px
}
.form-group select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none
}
.form-group select~.material-input:after {
display: none
}
.form-control {
margin-bottom: 7px
}
.form-control::-moz-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.form-control:-ms-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.form-control::-webkit-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.checkbox label,
.radio label,
label {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
label.control-label {
font-size: 12px;
line-height: 1.07142857;
font-weight: 400;
margin: 16px 0 0 0
}
.help-block {
margin-top: 0;
font-size: 12px
}
.form-group {
padding-bottom: 7px;
margin: 28px 0 0 0
}
.form-group .form-control {
margin-bottom: 7px
}
.form-group .form-control::-moz-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.form-group .form-control:-ms-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.form-group .form-control::-webkit-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.form-group .checkbox label,
.form-group .radio label,
.form-group label {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400
}
.form-group label.control-label {
font-size: 12px;
line-height: 1.07142857;
font-weight: 400;
margin: 16px 0 0 0
}
.form-group .help-block {
margin-top: 0;
font-size: 12px
}
.form-group.label-floating label.control-label,
.form-group.label-placeholder label.control-label {
top: -7px;
font-size: 16px;
line-height: 1.42857143
}
.form-group.label-floating.is-focused label.control-label,
.form-group.label-floating:not(.is-empty) label.control-label,
.form-group.label-static label.control-label {
top: -30px;
left: 0;
font-size: 12px;
line-height: 1.07142857
}
.form-group.label-floating input.form-control:-webkit-autofill~label.control-label label.control-label {
top: -30px;
left: 0;
font-size: 12px;
line-height: 1.07142857
}
.form-group.form-group-sm {
padding-bottom: 3px;
margin: 21px 0 0 0
}
.form-group.form-group-sm .form-control {
margin-bottom: 3px
}
.form-group.form-group-sm .form-control::-moz-placeholder {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-sm .form-control:-ms-input-placeholder {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-sm .form-control::-webkit-input-placeholder {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-sm .checkbox label,
.form-group.form-group-sm .radio label,
.form-group.form-group-sm label {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-sm label.control-label {
font-size: 9px;
line-height: 1.125;
font-weight: 400;
margin: 16px 0 0 0
}
.form-group.form-group-sm .help-block {
margin-top: 0;
font-size: 9px
}
.form-group.form-group-sm.label-floating label.control-label,
.form-group.form-group-sm.label-placeholder label.control-label {
top: -11px;
font-size: 11px;
line-height: 1.5
}
.form-group.form-group-sm.label-floating.is-focused label.control-label,
.form-group.form-group-sm.label-floating:not(.is-empty) label.control-label,
.form-group.form-group-sm.label-static label.control-label {
top: -25px;
left: 0;
font-size: 9px;
line-height: 1.125
}
.form-group.form-group-sm.label-floating input.form-control:-webkit-autofill~label.control-label label.control-label {
top: -25px;
left: 0;
font-size: 9px;
line-height: 1.125
}
.form-group.form-group-lg {
padding-bottom: 9px;
margin: 30px 0 0 0
}
.form-group.form-group-lg .form-control {
margin-bottom: 9px
}
.form-group.form-group-lg .form-control::-moz-placeholder {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-lg .form-control:-ms-input-placeholder {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-lg .form-control::-webkit-input-placeholder {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-lg .checkbox label,
.form-group.form-group-lg .radio label,
.form-group.form-group-lg label {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400
}
.form-group.form-group-lg label.control-label {
font-size: 14px;
line-height: .99999998;
font-weight: 400;
margin: 16px 0 0 0
}
.form-group.form-group-lg .help-block {
margin-top: 0;
font-size: 14px
}
.form-group.form-group-lg.label-floating label.control-label,
.form-group.form-group-lg.label-placeholder label.control-label {
top: -5px;
font-size: 18px;
line-height: 1.3333333
}
.form-group.form-group-lg.label-floating.is-focused label.control-label,
.form-group.form-group-lg.label-floating:not(.is-empty) label.control-label,
.form-group.form-group-lg.label-static label.control-label {
top: -32px;
left: 0;
font-size: 14px;
line-height: .99999998
}
.form-group.form-group-lg.label-floating input.form-control:-webkit-autofill~label.control-label label.control-label {
top: -32px;
left: 0;
font-size: 14px;
line-height: .99999998
}
select.form-control {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 0
}
.form-group.is-focused select.form-control {
-webkit-box-shadow: none;
box-shadow: none;
border-color: #D2D2D2
}
.form-group.is-focused select.form-control[multiple],
select.form-control[multiple] {
height: 85px
}
.input-group-btn .btn {
margin: 0 0 7px 0
}
.form-group.form-group-sm .input-group-btn .btn {
margin: 0 0 3px 0
}
.form-group.form-group-lg .input-group-btn .btn {
margin: 0 0 9px 0
}
.input-group .input-group-btn {
padding: 0 12px
}
.input-group .input-group-addon {
border: 0;
background: 0 0
}
.form-group input[type=file] {
opacity: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100
}
#contactForm {
margin-top: 100px
}
#contactForm .form-group label.control-label {
color: #8c8c8c
}
#contactForm .form-control {
font-weight: 500;
height: auto
}
.row {
display: block;
text-align: center;
padding-top: 10%;
}
#centerForm {
text-align: center;
}
.container{
padding-bottom: 0%;
}
/*---------------------------------Biography*/
.box{
width: 100%;
background: rgba(0, 0, 0, 0.4);
padding: 40px;
text-align: center;
color: white;
font-family: 'Century Gothic' ,sans-serif;
padding-bottom: 10%;
padding-top: 5%;
}
.box-img{
border-radius: 50%;
width: 200px;
height: 200px;
}
.box h1{
font-size: 40px;
letter-spacing: 4px;
font-weight: 100;
}
.box h5{
font-size: 25px;
letter-spacing: 3px;
font-weight: 100;
}
.box p{
text-align: justify;
}
/*---------------------------------Photo Grid*/
.row {
display: flex;
flex-wrap: wrap;
padding: 0 4px;
}
/* Create two equal columns that sits next to each other */
.column {
flex: 50%;
padding: 0 4px;
}
.column img {
margin-top: 8px;
vertical-align: middle;
}
/*---------------------------------Media Queries*/
/* ----------- iPad Pro 10.5" ----------- */
#media only screen
and (min-width: 834px)
and (max-width: 1112px)
and (-webkit-min-pixel-ratio: 2) {
.container {
padding-bottom: 22%;
}
.row {
padding-top: 20% !important;
}
}
/* ----------- iPad Pro 12.9" ----------- */
#media only screen
and (min-width: 1024px)
and (max-width: 1366px)
and (-webkit-min-pixel-ratio: 2) {
.container {
padding-bottom: 22%;
}
.row {
padding-top: 20% !important;
}
}
/* ----------- Blackberry Playbook ----------- */
#media (max-width: 600px) and (orientation: portrait) {
.row {
padding-top: 15%;
}
}
#media only screen
and (min-width: 834px)
and (max-width: 1112px)
and (-webkit-min-pixel-ratio: 2) {
.container {
padding-bottom: 22%;
}
.row {
padding-top: 20% !important;
}
}
/* ----------- Photo Gallery ----------- */
img{
width:100%;
}
.gallery a {
position: relative;
display: block;
}
.overlay {
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
cursor: pointer;
display: block;
font-size: 100px;
height: 100%;
width: 100%;
padding-top:40px;
top: 0;
left: 0;
opacity: 0;
overflow: hidden;
position: absolute;
text-align: center;
transition: all 1s ease;
}
.overlay2{
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
cursor: pointer;
display: block;
font-size: 100px;
height: 100%;
width: 100%;
padding-top:100px;
top: 0;
left: 0;
opacity: 0;
overflow: hidden;
position: absolute;
text-align: center;
transition: all 1s ease;
}
.gallery a:hover .overlay ,
.gallery a:hover .overlay2 {
opacity: 0.8;
}
.img-space{
margin:20px 0px;
}
/*---------Video Gallery--------*/
After all I have managed to find a resolution by myself.
I will post what I did here, just in case someone runs into this issue.
Blockquote
The solution will depend a little on the rest of your CSS page. It can take some trial and error to find the one that works for you. I went for the calc() method.
You wrap all your content in a new div with a class name of "content" on it. Making sure to close this div right before the footer is opened.
Then you use devtools to find out the height of your footer, and use the calc() method to give the the .content class a minimum hieght that is equal to 100% of the view height minius the height of the footer.
.content {
min-height: calc(100vh - /* height of footer here */);
}
Q1
How can I remove the white line under the navigation bar on section 1/2? I have tried changing the html layout incase I a line gap was the issue which caused this to occur. However, I have had no luck trying to resolve this problem.
Q2
How can I remove the white above the footer on section2?
body {
margin: 0;
padding: 0;
}
.navbar.navbar-default {
background-color: #4D5061;
height: 10vh;
z-index: 100;
}
.navbar.navbar-default ul {
list-style-type: none;
text-align: right;
}
.navbar.navbar-default ul li {
display: inline-block;
}
.dropdown-menu li {
text-align: center
}
.dropdown .dropdown-menu {
background-color: #4D5061;
}
.dropdown .dropdown-menu a {
color: white;
}
.navbar.navbar-default ul li a {
display: inline-block;
padding: 3.5vh 8px 4px;
color: white;
text-decoration: none;
font-size: 14pt;
font-family: 'Roboto', sans-serif;
}
.navbar.navbar-default ul li:after {
content: '';
position: absolute;
right: 50%;
bottom: 0;
left: 50%;
height: 3px;
background-color: #FFFFFF;
border-radius: 9px;
transition: all .2s;
}
.navbar.navbar-default ul li a:hover {
color: white;
background-color: rgba(20, 50, 40, 0.5)
}
.nav.navbar-nav,
.nav.navbar-nav>li {
float: none;
}
.navbar.navbar-default ul li:hover:after {
right: 0;
left: 0;
}
.navbar.navbar-default ul.dropdown-menu li,
.navbar.navbar-default ul.dropdown-menu li a {
position: relative;
display: block;
}
#logo {
padding-top: 2vh;
padding-left: 20px;
float: left;
}
.hero {
background: url("https://static.pexels.com/photos/7064/man-notes-macbook-computer.jpg") center center no-repeat;
;
background-attachment: fixed;
position: relative;
background-size: cover;
width: 100%;
max-width: 100%;
width: 100vw;
height: 100%;
}
section {
position: relative;
padding: 10vh 0 0;
min-height: 100vh;
}
.section1 {
height: 100vh;
text-align: center;
color: white;
}
.section2 {
background-color: dimgrey;
text-align: center;
color: white;
min-height: 90vh;
}
.fa-angle-down {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.fa-angle-up {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.footer {
height: 3vh;
background-color: #4D5061;
padding: 0;
right: 0;
bottom: 0;
left: 0;
}
.nav-title {
font-size: 14pt;
margin: 0;
top: 35px;
left: 8px;
width: 100%;
position: absolute;
text-align: center;
color: white;
font-family: 'Roboto', sans-serif;
}
.s1-welcome {
font-family: 'Roboto', sans-serif;
color: white;
font-size: 45pt;
font-size: 2.5em;
text-align: center;
margin: 0;
}
.footertext {
font-size: 14pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.contact-text {
font-size: 35pt;
font-weight: bold;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
p {
font-size: 20pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.profile.box {
bottom: 0;
height: 50%;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 50%;
}
.shape {
border-radius: 25px;
display: inline-block;
background: #4D5061;
content: url(http://i1126.photobucket.com/albums/l611/ldocherty1/IMG_0730_zpsiz4dqc47.jpg);
color: white;
height: 250px;
margin: auto;
padding: 3px;
width: 250px;
}
.fa {
padding: 20px;
font-size: 20px;
text-align: center;
text-decoration: none;
margin: 7px 6px;
border-radius: 50%;
}
.fa:hover {
opacity: 0.7;
}
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa-linkedin {
background: #007bb5;
color: white;
}
.icon-style {
position: relative;
top: 10px;
}
.arrow1 {
color: white;
position: relative;
}
#import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
#feedback-page {
text-align: center;
}
#form-main {
width: 100%;
float: left;
padding-top: 0px;
}
#form-div {
background-color: rgba(72, 72, 72, 0.4);
padding-left: 35px;
padding-right: 35px;
padding-top: 35px;
padding-bottom: 50px;
width: 850px;
height: 500px;
float: left;
left: 50%;
position: absolute;
margin-top: 30px;
margin-left: -260px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.feedback-input {
color: #3c3c3c;
font-family: Helvetica, Arial, sans-serif;
font-weight: 500;
font-size: 18px;
border-radius: 0;
line-height: 22px;
background-color: #fbfbfb;
padding: 13px 13px 13px 54px;
margin-bottom: 10px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
border: 3px solid rgba(0, 0, 0, 0);
}
.feedback-input:focus {
background: #fff;
box-shadow: 0;
border: 3px solid #3498db;
color: #3498db;
outline: none;
padding: 13px 13px 13px 54px;
}
.focused {
color: #30aed6;
border: #30aed6 solid 3px;
}
#name {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#name:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 8px 5px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#comment {
background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
textarea {
width: 100%;
height: 150px;
line-height: 150%;
resize: vertical;
}
input:hover,
textarea:hover,
input:focus,
textarea:focus {
background-color: white;
}
#button-blue {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
float: left;
width: 100%;
border: #fbfbfb solid 4px;
cursor: pointer;
background-color: #3498db;
color: white;
font-size: 24px;
padding-top: 22px;
padding-bottom: 22px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top: -4px;
font-weight: 700;
}
#button-blue:hover {
background-color: rgba(0, 0, 0, 0);
color: #0493bd;
}
.submit:hover {
color: #3498db;
}
.ease {
width: 0px;
height: 74px;
background-color: #fbfbfb;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
.submit:hover .ease {
width: 100%;
background-color: white;
}
#media only screen and (max-width: 580px) {
#form-div {
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
}
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h1 class="nav-title">Liam Docherty's Digital Portfolio</h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Home
</li>
<li class="dropdown">
About Me <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Contact
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li class="dropdown">
Units <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Another action
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li>Clients
</li>
<li>Contact Me
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<section id="section1" class="section1">
<div class="hero">
<div class="profile box">
<div class="shape"></div>
</div>
</div>
<h2 class="s1-welcome">WELCOME TO MY PORTFOLIO</h2>
<div class="arrow1">
<i class="fa fa-angle-down" style="font-size:100px;"></i>
</div>
</section>
<section id="contact-me" class="contact_section section2">
<h2 class="contact-text">Get in touch</h2>
<p>Wanna get in touch or talk to me about a project?</p>
<p>Fill the form below or send an email to liam_docherty#outlook.com</p>
<div id="form-main">
<div id="form-div">
<form class="form" id="form1">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
</p>
<div class="submit">
<input type="submit" value="SEND" id="button-blue" />
<div class="ease"></div>
</div>
</form>
</div>
<div class="arrow2">
<i class="fa fa-angle-up" style="font-size:100px;"></i>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<footer>
<div class="footer">
<h2 class="footertext">Copyright © 2017 Liam Docherty's Site. All rights reserved.</h2>
</div>
</footer>
</body>
</html>
These are your problem:
<h2 class="contact-text">Get in touch</h2>
<p>Wanna get in touch or talk to me about a project?</p>
<p>Fill the form below or send an email to liam_docherty#outlook.com</p>
Remove those and then bam it works. You are also missing a closing div in that section.
Although not a complete answer, I would recommend looking at these three lines and the CSS related. Also, you are using bootstrap so you should look at any styles that bootstrap might be applying.
if you remove space in section remove h2 margin you have space use padding is batter. please check i thing it's batter .
<body>
<style>
body {
margin: 0;
padding: 0;
}
.navbar.navbar-default {
background-color: #4D5061;
height: auto;
z-index: 100;
}
.navbar.navbar-default ul {
list-style-type: none;
text-align: right;
}
.navbar.navbar-default ul li {
display: inline-block;
}
.dropdown-menu li {
text-align: center
}
.dropdown .dropdown-menu {
background-color: #4D5061;
}
.navbar.navbar-default ul li ul {
display: none;
left: 0;
position: absolute;
top: 60px;
min-width: 240px;
z-index: 200;
}
.dropdown .dropdown-menu a {
color: white;
}
.navbar.navbar-default ul li a {
display: inline-block;
padding: 3.5vh 8px 4px;
color: white;
text-decoration: none;
font-size: 14pt;
font-family: 'Roboto', sans-serif;
}
.navbar.navbar-default ul li:after {
content: '';
position: absolute;
right: 50%;
bottom: 0;
left: 50%;
height: 3px;
background-color: #FFFFFF;
border-radius: 9px;
transition: all .2s;
}
.navbar.navbar-default ul li a:hover {
color: white;
background-color: rgba(20, 50, 40, 0.5)
}
.nav.navbar-nav,
.nav.navbar-nav>li {
float: none;
}
.navbar.navbar-default ul li:hover:after {
right: 0;
left: 0;
}
.navbar.navbar-default ul.dropdown-menu li,
.navbar.navbar-default ul.dropdown-menu li a {
position: relative;
display: block;
}
#logo {
padding-top: 2vh;
padding-left: 20px;
float: left;
}
.hero {
background: url("https://static.pexels.com/photos/7064/man-notes-macbook-computer.jpg") center center no-repeat;
;
background-attachment: fixed;
position: relative;
background-size: cover;
width: 100%;
max-width: 100%;
width: 100vw;
height: 100%;
}
.nav.navbar-nav {
margin: 10px 0 0;
}
section {
position: relative;
padding: 0vh 0 0;
min-height: 100vh;
}
.section1 {
height: 100vh;
text-align: center;
color: white;
}
.navbar.navbar-default ul li { position:relative;}
.navbar.navbar-default ul li:hover ul { display:block;}
.section2 {
background-color: dimgrey;
text-align: center;
color: white;
min-height: 90vh;
}
.fa-angle-down {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.fa-angle-up {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.footer {
height: 3vh;
background-color: #4D5061;
padding: 0;
right: 0;
bottom: 0;
left: 0;
}
.nav-title {
font-size: 14pt;
margin: 0;
top: 35px;
left: 8px;
width: 100%;
position: absolute;
text-align: center;
color: white;
font-family: 'Roboto', sans-serif;
}
.s1-welcome {
font-family: 'Roboto', sans-serif;
color: white;
font-size: 45pt;
font-size: 2.5em;
text-align: center;
margin: 0;
}
.footertext {
color: white;
font-family: "Roboto",sans-serif;
font-size: 14pt;
margin: 0;
padding: 20px 0;
text-align: center;
}
.contact-text {
color: white;
font-family: "Roboto",sans-serif;
font-size: 35pt;
font-weight: bold;
margin: 0;
padding: 30px 0 20px;
text-align: center;
}
p {
font-size: 20pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.profile.box {
bottom: 0;
height: 50%;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 50%;
}
.shape {
border-radius: 25px;
display: inline-block;
background: #4D5061;
content: url(http://i1126.photobucket.com/albums/l611/ldocherty1/IMG_0730_zpsiz4dqc47.jpg);
color: white;
height: 250px;
margin: auto;
padding: 3px;
width: 250px;
}
.fa {
padding: 20px;
font-size: 20px;
text-align: center;
text-decoration: none;
margin: 7px 6px;
border-radius: 50%;
}
.fa:hover {
opacity: 0.7;
}
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa-linkedin {
background: #007bb5;
color: white;
}
.icon-style {
position: relative;
top: 10px;
}
.arrow1 {
color: white;
position: relative;
}
#import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
#feedback-page {
text-align: center;
}
#form-main {
width: 100%;
float: left;
padding-top: 0px;
}
#form-div {
background-color: rgba(72, 72, 72, 0.4);
padding-left: 35px;
padding-right: 35px;
padding-top: 35px;
padding-bottom: 50px;
width: 850px;
height: 500px;
float: left;
left: 50%;
position: absolute;
margin-top: 30px;
margin-left: -260px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.feedback-input {
color: #3c3c3c;
font-family: Helvetica, Arial, sans-serif;
font-weight: 500;
font-size: 18px;
border-radius: 0;
line-height: 22px;
background-color: #fbfbfb;
padding: 13px 13px 13px 54px;
margin-bottom: 10px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
border: 3px solid rgba(0, 0, 0, 0);
}
.feedback-input:focus {
background: #fff;
box-shadow: 0;
border: 3px solid #3498db;
color: #3498db;
outline: none;
padding: 13px 13px 13px 54px;
}
.focused {
color: #30aed6;
border: #30aed6 solid 3px;
}
#name {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#name:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 8px 5px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#comment {
background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
textarea {
width: 100%;
height: 150px;
line-height: 150%;
resize: vertical;
}
input:hover,
textarea:hover,
input:focus,
textarea:focus {
background-color: white;
}
#button-blue {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
float: left;
width: 100%;
border: #fbfbfb solid 4px;
cursor: pointer;
background-color: #3498db;
color: white;
font-size: 24px;
padding-top: 22px;
padding-bottom: 22px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top: -4px;
font-weight: 700;
}
#button-blue:hover {
background-color: rgba(0, 0, 0, 0);
color: #0493bd;
}
.submit:hover {
color: #3498db;
}
.ease {
width: 0px;
height: 74px;
background-color: #fbfbfb;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
.submit:hover .ease {
width: 100%;
background-color: white;
}
#media only screen and (max-width: 580px) {
#form-div {
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
}
</style>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h1 class="nav-title">Liam Docherty's Digital Portfolio</h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Home
</li>
<li class="dropdown">
About Me <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Contact
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li class="dropdown">
Units <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Another action
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li>Clients
</li>
<li>Contact Me
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<section id="section1" class="section1">
<div class="hero">
<div class="profile box">
<div class="shape"></div>
</div>
</div>
<h2 class="s1-welcome">WELCOME TO MY PORTFOLIO</h2>
<div class="arrow1">
<i class="fa fa-angle-down" style="font-size:100px;"></i>
</div>
</section>
<section id="contact-me" class="contact_section section2">
<h2 class="contact-text">Get in touch</h2>
<p>Wanna get in touch or talk to me about a project?</p>
<p>Fill the form below or send an email to liam_docherty#outlook.com</p>
<div id="form-main">
<div id="form-div">
<form class="form" id="form1">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
</p>
<div class="submit">
<input type="submit" value="SEND" id="button-blue" />
<div class="ease"></div>
</div>
</form>
</div>
<div class="arrow2">
<i class="fa fa-angle-up" style="font-size:100px;"></i>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<footer>
<div class="footer">
<h2 class="footertext">Copyright © 2017 Liam Docherty's Site. All rights reserved.</h2>
</div>
</footer>
</body>
For the section 1:
#section1{padding-top:0;}
For your second question
first: remove this from the #form-div:
float: left;
position: absolute;
margin-top:30px;
margin-left:-260px;
Add this to #form-div:
margin-left: auto;
margin-right:auto;
remove this from #form-main:
float:left;
move your <footer> in the section(id=contact-me) before the </section> and after the </div>
I am trying to show different tab content when clicking on a link using pure CSS by following this W3Schools tutorial. However, it is not working for me.
Again, it has to be pure CSS, no JavaScript!
Here's my code:
/* landscape-screen.css */
/*** General Settings ***/
* {
margin: 0;
padding: 0;
}
html,
body {
width: 100%;
height: 100%;
}
/*Main Wrapper Styling*/
#main-wrapper {
min-width: 960px;
height: 100%;
}
/* Banner styling*/
.header {
width: 100%;
height: 10%;
background-color: #7a6868;
}
/* "Welcome" photo in the banner position */
#welcome {
margin-left: 30%;
}
/* General wrapper settings */
.inner-wrapper-settings {
width: 100%;
height: 100%;
}
/* Left navigation menu styling */
.aside {
width: 180px;
height: 100%;
background-color: #cd4409;
/*display: inline-block; */
/* So that Nav Bar will be next to its section */
text-align: center;
float: left;
}
/* Right main Section styling */
.section {
/*display: inline-block; */
/* So that the section will be next to Nav Bar */
width: calc(100% - 180px);
height: 100%;
background-color: #eec712;
float: right
}
/*Footer styling*/
.footer {
background-color: black;
width: 100%;
height: 80px;
clear: both;
color: white;
}
/*** Tooltip***/
.tooltip {
display: inline;
position: relative;
}
.tooltip:hover:before {
border: solid;
border-color: #333 transparent;
border-width: 6px 6px 0 6px;
bottom: 20px;
content: "";
left: 50%;
position: absolute;
z-index: 99;
}
.tooltip:hover:after {
background: #333;
background: rgba(0, 0, 0, .8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(title);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}
/* sidebar-links.css */
ul {
padding: 0;
margin-top: 30px;
}
li {
margin-bottom: 30px;
padding: 0px;
}
a {
color: white;
text-decoration: none;
}
a:hover {
color: #f0d248;
}
a:visited {
color: white;
}
/*form-responsive.css:*/
#import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
html {
/*background:url(http://thekitemap.com/images/feedback-img.jpg) no-repeat;*/
background-size: cover;
height: 100%;
}
#feedback-page {
text-align: center;
}
#form-main {
width: 100%;
float: left;
padding-top: 0px;
}
#form-div {
background-color: rgba(72, 72, 72, 0.4);
padding-left: 35px;
padding-right: 35px;
padding-top: 35px;
padding-bottom: 50px;
width: 450px;
float: left;
left: 50%;
position: absolute;
margin-top: 30px;
margin-left: -260px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.feedback-input {
color: #3c3c3c;
font-family: Helvetica, Arial, sans-serif;
font-weight: 500;
font-size: 18px;
border-radius: 0;
line-height: 22px;
background-color: #fbfbfb;
padding: 13px 13px 13px 54px;
margin-bottom: 10px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
border: 3px solid rgba(0, 0, 0, 0);
}
.feedback-input:focus {
background: #fff;
box-shadow: 0;
border: 3px solid #3498db;
color: #3498db;
outline: none;
padding: 13px 13px 13px 54px;
}
.focused {
color: #30aed6;
border: #30aed6 solid 3px;
}
/* Icons ---------------------------------- */
#name {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#name:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 8px 5px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#comment {
background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
textarea {
width: 100%;
height: 150px;
line-height: 150%;
resize: vertical;
}
input:hover,
textarea:hover,
input:focus,
textarea:focus {
background-color: white;
}
#button-blue {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
float: left;
width: 100%;
border: #fbfbfb solid 4px;
cursor: pointer;
background-color: #3498db;
color: white;
font-size: 24px;
padding-top: 22px;
padding-bottom: 22px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top: -4px;
font-weight: 700;
}
#button-blue:hover {
background-color: rgba(0, 0, 0, 0);
color: #0493bd;
}
.submit:hover {
color: #3498db;
}
.ease {
width: 0px;
height: 74px;
background-color: #fbfbfb;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
.submit:hover .ease {
width: 100%;
background-color: white;
}
#media only screen and (max-width: 580px) {
#form-div {
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
}
.section div {
display: none;
}
.section:target div {
display: inline-block;
}
<!--Layout Main Wrapper-->
<div id="main-wrapper">
<div class="header">
<!-- The banner-->
<img id="logo" src="Resources/Images/logo.png" width="184" height="47" alt="logo" />
<img id="welcome" src="Resources/Images/Welcome.png" width="180" height="40" alt="Welcome" />
</div>
<!--
-->
<div id="content-wrapper" class="inner-wrapper-settings">
<div class="aside">
<!--The Navigation Menu (left side)-->
<ul>
<li><a title="Link for blog" class="tooltip" href="#blog">Blog</a></li>
<li><a title="Link for Contacts" class="tooltip" href="#contacts">Contacts</a></li>
</ul>
</div>
<!--
-->
<div class="section">
<!--The Section of the layout (right side)-->
<div id="blog">
<span>Blog</span>
</div>
<div id="contacts">
<div id="form-main">
<div id="form-div">
<form class="form" id="form1">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
</p>
<div class="submit">
<input type="submit" value="SEND" id="button-blue" />
<div class="ease"></div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!--
-->
<div class="footer">
<!--The foot of the layout (down side)-->
bla bla
</div>
</div>
jsFiddle
Currently, when I click on "Blog" or on "Contacts", it doesn't show anything.
Can you please show me how to fix it?
change the css like below
.section > div {display: none;}
.section > div:target { display: block;}
and remove # from id name
DEMO
try removing the character "#" from your div ids :
<div id="blog">
<div id="contacts">