$(document).ready(function() {
$('.btn_activite').click(function() {
$('#activite').addClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_gestion').click(function() {
$('#activite').removeClass('active');
$('#gestion').addClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_creation').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').addClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_contenu').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').addClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_quotidien').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').addClass('active');
$('#temps').removeClass('active');
});
$('.btn_temps').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').addClass('active');
});
});
#charset "UTF-8";
#import url("../webfonts/GothamBook/stylesheet.css");
body {
font-family: GothamBook;
color: #FEFEFE;
}
.flex-container {
DISPLAY: FLEX;
justify-content: space-between;
width: 100%;
color: #FFFFFF;
}
.item {
background-color: black;
width: 5%;
margin: 2px;
}
.item-activite {
background-color: black;
width: 15%;
margin: 2px;
text-align: center;
}
.item-gestion {
background-color: #4D4D4D;
width: 15%;
margin: 2px;
text-align: center;
}
.item-creation {
background-color: #40A9F5;
width: 15%;
margin: 2px;
text-align: center;
}
.item-cont {
background-color: #362984;
width: 15%;
margin: 2px;
text-align: center;
}
.item-quot {
background-color: #662D91;
width: 15%;
margin: 2px;
text-align: center;
}
.item-temps {
background-color: #42A246;
width: 15%;
margin: 2px;
text-align: center;
}
.font-black {
color: #000000;
}
.font-grn {
color: #42A246;
}
.container {
display: flex;
justify-content: center;
align-content: center;
}
#activite, #gestion, #creation, #contenu, #quotidien, #temps {
display: none;
}
#activite.active ,#gestion.active , #creation.active ,#contenu.active ,#quotidien.active , #temps.active{
display: block;
}
a {
text-decoration: none;
color: #FFFFFF;
}
.btn_activite, .btn_gestion, .btn_creation, .btn_contenu, .btn_quotidien, .btn_temps {
transition: .2s ease;
-webkit-transition: .2s ease;
cursor: pointer;
}
.btn_activite:hover, .btn_gestion:hover, .btn_creation:hover , .btn_contenu:hover, .btn_quotidien:hover, .btn_temps:hover{
transform: scale(1.1);
-webkit-transform: scale(1.1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Menu ACCES CBR -->
<div class="flex-container">
<div class="item">
</div>
<div class="item-activite">
<a class="btn_activite" href="#" >
Activité Assurance Q+
</a>
</div>
<div class="item-gestion">
<a href="#" class="btn_gestion">
Gestion Assurance Q+
</a>
</div>
<div class="item-creation">
<a class="btn_creation" href="#" >
Recherche - création
</a>
</div>
<div class="item-cont">
<a href="#" class="btn_contenu">
Recherche - Contenu
</a>
</div>
<div class="item-quot">
<a class="btn_quotidien" href="#">
Quotidien | Hebdo +
</a>
</div>
<div class="item-temps">
<a href="#" class="btn_temps">
Temps | Chrono
</a>
</div>
<div class="item">
</div>
</div>
<!-- Page Activite -->
<div class="container active" id="activite">
<h1>
Activité Assurance Q+
</h1>
</div>
<div class="container" id="gestion">
<h1>
Gestion Assurance Q+
</h1>
</div>
<!-- Page Recherche creation -->
<div class="container" id="creation">
<h1>
Recherche Creation
</h1>
</div>
<!-- Page Aventuriers -->
<div class="container" id="contenu">
<h1>
Recherche Contenu
</h1>
</div>
<!-- Page Équipiers -->
<div class="container" id="quotidien">
<h1>
Quotidien | Hebdo +
</h1>
</div>
<!-- Page Supporters -->
<div class="container" id="temps">
<h1>
Temps | Chrono
</h1>
</div>
This is a top menu with 6 elements each having 15% width. Ignore the div class="item" elements as they just fill the other 10% on each side of the menu.
What I want is to change the order of the 6 classes, so when I click on btn_creation, for example, this menu moves to position 2 (position 1 and 8 are fillers - class "item", I just use positions 2 to 7).
Hope it's clear?
Basically anything I click goes to position 2, moving the rest to the right.
p.s code not working properly in here, but in my computer it works... sorry first time I do this here.
I believe the runnable example below is what is trying to be achieved?
The only change is in the jQuery handling. All the current handling is commented-out, replaced by the short code snippet at the end of the document.ready function. See the comments there.
$(document).ready(function() {
/*
$('.btn_activite').click(function() {
$('#activite').addClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_gestion').click(function() {
$('#activite').removeClass('active');
$('#gestion').addClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_creation').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').addClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_contenu').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').addClass('active');
$('#quotidien').removeClass('active');
$('#temps').removeClass('active');
});
$('.btn_quotidien').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').addClass('active');
$('#temps').removeClass('active');
});
$('.btn_temps').click(function() {
$('#activite').removeClass('active');
$('#gestion').removeClass('active');
$('#creation').removeClass('active');
$('#contenu').removeClass('active');
$('#quotidien').removeClass('active');
$('#temps').addClass('active');
});
*/
// For any <a> tag class that starts with btn_
$('a[class^="btn_"]').click(function() {
// Get the parent div and move it after the
// first div. (with the item class)
$(this).parent().insertAfter($('.item')[0]);
});
});
#charset "UTF-8";
#import url("../webfonts/GothamBook/stylesheet.css");
body {
font-family: GothamBook;
color: #FEFEFE;
}
.flex-container {
DISPLAY: FLEX;
justify-content: space-between;
width: 100%;
color: #FFFFFF;
}
.item {
background-color: black;
width: 5%;
margin: 2px;
}
.item-activite {
background-color: black;
width: 15%;
margin: 2px;
text-align: center;
}
.item-gestion {
background-color: #4D4D4D;
width: 15%;
margin: 2px;
text-align: center;
}
.item-creation {
background-color: #40A9F5;
width: 15%;
margin: 2px;
text-align: center;
}
.item-cont {
background-color: #362984;
width: 15%;
margin: 2px;
text-align: center;
}
.item-quot {
background-color: #662D91;
width: 15%;
margin: 2px;
text-align: center;
}
.item-temps {
background-color: #42A246;
width: 15%;
margin: 2px;
text-align: center;
}
.font-black {
color: #000000;
}
.font-grn {
color: #42A246;
}
.container {
display: flex;
justify-content: center;
align-content: center;
}
#activite, #gestion, #creation, #contenu, #quotidien, #temps {
display: none;
}
#activite.active ,#gestion.active , #creation.active ,#contenu.active ,#quotidien.active , #temps.active{
display: block;
}
a {
text-decoration: none;
color: #FFFFFF;
}
.btn_activite, .btn_gestion, .btn_creation, .btn_contenu, .btn_quotidien, .btn_temps {
transition: .2s ease;
-webkit-transition: .2s ease;
cursor: pointer;
}
.btn_activite:hover, .btn_gestion:hover, .btn_creation:hover , .btn_contenu:hover, .btn_quotidien:hover, .btn_temps:hover{
transform: scale(1.1);
-webkit-transform: scale(1.1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Menu ACCES CBR -->
<div class="flex-container">
<div class="item">
</div>
<div class="item-activite">
<a class="btn_activite" href="#" >
Activité Assurance Q+
</a>
</div>
<div class="item-gestion">
<a href="#" class="btn_gestion">
Gestion Assurance Q+
</a>
</div>
<div class="item-creation">
<a class="btn_creation" href="#" >
Recherche - création
</a>
</div>
<div class="item-cont">
<a href="#" class="btn_contenu">
Recherche - Contenu
</a>
</div>
<div class="item-quot">
<a class="btn_quotidien" href="#">
Quotidien | Hebdo +
</a>
</div>
<div class="item-temps">
<a href="#" class="btn_temps">
Temps | Chrono
</a>
</div>
<div class="item">
</div>
</div>
<!-- Page Activite -->
<div class="container active" id="activite">
<h1>
Activité Assurance Q+
</h1>
</div>
<div class="container" id="gestion">
<h1>
Gestion Assurance Q+
</h1>
</div>
<!-- Page Recherche creation -->
<div class="container" id="creation">
<h1>
Recherche Creation
</h1>
</div>
<!-- Page Aventuriers -->
<div class="container" id="contenu">
<h1>
Recherche Contenu
</h1>
</div>
<!-- Page Équipiers -->
<div class="container" id="quotidien">
<h1>
Quotidien | Hebdo +
</h1>
</div>
<!-- Page Supporters -->
<div class="container" id="temps">
<h1>
Temps | Chrono
</h1>
</div>
I suggest you to modify the name of id, that simplify all the code and use insertafter(): (here i have just add x_ in front of id names..
$(document).ready(function() {
var selector = $('a[class^=btn_]');
selector.on('click', function() {
let clasn = $(this).attr('class').split('_')[1];
$('div[id^=x_]').removeClass('active');
$('#x_' + clasn).addClass('active');
var move = $(this).closest('div');
move.insertAfter($('.item').first());
});
});
#charset "UTF-8";
#import url("../webfonts/GothamBook/stylesheet.css");
body {
font-family: GothamBook;
color: #FEFEFE;
}
.flex-container {
DISPLAY: FLEX;
justify-content: space-between;
width: 100%;
color: #FFFFFF;
}
.item {
background-color: black;
width: 5%;
margin: 2px;
}
.item-activite {
background-color: black;
width: 15%;
margin: 2px;
text-align: center;
}
.item-gestion {
background-color: #4D4D4D;
width: 15%;
margin: 2px;
text-align: center;
}
.item-creation {
background-color: #40A9F5;
width: 15%;
margin: 2px;
text-align: center;
}
.item-cont {
background-color: #362984;
width: 15%;
margin: 2px;
text-align: center;
}
.item-quot {
background-color: #662D91;
width: 15%;
margin: 2px;
text-align: center;
}
.item-temps {
background-color: #42A246;
width: 15%;
margin: 2px;
text-align: center;
}
.font-black {
color: #000000;
}
.font-grn {
color: #42A246;
}
.container {
display: flex;
justify-content: center;
align-content: center;
}
#x_activite,
#x_gestion,
#x_creation,
#x_contenu,
#x_quotidien,
#x_temps {
display: none;
}
#x_activite.active,
#x_gestion.active,
#x_creation.active,
#x_contenu.active,
#x_quotidien.active,
#x_temps.active {
display: block;
}
a {
text-decoration: none;
color: #FFFFFF;
}
.btn_activite,
.btn_gestion,
.btn_creation,
.btn_contenu,
.btn_quotidien,
.btn_temps {
transition: .2s ease;
-webkit-transition: .2s ease;
cursor: pointer;
}
.btn_activite:hover,
.btn_gestion:hover,
.btn_creation:hover,
.btn_contenu:hover,
.btn_quotidien:hover,
.btn_temps:hover {
transform: scale(1.1);
-webkit-transform: scale(1.1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Menu ACCES CBR -->
<div class="flex-container">
<div class="item">
</div>
<div class="item-activite">
<a class="btn_activite" href="#">
Activité Assurance Q+
</a>
</div>
<div class="item-gestion">
<a href="#" class="btn_gestion">
Gestion Assurance Q+
</a>
</div>
<div class="item-creation">
<a class="btn_creation" href="#">
Recherche - création
</a>
</div>
<div class="item-cont">
<a href="#" class="btn_contenu">
Recherche - Contenu
</a>
</div>
<div class="item-quot">
<a class="btn_quotidien" href="#">
Quotidien | Hebdo +
</a>
</div>
<div class="item-temps">
<a href="#" class="btn_temps">
Temps | Chrono
</a>
</div>
<div class="item">
</div>
</div>
<!-- Page Activite -->
<div class="container active" id="x_activite">
<h1>
Activité Assurance Q+
</h1>
</div>
<div class="container" id="x_gestion">
<h1>
Gestion Assurance Q+
</h1>
</div>
<!-- Page Recherche creation -->
<div class="container" id="x_creation">
<h1>
Recherche Creation
</h1>
</div>
<!-- Page Aventuriers -->
<div class="container" id="x_contenu">
<h1>
Recherche Contenu
</h1>
</div>
<!-- Page Équipiers -->
<div class="container" id="x_quotidien">
<h1>
Quotidien | Hebdo +
</h1>
</div>
<!-- Page Supporters -->
<div class="container" id="x_temps">
<h1>
Temps | Chrono
</h1>
</div>
Related
I want my sidemenu to be fixed. But whenever I do it the content page crashes.
It's this class menu_left . When I remove position: fixed then all works fine. But i want it to be fixed. I just want the menu to stay in position so I can scroll down my content only.
* {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
}
nav {
padding: 10px 40px;
background: white;
box-shadow: 0 0.1875rem 0.375rem 0 rgba(0,0,0,.13);
}
#app {
display: flex;
}
.topbar-user {
display: flex;
}
.menu_left {
background: #333c4e;
width: 200px;
height: 100vh;
position: fixed;
}
.menu_left-icon {
padding: 20px;
}
.menu_left-item {
display: flex;
align-items: center;
color: white;
text-decoration: none;
}
.menu_left-item:hover {
background: #293141;
transition: 0.5s;
}
.topbar-items {
display: flex;
align-items: center;
justify-content: space-between;
}
.main__content {
width: 100%;
overflow: scroll;
}
.main__content-container {
padding: 34px 34px;
}
.imgs {
width: 34px;
padding: 20px;
}
.white-card {
background-color: #fff;
width: 100%;
display: flex;
margin-top: 34px;
height: auto;
align-items: center;
box-shadow: 0 0.1875rem 0.375rem 0 rgba(0,0,0,.13);
}
.card1 {
flex: 1;
}
.card2 {
padding: 20px;
}
#media (max-width: 600px) {
.menu_left {
display: none;
}
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
</head>
<body>
<nav>
<div class="topbar-items">
<H1>Logo</H1>
<div class="topbar-user">
<i class="fas fa-bell"></i>
<p>Jan Kowalski</p>
<i class="fas fa-angle-down"></i>
</div>
</div>
</nav>
<div id="app">
<div class="menu_left">
<a href="" class="menu_left-item">
<div class="menu_left-icon"><i class="fas fa-home"></i></div>
<div class="menu_left-text"> Item</div>
</a>
<a href="" class="menu_left-item">
<div class="menu_left-icon"><i class="fas fa-home"></i></div>
<div class="menu_left-text"> Item</div>
</a>
</div>
<div class="main__content">
<div class="main__content-container">
<h2>Main Page</h2>
<div class="white-card">
<div class="card-title">
<img src="https://www.clipartmax.com/png/middle/2-29162_notification-free-internet-website-icon-vector-linkedin-circle-logo-png.png" class="imgs">
</div>
<div class="card1">
<h4>User</h4>
<p>message</p>
</div>
<div class="card2">
<p>19.02.2020</p>
</div>
</div>
<div class="white-card">
<div class="card-title">
<img src="https://www.clipartmax.com/png/middle/2-29162_notification-free-internet-website-icon-vector-linkedin-circle-logo-png.png" class="imgs">
</div>
<div class="card1">
<h4>User</h4>
<p>message</p>
</div>
<div class="card2">
<p>19.02.2020</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
I undesrtand you meant to say the content "collapses" to the left (not crashes).
You could use a pusher placeholder element like so:
* {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
}
nav {
padding: 10px 40px;
background: white;
box-shadow: 0 0.1875rem 0.375rem 0 rgba(0,0,0,.13);
position: fixed;
width: 100%;
box-sizing: border-box;
}
#app {
display: flex;
padding-top: 47px;
}
.topbar-user {
display: flex;
}
.menu_left {
background: #333c4e;
width: 200px;
height: 100vh;
position: fixed;
}
.menu_left-pusher {
flex: 0 0 200px;
}
.menu_left-icon {
padding: 20px;
}
.menu_left-item {
display: flex;
align-items: center;
color: white;
text-decoration: none;
}
.menu_left-item:hover {
background: #293141;
transition: 0.5s;
}
.topbar-items {
display: flex;
align-items: center;
justify-content: space-between;
}
.main__content {
width: 100%;
}
.main__content-container {
padding: 34px 34px;
}
.imgs {
width: 34px;
padding: 20px;
}
.white-card {
background-color: #fff;
width: 100%;
display: flex;
margin-top: 34px;
height: auto;
align-items: center;
box-shadow: 0 0.1875rem 0.375rem 0 rgba(0,0,0,.13);
}
.card1 {
flex: 1;
}
.card2 {
padding: 20px;
}
#media (max-width: 600px) {
.menu_left {
display: none;
}
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
</head>
<body>
<nav>
<div class="topbar-items">
<H1>Logo</H1>
<div class="topbar-user">
<i class="fas fa-bell"></i>
<p>Jan Kowalski</p>
<i class="fas fa-angle-down"></i>
</div>
</div>
</nav>
<div id="app">
<div class="menu_left-pusher">...</div>
<div class="menu_left">
<a href="" class="menu_left-item">
<div class="menu_left-icon"><i class="fas fa-home"></i></div>
<div class="menu_left-text"> Item</div>
</a>
<a href="" class="menu_left-item">
<div class="menu_left-icon"><i class="fas fa-home"></i></div>
<div class="menu_left-text"> Item</div>
</a>
</div>
<div class="main__content">
<div class="main__content-container">
<h2>Main Page</h2>
<div class="white-card">
<div class="card-title">
<img src="https://www.clipartmax.com/png/middle/2-29162_notification-free-internet-website-icon-vector-linkedin-circle-logo-png.png" class="imgs">
</div>
<div class="card1">
<h4>User</h4>
<p>message</p>
</div>
<div class="card2">
<p>19.02.2020</p>
</div>
</div>
<div class="white-card">
<div class="card-title">
<img src="https://www.clipartmax.com/png/middle/2-29162_notification-free-internet-website-icon-vector-linkedin-circle-logo-png.png" class="imgs">
</div>
<div class="card1">
<h4>User</h4>
<p>message</p>
</div>
<div class="card2">
<p>19.02.2020</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
I have added 9 cards to the website I'm making and I'm having two issues.
(1) How do I center the 9 cards? As it is more to the left and not centered to the screen.
(2) How do I remove the scroll bar? It seems like the spacing between the top and bottom cards and also below the bottom cards is a lot therefore its moving down and has a scroll bar.
Website Image
<!DOCTYPE html>
<html>
<head>
<title>Discover | Sweeties</title>
<header>
<div class="header">
<nav class="navigation">
Sweeties | Popular Destinations
<div class="navbar-right">
Home
Discover
About Us
Contact
About Developer
</div>
</nav>
<style>
.navigation{
padding-top:30px;
padding-bottom:30px;
position:absolute;
top:0;
width:100%;
z-index:1001;
}
.navbar-right{
float:right;
padding-right:10%;
}
.navbar-right a{
text-decoration:none;
padding:10px;
color: #FFFFFF;
font-family:Calibri;
font-weight:900;
font-size: 25px;
}
.navbar-right a:hover{
text-decoration:underline;
}
.navbar-logo{
padding-left:10%;
font-family:Calibri;
font-size:30px;
font-weight:bold;
text-decoration:none;
color:#FFFFFF;
}
.video-container {
z-index: -100;
width:100%;
height:75%;
overflow:hidden;
position:absolute;
top:0;
left:0;
}
#video-bg{
width:100%;
}
.portfolio-section{
margin-top:50%;
}
.tagline-left{
float:left;
width:50%;
text-align:center;
}
.tagline-right{
float:right;
width:50%;
text-align:center;
}
.tagline-video{
width:75%;
}
.tagline-right-text{
position:absolute;
margin-top:9%;
text-align:center;
margin-left:17%;
font-family:Calibri;
color:#FFFFFF;
width:290px;
font-size:40px;
}
.tagline-left-text{
position:absolute;
margin-top:9%;
text-align:center;
margin-left:11%;
font-family:Calibri;
color:#fff;
width:375px;
font-size:40px;
}
</style>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
font-family: Calibri, sans-serif;
}
.background-wrap {
position: fixed;
z-index: -1001;
width: 100%;
height: 100%;
overflow: hidden;
top: 0;
left: 0;
}
#video-bg-elem {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
}
.content {
position: absolute;
width: 100%;
min-height: 100%;
z-index: 1000;
background-color: rgba(0,0,0,0.7);
}
.content h1 {
text-align: center;
font-size: 100px;
text-transform: uppercase;
font-weight: 300;
color: #fff;
padding-top: 15%;
margin-bottom: 10px;
}
.content p {
text-align: center;
font-size: 50px;
letter-spacing: 3px;
color: #aaa;
}
</style>
</head>
<body>
<div class="background-wrap">
<video id="video-bg-elem" preload="auto" autoplay="true" loop="loop" muted="muted">
<source src="Videos/beach1.mp4" type="video/mp4">
</video>
</div>
</body>
<style type="text/css">
*{
margin: 0px;
padding: 0px;
}
body{
font-family: Calibri;
}
.main{
margin: 3%;
}
.card{
width: 20%;
background-color: white;
display: inline-block;
box-shadow: 2px 2px 20px black;
border-radius: 25px;
margin: 2%;
}
.image img{
width: 100%;
border-top-right-radius: 25px;
border-top-left-radius: 25px;
}
.title{
text-align: center;
padding: 20px;
}
h1{
font-size: 40px;
}
h2{
font-size: 22px;
}
.des{
padding: 3px;
text-align: center;
padding-top: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
button{
margin-top: 40px;
margin-bottom: 10px;
background-color: white;
border: 1px solid black;
border-radius: 100px;
padding:10px;
}
button:hover{
background-color: black;
color: white;
transition: .5s;
cursor: pointer;
}
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
.card {
position: relative;
overflow: hidden;
}
.card img {
max-width: 100%;
transition: all 0.3s;
display: block;
width: 100%;
height: auto;
transform: scale(1.20);
}
.card:hover img {
transform: scale(1);
}
</style>
<body>
<div class="main">
<div class="card">
<div class="image">
<img src="Images/rakiraki.jpg">
</div>
<div class="title">
<h1>
Rakiraki</h1>
</div>
<div class="des">
<h2>Dive Wananavu</h2>
<button onclick="document.location='https://www.tripadvisor.com/Attraction_Review-g297568-d3850463-Reviews-Dive_Wananavu-Rakiraki_Viti_Levu.html'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/Lautoka.jpg">
</div>
<div class="title">
<h1>
Lautoka</h1>
</div>
<div class="des">
<h2>Koroyanitu National Heritage Park</h2>
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/nadi.jpg">
</div>
<div class="title">
<h1>
Nadi </h1>
</div>
<div class="des">
<h2>Denarau Island</h2>
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/sigatoka.jpg">
</div>
<div class="title">
<h1>
Sigatoka</h1>
</div>
<div class="des">
<h2>Sand Dunes</h2 >
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/ph.jpg">
</div>
<div class="title">
<h1>
Pacific Harbour</h1>
</div>
<div class="des">
<h2>Arts Village</h2>
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/suva.jpg">
</div>
<div class="title">
<h1>
Suva</h1>
</div>
<div class="des">
<h2>Museum</h2>
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/Labasa.jpg">
</div>
<div class="title">
<h1>
Labasa</h1>
</div>
<div class="des">
<h2> KokoMana Vuadomo Waterfall</h2>
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
<div class="card">
<div class="image">
<img src="Images/savusavu.jpg">
</div>
<div class="title">
<h1>
Savusavu</h1>
</div>
<div class="des">
<h2>KokoMana Coco Farm</h2>
<button onclick="document.location='default.asp'">Read More...</button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
The best approach that I would suggest is flex.
I have added some custom style to yoy existing code just to make it fine in flex.
Here is my additional css added.
.main {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.card {
display: flex;
flex-direction: column;
}
.des {
flex-grow: 1;
justify-content: space-between;
display: flex;
flex-direction: column;
}
Your working fiddle.
.navigation {
padding-top: 30px;
padding-bottom: 30px;
/* position: absolute;
top: 0; */
width: 100%;
z-index: 1001;
}
.navbar-right {
float: right;
padding-right: 10%;
}
.navbar-right a {
text-decoration: none;
padding: 10px;
color: #ffffff;
font-family: Calibri;
font-weight: 900;
font-size: 25px;
}
.navbar-right a:hover {
text-decoration: underline;
}
.navbar-logo {
padding-left: 10%;
font-family: Calibri;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #ffffff;
}
#video-bg {
width: 100%;
}
.portfolio-section {
margin-top: 50%;
}
.tagline-left {
float: left;
width: 50%;
text-align: center;
}
.tagline-right {
float: right;
width: 50%;
text-align: center;
}
.tagline-video {
width: 75%;
}
* {
margin: 0;
padding: 0;
}
body {
font-family: Calibri, sans-serif;
}
.background-wrap {
position: fixed;
z-index: -1001;
width: 100%;
height: 100%;
overflow: hidden;
top: 0;
left: 0;
}
#video-bg-elem {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
}
.content {
position: absolute;
width: 100%;
min-height: 100%;
z-index: 1000;
background-color: rgba(0, 0, 0, 0.7);
}
.content h1 {
text-align: center;
font-size: 100px;
text-transform: uppercase;
font-weight: 300;
color: #fff;
padding-top: 15%;
margin-bottom: 10px;
}
.content p {
text-align: center;
font-size: 50px;
letter-spacing: 3px;
color: #aaa;
}
* {
margin: 0px;
padding: 0px;
}
body {
font-family: Calibri;
}
.main {
/* Commented */
/* margin: 3%; */
}
.card {
width: 20%;
background-color: white;
display: inline-block;
box-shadow: 2px 2px 20px black;
border-radius: 25px;
margin: 2%;
}
.image img {
width: 100%;
border-top-right-radius: 25px;
border-top-left-radius: 25px;
}
.title {
text-align: center;
padding: 20px;
}
h1 {
font-size: 40px;
}
h2 {
font-size: 22px;
}
.des {
padding: 3px;
text-align: center;
padding-top: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
button {
margin-top: 40px;
margin-bottom: 10px;
background-color: white;
border: 1px solid black;
border-radius: 100px;
padding: 10px;
}
button:hover {
background-color: black;
color: white;
transition: 0.5s;
cursor: pointer;
}
.card {
position: relative;
overflow: hidden;
}
.card img {
max-width: 100%;
transition: all 0.3s;
display: block;
width: 100%;
height: auto;
transform: scale(1.2);
}
.card:hover img {
transform: scale(1);
}
/* Custom styles */
.main {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
}
.card {
display: flex;
flex-direction: column;
}
.des {
flex-grow: 1;
justify-content: space-between;
display: flex;
flex-direction: column;
}
body {
background: cadetblue;
}
<header>
<div class="header">
<nav class="navigation">
Sweeties | Popular Destinations
<div class="navbar-right">
Home
Discover
About Us
Contact
About Developer
</div>
</nav>
</div>
</header>
<div class="background-wrap">
<video
id="video-bg-elem"
preload="auto"
autoplay="true"
loop="loop"
muted="muted"
>
<source src="https://youtu.be/ujKVJcwbpRo" type="video/mp4" />
</video>
</div>
<div class="main">
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Rakiraki
</h1>
</div>
<div class="des">
<h2>Dive Wananavu</h2>
<button
onclick="document.location='https://www.tripadvisor.com/Attraction_Review-g297568-d3850463-Reviews-Dive_Wananavu-Rakiraki_Viti_Levu.html'"
>
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Lautoka
</h1>
</div>
<div class="des">
<h2>Koroyanitu National Heritage Park</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Nadi
</h1>
</div>
<div class="des">
<h2>Denarau Island</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Sigatoka
</h1>
</div>
<div class="des">
<h2>Sand Dunes</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Pacific Harbour
</h1>
</div>
<div class="des">
<h2>Arts Village</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Suva
</h1>
</div>
<div class="des">
<h2>Museum</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Labasa
</h1>
</div>
<div class="des">
<h2>KokoMana Vuadomo Waterfall</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
<div class="card">
<div class="image">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/RakiRaki_ramens_-_1.jpg/800px-RakiRaki_ramens_-_1.jpg"
/>
</div>
<div class="title">
<h1>
Savusavu
</h1>
</div>
<div class="des">
<h2>KokoMana Coco Farm</h2>
<button onclick="document.location='default.asp'">
Read More...
</button>
</div>
</div>
</div>
I am trying to edit the margin on the nav bar links, however when I change the margin, nothing happens. Does anyone know why this is happening?
/* Whole Page or not one specific section */
main {
text-align: center;
}
body {
max-width: 100%;
height: 100vh;
margin: 0px 0px 0px 0px;
color: #C2D3CD;
}
.topbar, nav {
background-color: #847E89;
}
/* Top Bar */
#temp-logo, #donate-top {
display: inline-block;
}
#donate-top {
float: right;
padding-right: 2%;
padding-left: 2%;
background-color: #C2D3CD;
color: #847E89;
height: 10vh;
cursor: pointer;
}
.donate-name {
padding-top: 4vh;
background-color: #C2D3CD;
border: none;
cursor: pointer;
}
#temp-logo {
padding-top: 0vh;
margin-left: 2%;
font-size: 22px;
}
.topbar {
display: block;
border-bottom: solid 1px #C2D3CD;
height: 10vh;
}
/* Nav Bar */
nav {
text-align: center;
height: 7vh;
}
.link, link:visited {
color: #C2D3CD;
text-decoration: none;
}
#mission-link, #about-link, #donations-link, #contact-link {
margin-top: 5%;
}
/* First Page */
#home-screen {
background-image: url(Images/beach-background-1-NEW.jpg);
height: 80vh;
width: 100%;
background-repeat: no-repeat;
background-size: 100%;
}
.text {
padding-top: 30vh;
}
/* Gallery */
.img {
width: 20vw;
height: 20vw;
}
.desc {
display: inline-block;
position: relative;
margin: 1%;
}
.desc:hover img {
filter: blur(1.5px) brightness(60%);
transition: 0.3s;
box-shadow: 0 0 10px gray;
}
.desc :not(img) {
position: absolute;
top: 37%;
z-index: 1;
text-align: center;
width: 100%;
color: #FFF;
opacity: 0;
transition: 0.3s;
}
.desc:hover :not(img) {
opacity: 1;
}
.img:hover {
transform: scale(1.1);
}
<!DOCTYPE html>
<html>
<head>
<link href="main.css" rel="stylesheet">
<title>Conejo Teen Organization</title>
</head>
<body>
<!-- Top Bar -->
<div class="topbar">
<!-- Get logo ASAP -->
<p id="temp-logo"><em>Conejo Teen Organization</em></p>
<a id="donate-top" class="donate" href="#"><button class="donate-name">Donate</button></a>
</div>
<!-- Nav -->
<nav>
<a id="mission-link" class="link" href="#">Mission</a>
<a id="about-link" class="link" href="#">About Us</a>
<a id="donations-link" class="link" href="#">What We Do</a>
<a id="contact-link" class="link" href="#">Contact</a>
</nav>
<!-- Main -->
<main>
<!-- First Section -->
<section id="home-screen">
<article class="text">
<h1 id="h1">Conejo Teen Organization</h1>
<p id="h1-desc">Helping California teens in need since 2017</p>
<button id="donate-home" class="donate">Donate Now!</button>
</article>
</section>
<!-- Our Mission -->
<section id="mission">
<h2 id="mission-h2">Our Mission</h2>
<p id="mission-statement">Our goal is to identify organizations and individuals in need, and assist in the most effective and appropriate way. In addition, the specific objective and purpose of Conejo Teen Organization shall be to provitde teens in an opportunity to learn about, perform and be engaged in community service activities. We want to provide a safe outlet and positive culture for teens to engage with other like-minded teens and mentors.</p>
</section>
<!-- Image Gallery (images of projects) -->
<section id="gallery">
<h2 id="images">Gallery</h2>
<!-- Put service images here. On hover, enlarge image and put text overlay with link to that project -->
<div class="row1 row">
<!-- Image 1 -->
<div class="desc-1 desc">
<img src="Gallery/DecMyRoom-1-Edit.jpg" class="img img-1">
<h3 id="img-desc">Dec My Room</h3>
</div>
<!-- Image 2 -->
<div class="desc desc-2">
<img src="Gallery/DecMyRoom-2-Edit.jpg" class="img img-2">
<h3 id="img-desc">Dec My Room</h3>
</div>
<!-- Image 3 -->
<div class="desc desc-1">
<img src="Gallery/DecMyRoom-3-Edit.jpg" class="img img-3">
<h3 id="img-desc">Dec My Room</h3>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer>
<p id="copyright">© 2018 Conejo Teen Organization</p>
<p id="my-credit">Created by Jacob Pieczynski</p>
</footer>
</body>
</html>
You're trying to apply margin-top to inline elements which you can't do since it would disrupt the flow of the page:
#mission-link, #about-link, #donations-link, #contact-link {
display: inline-block; /* Try making them inline block */
margin-top: 5%;
}
Try making the links inline-block.
Add display: inline-block like:
#mission-link, #about-link, #donations-link, #contact-link {
margin-top: 5%;
display: inline-block;
}
I have checked your code remove: height: 10vh; from topbar class
I am developing my portfolio website but I am encountering some issues in different browsers. When I go to the website in Firefox and hover over an img element scrollbars pop up and suddenly I can scroll through the entire document (left, right, up and down). I feel like this is a Firefox issue since I only encounter this issue there and not in any other browsers.
You can find the website here nadiasportfolio.tumblr.com
$(document).ready(function() {
$("#NEW").delay(250).fadeIn(1000);
$("#MEDIA").delay(850).fadeIn(1000);
$("#NEWB").delay(1600).fadeIn(1000);
// $(".thumbnail").each(function(i){
// $(this).attr("id", "thumbnail" + i);
// });
$(".content").each(function(i) {
$(this).attr("id", "content" + i);
});
$(".thumbnail").addClass("color-hover");
$(".pdf").addClass("color-hover");
$(".content > img").addClass("color-hover");
$(".content").hide();
$("#toggleHeader").html("");
setTimeout(function() {
$("header").trigger('click');
}, 3000);
$("header").on("click", headerScrollUp);
$("header a").click(function(evt) {
evt.stopPropagation();
});
$("#toggleHeader").on("click", headerScrollDown);
$(".thumbnail").on("click", toggleContent);
$(".pdf").on("click", changeSizePDF);
});
var viewportWidth = $(window).width();
var viewportHeight = $(window).height();
$(window).on("resize", function(event) {
// "if (x !== undefined){}" -> does not scroll back to horizontal 0
// but is all over the place
// if (x !== undefined) {
scrollToCurrent = ($(window).width() * 1.015 * x - $(window).width());
$("section").animate({
scrollLeft: scrollToCurrent
}, 10);
$(".pdf").children("img").css("height", "8vh").css("width", "auto").css("cursor", "zoom-in");
// }
});
var x;
var scrollToCurrent;
function headerScrollUp() {
$("header").animate({
height: "0vh"
}, 1000);
$("#toggleHeader").html("≡");
}
function headerScrollDown() {
$("header").animate({
height: "100vh"
}, 1000);
$("#toggleHeader").html("");
}
function toggleContent() {
if ($(this).next(".content").is(":hidden") === true) {
x = $(this).parent().index() + 1;
// scrollToCurrent = ($(window).width() * 1.0 * x - $(window).width());
console.log(this);
scrollToCurrent = (($(this).width() + 8) * x - ($(this).width() + 8));
$("section").animate({
scrollLeft: scrollToCurrent
}, 500);
$(this).delay(500).next(".content").show();
$(this).parent().siblings().css("opacity", "0");
$("section").css("overflow-x", "hidden");
$("section").css("overflow-y", "initial");
$("section").animate({
scrollTop: viewportHeight / 2 + "px"
}, 500);
$(".toggleText").css("transform", "scaleY(-1)");
// $(".toggleText").animate({transform: "rotate(90deg)"}, 500);
} else {
//animatie werkt niet ??
$(".toggleText").css("transform", "scaleY(1)");
$("section").animate({
scrollTop: "-=1000px"
}, 100);
$(this).delay(100).next(".content").hide();
$(this).parent().siblings().css("opacity", "100");
$("section").css("overflow-x", "initial");
$("section").css("overflow-y", "hidden");
}
}
function changeSizePDF() {
if ($(this).children("img").height() < viewportHeight / 9) {
var heightBig = $(this).children("img").height() * 9;
var widthBig = $(this).children("img").width() * 9;
$(this).children("img").animate({
height: heightBig,
width: widthBig
});
$(this).css("cursor", "zoom-out");
} else {
var heightSmall = $(this).children("img").height() / 9;
var widthSmall = $(this).children("img").width() / 9;
// var ratioToSmall = (viewportHeight / 100 * 8) * $(this).children("img").width() / $(this).children("img").height();
$(this).children("img").animate({
height: heightSmall,
width: widthSmall
});
$(this).css("cursor", "zoom-in");
}
}
.iframe-controls-container,
.iframe-controls-container--logged-in,
.tmblr-iframe,
.tmblr-iframe--desktop-logged-in-controls,
.iframe-controls--desktop {
display: none;
}
* {
margin: 0;
padding: 0;
font-weight: normal;
}
.color-hover {
filter: grayscale(255);
-webkit-filter: grayscale(255);
}
.color-hover:hover {
filter: grayscale(0);
-webkit-filter: grayscale(0);
}
body {
color: white;
background-color: black;
font-family: helvetica;
}
h1 {
font-size: 4vw;
}
h2,
nav a {
font-size: 2.5vw;
margin: auto;
}
h3 {
font-size: 1.5vw;
margin: auto;
}
p {
font-size: 1em;
}
code {
font-family: monospace;
background-color: lightgray;
color: rgba(0, 0, 0, 0.9);
}
::-webkit-scrollbar {
width: 4px;
/* change scrollbar space */
height: 4px;
background: black;
/* optional: just make scrollbar invisible */
}
/* optional: show position indicator in red */
::-webkit-scrollbar-thumb {
background: linear-gradient(to bottom right, #ff00bf, #ff00e9, #b600ff, #9000ff, #3f00ff, #0d00c9);
}
#posts {
display: none;
}
header {
background-color: #ddddff;
height: 100vh;
width: 100vw;
text-align: center;
-webkit-overflow: auto;
overflow: auto;
position: fixed;
z-index: 1;
}
header h1 {
margin-top: 40vh;
}
a {
color: white;
text-transform: uppercase;
}
nav {
position: absolute;
bottom: 1vh;
width: 100vw;
}
nav a {
margin-left: 2vw;
margin-right: 2vw;
cursor: pointer;
}
section {
height: 98vh;
white-space: nowrap;
-webkit-overflow-x: scroll;
-webkit-overflow-y: hidden;
overflow-x: scroll;
overflow-y: hidden;
}
#toggleHeader {
width: 100vw;
background: #ddddff;
opacity: 0.9;
text-align: center;
height: 2vh;
cursor: pointer;
}
article {
/* background-color: darkgray;*/
width: 100vw;
height: 99vh;
display: inline-block;
/*
border-top: 5px solid black;
border-left: 2px solid black;
border-right: 2px solid black;
*/
text-align: center;
}
.thumbnail {
padding: 2%;
width: 100vw;
height: 99vh;
background: radial-gradient(skyblue, midnightblue);
/* background-size: cover;*/
background-size: 50vh;
background-position: center;
background-color: white;
-webkit-overflow-y: hidden;
overflow-y: hidden;
border: 4px solid black;
}
#tn-window-of-sounds {
background-image: url("http://static.tumblr.com/6zouj6x/RyIom7lgk/window_of_sounds_logo.svg");
background-size: 50vh;
/* background-repeat: no-repeat;*/
}
#tn-lets-make {
background-image: url("https://68.media.tumblr.com/dcb2c0ecd7663664d00208b793aeec93/tumblr_ome08qJX761w34hfho3_r1_1280.png");
}
#tn-jumbo {
background-image: url("https://68.media.tumblr.com/1baf77332e4ae9873da8dbf483870f5e/tumblr_omnx7cJ38U1w34hfho2_r1_540.png");
}
#tn-do {
/*gif:*/
/* background-image: url("https://media.giphy.com/media/26FmRuwDb5eFOPDZS/source.gif");*/
/* still image:*/
background-image: url("https://68.media.tumblr.com/4a4f6f8f43e3a3d8ab6ef29967d47491/tumblr_omnu22CYIt1w34hfho1_1280.png");
}
#tn-van-gogh {
background-image: url("https://68.media.tumblr.com/fe28945f60e1d27d89b03f79661b7f1a/tumblr_omo650hbbp1w34hfho1_1280.png");
}
#tn-data-visualisation {
background-image: url("http://static.tumblr.com/6zouj6x/Yonomo9jy/ballonnen_met_mens.svg");
}
#tn-nature-tour {
background-image: url("https://68.media.tumblr.com/7e0c4cc06b662fca87201399ad134d64/tumblr_omocqygQIu1w34hfho1_1280.png");
}
#tn-insect-stamps {
background-image: url("https://68.media.tumblr.com/3c3d875629cd2ced500c9c59c288ca61/tumblr_omt5hkNls91w34hfho9_1280.jpg");
}
.textWrapper {
width: 40vw;
padding: 1vw;
margin: auto;
margin-top: 40vh;
background-color: rgba(0, 0, 0, 1);
cursor: pointer;
}
.textWrapper:hover {
font-family: monospace;
font-weight: thin;
}
.thumbnail h2 {
text-transform: uppercase;
}
.toggleText {
background: url("https://d30y9cdsu7xlg0.cloudfront.net/png/615573-200.png");
background-repeat: no-repeat;
background-size: contain;
background-position: center;
height: 7.5vw;
width: 7.5vw;
margin: auto;
margin-top: 30vh;
/* z-index: -1;*/
cursor: pointer;
}
.content {
padding-top: 5vh;
padding-bottom: 1vh;
display: none;
width: 90vw;
min-height: 500px;
position: sticky;
left: 0;
}
.content p,
.content code {
white-space: normal;
text-align: left;
}
.content p {
padding: 5vw;
padding-top: 1vh;
padding-bottom: 1vh;
}
.content>img {
max-height: 90vh;
max-width: 90vw;
visibility: visible;
}
.background-color-white {
background-color: white;
}
.pdf {
background-color: black;
-webkit-overflow: scroll;
overflow: scroll;
width: 100vw;
text-align: left;
cursor: zoom-in;
}
.pdf img {
height: 10vh;
width: auto;
}
embed {
width: 100vw;
}
.embed-code {
background-color: lightgray;
height: 40vh;
margin: 0;
}
video {
background-color: gray;
max-height: 100vh;
max-width: 100vw;
}
footer {
background-color: blue;
}
/*{CustomCSS}*/
<!DOCTYPE html>
<html>
<head>
<title>Nadias portfolio.</title>
<!-- <link rel="shortcut icon" href="{Favicon}">-->
<link rel="stylesheet" href="index.css">
<meta charset="UTF-8">
<meta name="keywords" content="portfolio, Nadia, van, Leur, CMD, communication, &, and, multimedia, design, jquery, student, javascript, html, css">
<meta name="author" content="Nadia van Leur">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
{block:Description}
<meta name="description" content="{MetaDescription}" />
{/block:Description}
-->
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
<script src="index.js"></script>
</head>
<body>
<header>
<h1>Nadias portfolio.</h1>
<nav>
Resume
Nederlands
</nav>
</header>
<div id="toggleHeader" class="color-hover">
≡
</div>
<section>
<!--Window of Sounds app -->
<article>
<div class="thumbnail" id="tn-window-of-sounds">
<div class="textWrapper">
<h2>Window of Sounds</h2>
<h3>Think further than the frame.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content1">
<p>Window of Sounds is an app created for Het Noordbrabants Museum. A museum about the art history of Noord-Brabant.<br></p><br>
<img src="foto mensen koptelefoon"><br>
<img src="foto mensen koptelefoon"><br>
<img src="foto mensen koptelefoon"><br>
<embed class="embed-code" src="http://static.tumblr.com/6zouj6x/nSiomo27n/index.js.txt">
</div>
</article>
<!-- Visuele identiteit Let's Make -->
<article>
<div class="thumbnail" id="tn-lets-make">
<div class="textWrapper">
<h2>Let's Make</h2>
<h3>Visual Identity.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content2">
<p>Test tekst2</p><br>
<img src="https://68.media.tumblr.com/23c916b7cf86e27103acee1e21bc6938/tumblr_ome08qJX761w34hfho1_1280.png">
<img src="https://68.media.tumblr.com/30c0e288a6e406d54792441f9c498c75/tumblr_ome08qJX761w34hfho2_1280.png">
</div>
</article>
<!--Jumbo shopping app -->
<article>
<div class="thumbnail" id="tn-jumbo">
<div class="textWrapper">
<h2>Shopping app design</h2>
<h3>Jumbo supermarket.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content3">
<p>Test tekst3</p><br>
<div class="pdf">
<img src="https://68.media.tumblr.com/1baf77332e4ae9873da8dbf483870f5e/tumblr_omnx7cJ38U1w34hfho2_r1_1280.png">
<img src="https://68.media.tumblr.com/07340d2e8a0fa3279d19685c5d2efe2a/tumblr_omo0gfTM8I1w34hfho9_1280.png">
<img src="https://68.media.tumblr.com/589f872342e4900461e3feb9779d0276/tumblr_omnx7cJ38U1w34hfho1_1280.png">
<img src="https://68.media.tumblr.com/71d4d216751e80c4ff59cb16be2f8676/tumblr_omo0gfTM8I1w34hfho8_1280.png">
<img src="https://68.media.tumblr.com/5b9968c37295813a3321dc5c965e6c96/tumblr_omo0gfTM8I1w34hfho10_1280.png">
<img src="https://68.media.tumblr.com/ea1523e56ac76ae2b2bc35ab5a035823/tumblr_omo0gfTM8I1w34hfho7_1280.png">
<img src="https://68.media.tumblr.com/aa814e094d3aeead9106393b7a644d05/tumblr_omo0gfTM8I1w34hfho6_1280.png">
<img src="https://68.media.tumblr.com/02add0021cf9bae65d227056e133b45e/tumblr_omo0gfTM8I1w34hfho2_1280.png">
<img src="https://68.media.tumblr.com/1eea370bdf68eabeec685f4609b8660d/tumblr_omo0gfTM8I1w34hfho3_1280.png">
<img src="https://68.media.tumblr.com/65b545b972450f03be3aed4f91fb58ba/tumblr_omo0gfTM8I1w34hfho5_1280.png">
<img src="https://68.media.tumblr.com/8eaaa91a977d9d9f083375f9c25b296d/tumblr_omo0gfTM8I1w34hfho4_1280.png">
<img src="https://68.media.tumblr.com/4452fecce1b47f3eb3785c4634154f71/tumblr_omo0gfTM8I1w34hfho1_1280.png">
</div>
<div class="pdf">
<!-- wireframes-->
<img src="https://68.media.tumblr.com/bd85af7bc33d967c3bc1d2c3a652cb0c/tumblr_omob6m2joz1w34hfho2_1280.png">
<img src="https://68.media.tumblr.com/99379cfa879f8933b324dc19ec1eff40/tumblr_omob6m2joz1w34hfho4_1280.png">
<img src="https://68.media.tumblr.com/b93a861e995036681bca011466728e12/tumblr_omob6m2joz1w34hfho1_1280.png">
<img src="https://68.media.tumblr.com/b65291e59aafa734d45e71afe6577471/tumblr_omob6m2joz1w34hfho3_1280.png">
</div>
<div class="pdf">
<!-- flowchart-->
<img src="https://68.media.tumblr.com/5cf04fbf473771e3ad12bc35c37ef9df/tumblr_omoa1vsBJz1w34hfho1_1280.png" class="background-color-white">
</div>
</div>
</article>
<!--Do - to do list -->
<article>
<div class="thumbnail" id="tn-do">
<div class="textWrapper">
<h2>Do</h2>
<h3>Your interactive planning buddy.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content4">
<p>Test tekst3</p><br>
<video controls>
<source src="https://nadiasportfolio1.tumblr.com/video_file/t:iXG2gnAz8wfzNTNiBot6bQ/158063052645/tumblr_ome2pg5G361w34hfh/480" type="video/mp4">
</video><br>
<embed class="embed-code" src="http://static.tumblr.com/6zouj6x/u8xomeeab/code_week_7.5.txt">
</div>
</article>
<!--Van Gogh museum concept -->
<article>
<div class="thumbnail" id="tn-van-gogh">
<div class="textWrapper">
<h2>Vincent van Gogh</h2>
<h3>Museum concept.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content5">
<p>Test tekst3</p><br>
<img src="https://68.media.tumblr.com/fe28945f60e1d27d89b03f79661b7f1a/tumblr_omo650hbbp1w34hfho1_1280.png"><br>
<img src="https://68.media.tumblr.com/35adcb40d7794ff87a24f6c1137dea18/tumblr_omo650hbbp1w34hfho3_r1_1280.png"><br>
<img src="https://68.media.tumblr.com/1aefc3bee07b76fbc2a77e42ea21987c/tumblr_omo650hbbp1w34hfho2_r1_1280.png">
</div>
</article>
<!--Festival data visualisation -->
<article>
<div class="thumbnail" id="tn-data-visualisation">
<div class="textWrapper">
<h2>Festival fun</h2>
<h3>Data visualisation.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content6">
<p>Test tekst3</p><br>
<img src="http://static.tumblr.com/6zouj6x/ZMgomo9ik/ballonnen.svg"> <br>
<img src="http://static.tumblr.com/6zouj6x/Yonomo9jy/ballonnen_met_mens.svg">
</div>
</article>
<!--nature tour concept -->
<article>
<div class="thumbnail" id="tn-nature-tour">
<div class="textWrapper">
<h2>Nature tour</h2>
<h3>Hybrid reality studying.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content7">
<p>Test tekst3</p><br>
<img src="https://68.media.tumblr.com/7e0c4cc06b662fca87201399ad134d64/tumblr_omocqygQIu1w34hfho1_1280.png"> <br>
<img src="https://68.media.tumblr.com/696f84dadfdbe32a27e465cc32587644/tumblr_omocqygQIu1w34hfho2_1280.png">
</div>
</article>
<!-- Insect stamps -->
<article>
<div class="thumbnail" id="tn-insect-stamps">
<div class="textWrapper">
<h2>Insect stamps</h2>
<h3>Print design.</h3>
</div>
<div class="toggleText"></div>
</div>
<div class="content" id="content8">
<p>Test tekst3</p><br>
<div class="pdf">
<img src="https://68.media.tumblr.com/41d9fb6e284ba7f2b3250c3ab6df237f/tumblr_omt5bdemab1w34hfho1_1280.png">
<img src="https://68.media.tumblr.com/d1353684775c941d446f27cbbcbe2e20/tumblr_omt5bdemab1w34hfho2_1280.jpg">
<img src="https://68.media.tumblr.com/5a7049422a210bfd6662cca2715dec61/tumblr_omt5bdemab1w34hfho3_1280.png">
<img src="https://68.media.tumblr.com/f907bae2cb23340dac25a7fcee2086b7/tumblr_omt5bdemab1w34hfho4_1280.jpg">
<img src="https://68.media.tumblr.com/08c51ac81196e4cf97f07d440b187f97/tumblr_omt5bdemab1w34hfho5_1280.jpg">
<img src="https://68.media.tumblr.com/b723a80f40b6a47b1685cbb211ceffe5/tumblr_omt5bdemab1w34hfho7_1280.png">
<img src="https://68.media.tumblr.com/13e4fecf712f10b17456c13a9f60f9f9/tumblr_omt5bdemab1w34hfho6_1280.png">
<img src="https://68.media.tumblr.com/65c627320107a02f7d611b1cec67cea6/tumblr_omt5bdemab1w34hfho8_1280.png">
<img src="https://68.media.tumblr.com/47785b763eafda7a6efa7debaaf03d06/tumblr_omt5bdemab1w34hfho10_1280.png">
<img src="https://68.media.tumblr.com/a2770b062c2b80146c4101fb85d03194/tumblr_omt5bdemab1w34hfho9_1280.png">
<img src="https://68.media.tumblr.com/53c925ddb870b2e548e8a542799a2a54/tumblr_omt5hkNls91w34hfho1_1280.jpg">
<img src="https://68.media.tumblr.com/182f16489d01d846c55c3a9022b52ddb/tumblr_omt5hkNls91w34hfho2_1280.png">
<img src="https://68.media.tumblr.com/a63baa1ad66ed76657b0a440bc072c18/tumblr_omt5hkNls91w34hfho3_1280.png">
<img src="https://68.media.tumblr.com/18574a0a546a587c946b8d1fbd057acb/tumblr_omt5hkNls91w34hfho4_1280.jpg">
<img src="https://68.media.tumblr.com/1c11c92fdd5d594a10b036eb7e8bac48/tumblr_omt5hkNls91w34hfho5_1280.jpg">
<img src="https://68.media.tumblr.com/c2b54fedf1b2903071aca31beba48dbb/tumblr_omt5hkNls91w34hfho6_1280.png">
<img src="https://68.media.tumblr.com/2f138adcce9e7b9f884797a5e368863d/tumblr_omt5hkNls91w34hfho7_1280.png">
<img src="https://68.media.tumblr.com/80a6230cd93c50508bd99bdc9902eaeb/tumblr_omt5hkNls91w34hfho8_1280.jpg">
<img src="https://68.media.tumblr.com/3c3d875629cd2ced500c9c59c288ca61/tumblr_omt5hkNls91w34hfho9_1280.jpg">
</div>
</div>
</article>
</section>
<footer>
</footer>
</body>
</html>
Could someone explain me how do I center my text on bottom of the div container?
<div class="container-fluid">
<header id="welcome-header" class="row">
<div id="welcome-div">
<img src="img/logo.png" alt="logo">
<h1 class="welcome-text">
<span>Hi, I'm Robert. I design & build</span>
<br>
<span class="welcome-text-animation"></span>
</h1>
<div class="hire-button">
Yes, I'm available for hire
</div>
<div class="page-scroll ">
<a href="#welcome-div">
Learn more about what i do
<br>
<i class="fa fa-chevron-down"></i>
</a>
</div>
</div>
</header>
Im trying to get "Learn more about what i do" at the bottom of "welcome-header" row.
CSS :
#welcome-div {
min-height: 100%;
position: relative;
}
.page-scroll {
}
.page-scroll a {
font-family: Sansita;
text-decoration: none;
font-size: 20px;
color: aliceblue;
}
Sorry guys u get me wrong. I want the string to stick to bottom like bottom: 0px;
http://codepen.io/anon/pen/jBLaBX
Add position: relative to #welcome-header then position: absolute; bottom: 0; left: 0; right: 0 to .page-scroll to position the element at the bottom of #welcome-header, and your text-align: center rule will center the text horizontally.
#import url('https://fonts.googleapis.com/css?family=Sansita');
#welcome-header {
width: 100%;
height: 100vh;
background-image: url(img/background.jpg);
position: relative;
}
.welcome-text,
.welcome-text-animation {
font-family: Sansita;
text-align: center;
color: aliceblue;
font-size: 50px;
padding-top: 90px;
}
.home-logo {
display: block;
text-align: center;
}
.home-logo img {
display: inline-block;
padding: 2.5%;
width: 120px;
height: 120px;
margin-left: auto;
margin-right: auto;
display: block;
}
.hire-button {
text-align: center;
padding-top: 90px;
}
.hire-button a {
font-family: Sansita;
text-decoration: none;
color: aliceblue;
font-size: 25px;
border: 2px solid #FDCD3B;
border-radius: 50px;
padding: 1.2%;
transition: all 0.2s linear;
}
.hire-button a:hover {
background-color: #FDCD3B;
color: #2A3A3F;
padding-left: 3%;
padding-right: 3%;
}
#welcome-div {}
.page-scroll {
text-align: center;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.page-scroll a {
font-family: Sansita;
text-decoration: none;
font-size: 20px;
color: black;
}
<body>
<div class="container-fluid">
<header id="welcome-header" class="row">
<div id="welcome-div">
<img src="img/logo.png" alt="logo">
<h1 class="welcome-text">
<span>Hi, I'm Robert. I design & build</span>
<br>
<span class="welcome-text-animation"></span>
</h1>
<div class="hire-button">
Yes, I'm available for hire
</div>
<div class="page-scroll ">
<a href="#welcome-div">
Learn more about what i do
<br>
<i class="fa fa-chevron-down"></i>
</a>
</div>
</div>
</header>
<section id="about" class="row">
ABOUT CONTENT
</section>
<section id="skills" class="row">
SKILLS CONTENT
</section>
<section id="portfolio" class="row">
PORTFOLIO CONTENT
</section>
<section id="contact" class="row">
CONTACT CONTENT HERE
</section>
</div>
</body>
.page-scroll {
text-align:center;
}