my navbar is disappearing even after having position sticky.
My code was working till the about section so the div container is already change but so I did the same as about section in the forwarded/next section and this time the navbar disappeared which doesn't seem correct.
* {
margin: 0;
padding: 0;
font-family: 'Montserrat', sans-serif;
}
html {
scroll-behavior: smooth;
}
/* CSS Variables */
:root {
--navbar-height: 59px;
}
#navbar {
display: flex;
align-items: right;
position: sticky;
top: 0px;
justify-content: right;
}
#navbar::before {
content: "";
background-color: rgb(15, 15, 15);
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
z-index: -1;
opacity: 1;
}
/* Navigation Bar: Logo and Image */
#logo {
margin: auto;
position: sticky;
flex-direction: row;
align-items: center;
}
#logo h1 {
color: rgb(255, 255, 255);
margin: auto;
position: sticky;
font-size: 1.8vw;
font-weight: 800;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
animation-name: loco;
animation-duration: 3s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
#keyframes loco {
0% {
color: rgb(120, 255, 255);
}
25% {
color: rgb(85, 255, 141);
}
50% {
color: rgb(182, 255, 194);
}
75% {
color: rgb(50, 255, 203);
}
100% {
color: rgb(100, 255, 148);
}
}
/* Navigation Bar: List Styling */
#navbar ul {
display: flex;
}
#navbar ul li {
list-style: none;
font-size: 1vw;
margin: 5px 2px;
}
#navbar ul li a {
color: #ffffff;
display: block;
padding: 8px 44px;
margin: -2px 11px;
text-decoration: none;
font-weight: 900;
font-size: large;
border-radius: 0px;
transition: all 0.5s;
}
#navbar ul li a {
transition-timing-function: ease-in-out;
font-size: 1.5rem;
}
#navbar ul li a:hover {
border-radius: 20px;
color: rgb(0, 255, 136);
border-radius: 20px;
text-shadow: 0 0 10px #00ff55;
}
/* Home */
#home {
display: flex;
justify-content: left;
align-items: center;
height: 950px;
}
#home h1 {
font-family: 'Radio Canada';
font-size: 7vw;
text-align: center;
text-transform: capitalize;
color: #FFFFFF;
text-shadow: 5px 5px 4px #0047FF;
margin-left: 39px;
}
#home::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
background: url(images/traxer-4PljbcYIzyE-unsplash\ \(1\).jpg)no-repeat center center/cover;
box-shadow: inset 529px 4px 250px 10px rgb(0, 0, 0, 90);
filter: blur(1.5px);
top: 0px;
left: 0px;
z-index: -1;
}
/*About- Section*/
#about {
display: flex;
align-items: center;
flex-direction: column;
flex-wrap: wrap;
align-content: center;
justify-content: center;
}
#about::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
background: url(/images/closeup-golden-bitcoins-dark-reflective-surface-histogram-decreasing-crypto.jpg)no-repeat center center/cover;
box-shadow: inset 529px 4px 250px 10px rgb(0, 0, 0, 90);
filter: blur(1.5px);
top: 950px;
left: 0px;
z-index: -2;
}
#about h1 {
/* position: absolute; */
width: 798.53px;
height: 78px;
margin-top: 80px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 700;
font-size: 5vw;
line-height: 78px;
text-align: center;
color: #ffffff;
}
#about p {
/* position: absolute; */
width: 777.37px;
height: 462px;
margin-top: 113px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 100;
font-size: 2vw;
line-height: 59px;
text-align: center;
color: #ffffff;
}
#about .btn {
width: 474.93px;
/* height: 60px; */
font-family: 'Montserrat';
font-style: normal;
font-weight: 600;
font-size: 2.4vw;
line-height: 59px;
text-align: center;
justify-content: center;
/* margin: -44px 152px 28px 152px;*/
}
#about .btn a {
border-radius: 9px;
color: #ffc400;
/* background:black; */
text-decoration: none;
border-radius: 10px;
text-shadow: 0px 0px 5px rgb(255, 238, 0);
padding: 5px 5px;
transition: all 1s;
}
#about .btn a:hover {
background: none;
color: rgb(0, 255, 149);
border-radius: 10px;
text-shadow: 0px 0px 10px rgb(0, 255, 149);
}
/* ---charts section */
#chart {
display: flex;
}
#chart::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
background: url(/images/maxim-hopman-fiXLQXAhCfk-unsplash.jpg)no-repeat center center/cover;
box-shadow: inset 200px 4px 250px 10px rgb(0, 0, 0, 90);
filter: blur(1.5px);
top: 1920px;
left: 0px;
filter: brightness(0.5);
z-index: -2;
}
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Radio+Canada:wght#700&display=swap" rel="stylesheet">
<nav id="navbar">
<div id="logo">
<h1>All Crypto</h1>
</div>
<ul>
<li class="item"> Home</li>
<li class="item"> About</li>
<li class="item"> Chart</li>
<li class="item"> News</li>
</ul>
</nav>
<div id="home">
<h1>Crypto <br> At Your <br> Fingertips</h1>
</div>
<div id="about">
<h1>What Is CryptoCurrency</h1>
<!-- <div id="img">
<img src="/images/NFT_4.png" alt="">
</div> -->
<p>A cryptocurrency, crypto<br>currency, or crypto is a digital<br> currency designed to work as <br> a medium of exchange through<br> a computer network that is not<br> reliant on any central<br>authority.....</p>
<div class="btn">
Read More
</div>
</div>
<div id="chart">
</div>
I think you should use position:fixed instead of position:sticky. And set the width to 100% to fit the screen. Here's the code:
#navbar {
display: flex;
align-items: right;
position: fixed;
top: 0px;
width: 100%;
justify-content: right;
}
The problem is not with the #about section; it lies with the #chart section. You should have some kind of dimensions to the chart section, e.g.:
#chart {
display:flex;
height:100em;
}
Also, it doesn't look like you have much reason to be using a pseudo element for what looks like the image. I would recommend setting the background image to #chart, and not #chart::before.
Since your header doesn't seem to require a sticky position, please think about using position:fixed;.
Related
I'm having trouble with getting my image to align next to a div. I have tried adding float right but that doesn't seem to be working. I have also tried playing around with different padding but it's only cause my wrapper div to not properly fully show as if its being cut off by a black box on the side or completely is out of the frame of the website. Also, for some reason, the image isn't showing up at all.
Html:
<body>
<div class="container">
<nav>
<div class="logo">dev simone</div>
<ul class="navItems">
<li>
<b class="nav1">.</b>home
</li>
<li>
<b class="nav1">.</b>projects
</li>
<li>
<b class="nav1">.</b>about-me
</li>
<li>
<b class="nav1">.</b>contact-me
</li>
</ul>
<div class="links">
<a
href="#"
target="_blank"
tabindex="1"
><i class="icono-linkedIn"></i
></a>
</div>
</nav>
<div class="wrapper">
<div class="cols cols0">
<span class="topline">Hello</span>
<h1>I'm a <span class="multiText">coder</span></h1>
<p>
Lorem ipsum.
</p>
<div class="btns">
<button class="textbtns">Resume</button>
<button class="textbtns">GitHub</button>
</div>
</div>
<div class="cols cols1">
<div class="imgbox">
<img src="#" id="splash" />
<img src="images/port-photo.PNG" alt="creator" />
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
#import url("https://fonts.googleapis.com/css2?family=Montserrat:wght#200&family=Zeyada&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Montserrat", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-touch-callout: none;
-webkit-text-size-adjust: none;
-ms-text-size-adjust: none;
text-size-adjust: none;
color: whitesmoke;
font-weight: bolder;
text-decoration: none;
}
html,
body {
height: 100%;
}
body {
overflow: hidden;
width: 100%;
height: 100%;
background-color: black;
}
.logo {
width: 100%;
min-height: 100vh;
display: flex;
font-family: "zeyada" cursive, sans-serif;
}
nav {
display: flex;
width: 100%;
justify-content: space-around;
height: 80px;
z-index: 111;
background-color: rgb(202, 184, 216);
line-height: 80px;
}
.logo {
display: flex;
font-family: "zeyada" cursive;
font-size: 40px;
font-weight: 800;
color: #382f4d;
letter-spacing: 0.2em;
cursor: pointer;
text-transform: uppercase;
white-space: nowrap;
}
b {
font-size: 100px;
font-weight: 800;
color: rgb(255, 54, 171);
}
.navItems {
display: flex;
justify-content: space-around;
align-items: center;
white-space: nowrap;
}
.navItems li {
list-style: none;
margin: 0 0.75em;
display: flex;
justify-content: space-around;
align-items: center;
margin-right: 2em;
font-size: 10px;
}
.navItems li a {
color: rgb(255, 54, 171);
font-size: 25px;
letter-spacing: 0.3em;
}
.navItems li:hover a {
color: #bffcc6;
}
.links a:hover {
color: rgb(255, 54, 171);
}
.links a {
font-size: 30px;
color: rgb(255, 54, 171);
margin: 25px 10px;
}
.wrapper {
display: flex;
width: 100vh;
height: 100vh;
justify-content: center;
align-items: center;
padding: 0 10%;
overflow: hidden;
transform: translateX(150px);
}
.topline {
display: block;
position: relative;
font-size: 35px;
letter-spacing: 5px;
color: white;
}
.topline::after {
position: absolute;
content: "";
height: 4px;
width: 45px;
bottom: 10px;
background-color: rgb(255, 54, 171);
}
h1 {
display: block;
font-size: 5.5em;
font-weight: 900;
font-weight: 800;
color: rgb(255, 54, 171);
white-space: nowrap;
}
.textbtns {
font-size: 25px;
color: rgb(225, 54, 171);
margin: 25px 10px;
text-decoration: none;
box-sizing: border-box;
justify-content: space-between;
align-items: center;
border: none;
background-color: rgb(0, 0, 0);
border-color: rgb(0, 0, 0);
}
.textbtns:hover {
color: rgb(0, 0, 0);
background-color: rgb(255, 54, 171);
cursor: pointer;
}
.multiText {
color: #bffcc6;
text-transform: capitalize;
}
p {
display: block;
width: 90%;
font-size: 1.2em;
color: antiquewhite;
}
.btns {
width: 100vh;
position: relative;
left: 150px;
justify-content: space-between;
}
button {
outline: #382f4d solid;
border-radius: 2;
border: solid 1px;
cursor: pointer;
font-size: 20px;
font-weight: 400;
box-shadow: 0 6px 7px white;
}
.imgbox {
position: relative;
width: 100%;
height: 100%;
float: right;
}
.imgbox img {
position: relative;
height: 100%;
width: calc(130% - 100px);
top: -100px;
right: 50px;
float: right;
}
CodePen
I am fairly new to HTMl and CSS. I had my footer stuck to the bottom of the page no problem and then something changed and I cannot figure it out. When I go to a page without a lot of content the footer sits in the middle of the page. On pages with content, it works as it should. I have read countless other posts with the same issue and nothing seems to work. Using "position:fixed" makes the footer stuck to the bottom of the "viewport" not the page itself. Thus when I switch to another page with scrollable content, the footer shows itself behind the page content. I've tried adding "overflow:hidden", "bottom:0;", "left:0" and "right:0" to .main-footer and that doesn't fix it. I don't know what I'm missing. I have already spent a few hours looking up answers and trying to solve this issue.
*, *::before, *::after {
box-sizing: border-box;
font-family: 'Abel', sans-serif;
color: #777;
}
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
height: 100vh;
}
/* Styles for navigation menus */
nav ul {
margin: 0;
}
nav li{
display: inline-block;
}
nav a {
display: inline-flex;
padding: .5em;
margin-top: 5px;
margin-bottom: 5px;
color: white;
text-decoration: none;
transition: 350ms;
}
nav a:hover {
background-color: rgba(215, 200, 200, .3);
border-radius: 2px;
}
/*Style for MAIN navigation menu*/
.main-nav {
text-align: center;
font-size: 1.1em;
font-weight: lighter;
border-bottom: 1px solid rgba(215, 200, 200, .3);
}
.main-nav li {
padding: 0 5%;
}
.main-header {
background-image: url('headerfooterimages/headerpicture.jpg');
background-size: cover;
background-color: rgba(0, 0, 0, 0.5);
background-blend-mode: multiply;
padding-bottom: 25px;
border-bottom: 1px solid black;
}
/* Style for Page Title/Logo */
.titleLogo {
text-align: center;
margin: auto;
font-size: 4em;
font-family: 'Bebas Neue';
color: white;
}
.titleLogo-large {
font-size: 6em;
}
/*Styles for sections of content on page*/
.content-section {
margin: 1em;
padding: 2em;
}
.content-container {
max-width: 900px;
margin: 0 auto;
padding: 0 1.5em;
}
.section-header {
font-family: Impact;
font-weight: normal;
color: rgb(34, 34, 34);
}
/*Styling the footer for each page*/
.main-footer {
background-color: rgb(45, 45, 45);
padding: 5px;
position: relative;
bottom: 0;
width: 100vw;
height: 75px;
border-top: 1px solid black;
margin: auto;
}
.footer-text {
font-size: 25px;
color: rgba(128, 128, 128);
display: inline-flex;
}
.footer-text:hover {
text-shadow: 0px 0px 40px rgba(255, 255, 255, 0.75);
cursor: crosshair;
color:rgb(188, 188, 188);
}
.main-footer-container {
display: flex;
align-items: center;
}
.main-footer-container ul {
flex-grow: 1;
text-align: end;
}
/*Styling the social media links in the footer*/
.footer-nav li {
list-style: none;
display: inline-flex;
transition: 350ms;
}
.footer-nav img {
border-radius: 5px;
width: 30px;
height: 30px;
}
.footer-nav li:hover {
background-color: rgba(215, 200, 200, .3);
border-radius: 5px;
padding-left: 3px;
padding-right: 3px;
padding-top: 3px;
}
/*Styling buttons across the whole site*/
.btn {
background-color: #349aff;
border: none;
border-radius: 1em;
color: white;
padding: 8px 16px;
vertical-align: middle;
text-align: center;
text-decoration: none;
font-size: 8px;
font-weight: bold;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}
.btn:hover {
background-color: #2090ff;
cursor: pointer;
box-shadow: none;
}
/*Styling the cart menu option in the main navigation*/
.cart-container{
display: inline-flex;
margin: auto;
}
.cart-icon {
float: left;
clear: left;
height: 25px;
}
.cart-text {
display:inline-block;
color: white;
padding: 2px;
margin-top: 1px;
}
.cart-text:hover {
text-decoration: underline;
}
/*Styling shop items*/
.shop-item {
display: block;
margin: 50px;
}
.shop-item-image {
display: block;
margin: 10px;
height: 200px;
}
.shop-item-title {
display: block;
text-align: center;
width: 100%;
font-weight: bold;
font-size: 1.1em;
color: #333;
margin-bottom: 5px;
}
.shop-item-details {
display: flex;
align-items: center;
}
.shop-item-price {
display: block;
text-align: center;
color: #333;
width: 50%;
}
.shop-item-button {
display: block;
}
.shop-items {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
/*Styling the image carousel*/
.carousel {
width: 600px;
height: 400px;
position: relative;
display: flex;
}
.carousel > ul {
margin: 0px;
padding: 0px;
list-style: none;
}
.carousel-container {
margin: auto;
align-items: center;
}
/*Styling the buttons on the carousel*/
.carousel-button {
position: absolute;
padding: 0 .25rem;
z-index: 2;
background: none;
background-color: rgba(0, 0, 0, .1);
border: none;
border-radius: .25rem;
font-size: 2.5rem;
top: 50%;
transform: translateY(-120%);
color: rgba(255, 255, 255, .5);
cursor: pointer;
}
.carousel-button:hover, .carousel-button:focus {
color: white;
background-color: rgba(0, 0, 0, .2);
}
.carousel-button:focus {
outline: 1px solid black;
}
.carousel-button.prev {
left: 1rem;
}
.carousel-button.next {
right: 12rem;
}
/*Styling and formatting the next image effect for the image carousel*/
.slide {
position: absolute;
inset: 0;
opacity: 0;
object-fit: fill;
transition: 400ms opacity ease-in-out;
transition-delay: 200ms;
}
.slide > img {
display: inline-block;
width: 70%;
height: 80%;
border-radius: 10px;
object-fit: cover;
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.5);
}
.slide[data-active] {
opacity: 1;
z-index: 1;
transition-delay: 0ms;
}
<!DOCTYPE html>
<html lang = "enUS">
<head>
<title>Modern Style</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Abel&family=Bebas+Neue" rel="stylesheet">
<link rel="favicon" href="favicon.ico">
<link rel="stylesheet" href="stylesheet.css">
<script src="script.js" defer></script>
</head>
<body>
<header class="main-header">
<nav class="nav main-nav">
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>STORE</li>
<li class="cart-container"><a href="cart.html"><img class="cart-icon" src="headerfooterimages/cart.png" alt="A shopping cart icon">
<div class="cart-text">Shopping Cart</div></a></li>
</ul>
</nav>
<h1 class="titleLogo titleLogo-large">Modern Style Website</h1>
</header>
<section class="content-section content-container">
<h2 class="section-header">ABOUT</h2>
<p>
This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text.
This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text.
This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text.
This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text.
This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text.
This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text. This is placeholder text.
</p>
</section>
</body>
<footer class="main-footer">
<div class="main-footer-container">
<h2 class="footer-text">Modern Style Website</h2>
<ul class="nav footer-nav">
<li><img src="headerfooterimages/Facebook-Logo.png"></li>
<li><img src="headerfooterimages/Instagram-Logo.png"></li>
<li><img src="headerfooterimages/Twitter-Logo.png"></li>
</ul>
</div>
</footer>
</html>
Seeing as you have declared the body to be 100vh, you can utilize this empty space with margin-top: auto.
On main-footer, remove margin: auto and replace it with margin-top: auto. This way, it will convert the remaining space on the body element into a margin-top-value for the main-footer element.
On another note,
make sure to include the <footer>-element BEFORE your closing </body>-tag, the footer is supposed to be inside the <body>-element.
Also, in your CSS reset, I would consider adding margin: 0; to avoid white bars on your site.
Codepen (because the code snippet is so long): https://codepen.io/sigurdmazanti/pen/ZErJzEK
.main-footer {
background-color: rgb(45, 45, 45);
padding: 5px;
position: relative;
bottom: 0;
width: 100vw;
height: 75px;
border-top: 1px solid black;
/*margin: auto;*/
margin-top: auto;
}
just use this css code:
i have added multiple values to body and remove margin from footer
*, *::before, *::after {
box-sizing: border-box;
font-family: 'Abel', sans-serif;
color: #777;
}
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
min-height: 100vh;
flex-wrap: nowrap;
align-content: space-between;
justify-content: space-between;
align-items: stretch;
}
/* Styles for navigation menus */
nav ul {
margin: 0;
}
nav li{
display: inline-block;
}
nav a {
display: inline-flex;
padding: .5em;
margin-top: 5px;
margin-bottom: 5px;
color: white;
text-decoration: none;
transition: 350ms;
}
nav a:hover {
background-color: rgba(215, 200, 200, .3);
border-radius: 2px;
}
/*Style for MAIN navigation menu*/
.main-nav {
text-align: center;
font-size: 1.1em;
font-weight: lighter;
border-bottom: 1px solid rgba(215, 200, 200, .3);
}
.main-nav li {
padding: 0 5%;
}
.main-header {
background-image: url('headerfooterimages/headerpicture.jpg');
background-size: cover;
background-color: rgba(0, 0, 0, 0.5);
background-blend-mode: multiply;
padding-bottom: 25px;
border-bottom: 1px solid black;
}
/* Style for Page Title/Logo */
.titleLogo {
text-align: center;
margin: auto;
font-size: 4em;
font-family: 'Bebas Neue';
color: white;
}
.titleLogo-large {
font-size: 6em;
}
/*Styles for sections of content on page*/
.content-section {
margin: 1em;
padding: 2em;
}
.content-container {
max-width: 900px;
margin: 0 auto;
padding: 0 1.5em;
}
.section-header {
font-family: Impact;
font-weight: normal;
color: rgb(34, 34, 34);
}
/*Styling the footer for each page*/
.main-footer {
background-color: rgb(45, 45, 45);
padding: 5px;
position: relative;
bottom: 0;
width: 100vw;
height: 75px;
border-top: 1px solid black;
}
.footer-text {
font-size: 25px;
color: rgba(128, 128, 128);
display: inline-flex;
}
.footer-text:hover {
text-shadow: 0px 0px 40px rgba(255, 255, 255, 0.75);
cursor: crosshair;
color:rgb(188, 188, 188);
}
.main-footer-container {
display: flex;
align-items: center;
}
.main-footer-container ul {
flex-grow: 1;
text-align: end;
}
/*Styling the social media links in the footer*/
.footer-nav li {
list-style: none;
display: inline-flex;
transition: 350ms;
}
.footer-nav img {
border-radius: 5px;
width: 30px;
height: 30px;
}
.footer-nav li:hover {
background-color: rgba(215, 200, 200, .3);
border-radius: 5px;
padding-left: 3px;
padding-right: 3px;
padding-top: 3px;
}
/*Styling buttons across the whole site*/
.btn {
background-color: #349aff;
border: none;
border-radius: 1em;
color: white;
padding: 8px 16px;
vertical-align: middle;
text-align: center;
text-decoration: none;
font-size: 8px;
font-weight: bold;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}
.btn:hover {
background-color: #2090ff;
cursor: pointer;
box-shadow: none;
}
/*Styling the cart menu option in the main navigation*/
.cart-container{
display: inline-flex;
margin: auto;
}
.cart-icon {
float: left;
clear: left;
height: 25px;
}
.cart-text {
display:inline-block;
color: white;
padding: 2px;
margin-top: 1px;
}
.cart-text:hover {
text-decoration: underline;
}
/*Styling shop items*/
.shop-item {
display: block;
margin: 50px;
}
.shop-item-image {
display: block;
margin: 10px;
height: 200px;
}
.shop-item-title {
display: block;
text-align: center;
width: 100%;
font-weight: bold;
font-size: 1.1em;
color: #333;
margin-bottom: 5px;
}
.shop-item-details {
display: flex;
align-items: center;
}
.shop-item-price {
display: block;
text-align: center;
color: #333;
width: 50%;
}
.shop-item-button {
display: block;
}
.shop-items {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
/*Styling the image carousel*/
.carousel {
width: 600px;
height: 400px;
position: relative;
display: flex;
}
.carousel > ul {
margin: 0px;
padding: 0px;
list-style: none;
}
.carousel-container {
margin: auto;
align-items: center;
}
/*Styling the buttons on the carousel*/
.carousel-button {
position: absolute;
padding: 0 .25rem;
z-index: 2;
background: none;
background-color: rgba(0, 0, 0, .1);
border: none;
border-radius: .25rem;
font-size: 2.5rem;
top: 50%;
transform: translateY(-120%);
color: rgba(255, 255, 255, .5);
cursor: pointer;
}
.carousel-button:hover, .carousel-button:focus {
color: white;
background-color: rgba(0, 0, 0, .2);
}
.carousel-button:focus {
outline: 1px solid black;
}
.carousel-button.prev {
left: 1rem;
}
.carousel-button.next {
right: 12rem;
}
/*Styling and formatting the next image effect for the image carousel*/
.slide {
position: absolute;
inset: 0;
opacity: 0;
object-fit: fill;
transition: 400ms opacity ease-in-out;
transition-delay: 200ms;
}
.slide > img {
display: inline-block;
width: 70%;
height: 80%;
border-radius: 10px;
object-fit: cover;
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.5);
}
.slide[data-active] {
opacity: 1;
z-index: 1;
transition-delay: 0ms;
}
Use this CSS. It will also top align your content-section. I fixed horizontal scroll as well. Just make sure to keep your website content inside of body tags. Your footer was outside of the body tag.
*, *::before, *::after {
box-sizing: border-box;
font-family: 'Abel', sans-serif;
color: #777;
}
body {
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Styles for navigation menus */
nav ul {
margin: 0;
}
nav li{
display: inline-block;
}
nav a {
display: inline-flex;
padding: .5em;
margin-top: 5px;
margin-bottom: 5px;
color: white;
text-decoration: none;
transition: 350ms;
}
nav a:hover {
background-color: rgba(215, 200, 200, .3);
border-radius: 2px;
}
/*Style for MAIN navigation menu*/
.main-nav {
text-align: center;
font-size: 1.1em;
font-weight: lighter;
border-bottom: 1px solid rgba(215, 200, 200, .3);
}
.main-nav li {
padding: 0 5%;
}
.main-header {
background-image: url('headerfooterimages/headerpicture.jpg');
background-size: cover;
background-color: rgba(0, 0, 0, 0.5);
background-blend-mode: multiply;
padding-bottom: 25px;
border-bottom: 1px solid black;
}
/* Style for Page Title/Logo */
.titleLogo {
text-align: center;
margin: auto;
font-size: 4em;
font-family: 'Bebas Neue';
color: white;
}
.titleLogo-large {
font-size: 6em;
}
/*Styles for sections of content on page*/
.content-section {
margin: 1em;
padding: 2em;
width: 100%;
box-sizing: border-box;
position: relative;
flex-grow: 1;
}
.content-container {
max-width: 900px;
margin: 0 auto;
padding: 0 1.5em;
box-sizing: border-box;
}
.section-header {
font-family: Impact;
font-weight: normal;
color: rgb(34, 34, 34);
}
/*Styling the footer for each page*/
.main-footer {
background-color: rgb(45, 45, 45);
padding: 5px;
position: relative;
bottom: 0;
width: 100%;
height: 75px;
border-top: 1px solid black;
margin: auto;
}
.footer-text {
font-size: 25px;
color: rgba(128, 128, 128);
display: inline-flex;
}
.footer-text:hover {
text-shadow: 0px 0px 40px rgba(255, 255, 255, 0.75);
cursor: crosshair;
color:rgb(188, 188, 188);
}
.main-footer-container {
display: flex;
align-items: center;
}
.main-footer-container ul {
flex-grow: 1;
text-align: end;
}
/*Styling the social media links in the footer*/
.footer-nav li {
list-style: none;
display: inline-flex;
transition: 350ms;
}
.footer-nav img {
border-radius: 5px;
width: 30px;
height: 30px;
}
.footer-nav li:hover {
background-color: rgba(215, 200, 200, .3);
border-radius: 5px;
padding-left: 3px;
padding-right: 3px;
padding-top: 3px;
}
/*Styling buttons across the whole site*/
.btn {
background-color: #349aff;
border: none;
border-radius: 1em;
color: white;
padding: 8px 16px;
vertical-align: middle;
text-align: center;
text-decoration: none;
font-size: 8px;
font-weight: bold;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}
.btn:hover {
background-color: #2090ff;
cursor: pointer;
box-shadow: none;
}
/*Styling the cart menu option in the main navigation*/
.cart-container{
display: inline-flex;
margin: auto;
}
.cart-icon {
float: left;
clear: left;
height: 25px;
}
.cart-text {
display:inline-block;
color: white;
padding: 2px;
margin-top: 1px;
}
.cart-text:hover {
text-decoration: underline;
}
/*Styling shop items*/
.shop-item {
display: block;
margin: 50px;
}
.shop-item-image {
display: block;
margin: 10px;
height: 200px;
}
.shop-item-title {
display: block;
text-align: center;
width: 100%;
font-weight: bold;
font-size: 1.1em;
color: #333;
margin-bottom: 5px;
}
.shop-item-details {
display: flex;
align-items: center;
}
.shop-item-price {
display: block;
text-align: center;
color: #333;
width: 50%;
}
.shop-item-button {
display: block;
}
.shop-items {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
/*Styling the image carousel*/
.carousel {
width: 600px;
height: 400px;
position: relative;
display: flex;
}
.carousel > ul {
margin: 0px;
padding: 0px;
list-style: none;
}
.carousel-container {
margin: auto;
align-items: center;
}
/*Styling the buttons on the carousel*/
.carousel-button {
position: absolute;
padding: 0 .25rem;
z-index: 2;
background: none;
background-color: rgba(0, 0, 0, .1);
border: none;
border-radius: .25rem;
font-size: 2.5rem;
top: 50%;
transform: translateY(-120%);
color: rgba(255, 255, 255, .5);
cursor: pointer;
}
.carousel-button:hover, .carousel-button:focus {
color: white;
background-color: rgba(0, 0, 0, .2);
}
.carousel-button:focus {
outline: 1px solid black;
}
.carousel-button.prev {
left: 1rem;
}
.carousel-button.next {
right: 12rem;
}
/*Styling and formatting the next image effect for the image carousel*/
.slide {
position: absolute;
inset: 0;
opacity: 0;
object-fit: fill;
transition: 400ms opacity ease-in-out;
transition-delay: 200ms;
}
.slide > img {
display: inline-block;
width: 70%;
height: 80%;
border-radius: 10px;
object-fit: cover;
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.5);
}
.slide[data-active] {
opacity: 1;
z-index: 1;
transition-delay: 0ms;
}
So i was just finishing building my first full site (with html and css), and in the video it was missing a portfolio page, i created one watching a video of a cool image grid i founded, but the grid keeps getting cut off. (Thats not the full html code, i deleted the other pages that are correct) Full image
body {
font-family: "Open Sans", sans-serif;
background-color: #040404;
color: #fff;
position: relative;
background: transparent;
}
body::before {
content: "";
position: fixed;
background: #040404 url("../../assets/img/background.jpg") top right no-repeat;
background-size: cover;
left: 0;
right: 0;
top: 0;
height: 100vh;
z-index: -1;
}
a {
color: #18d26e;
}
a:hover {
color: #35e888;
text-decoration: none;
}
h1, h2, h3, h4, h5, h6 {
font-family: "Raleway", sans-serif;
}
#header {
transition: ease-in-out 0.3s;
position: relative;
height: 100vh;
display: flex;
align-items: center;
z-index: 997;
overflow-y: auto;
}
#header * {
transition: ease-in-out 0.3s;
}
#header h1 {
font-size: 48px;
margin: 0;
padding: 0;
line-height: 1;
font-weight: 700;
font-family: "Poppins", sans-serif;
}
#header h1 a, #header h1 a:hover {
color: #fff;
line-height: 1;
display: inline-block;
}
#header h2 {
font-size: 24px;
margin-top: 20px;
color: rgba(255, 255, 255, 0.8);
}
#header h2 span {
color: #fff;
border-bottom: 2px solid #18d26e;
padding-bottom: 6px;
}
#header img {
padding: 0;
margin: 0;
}
#header .social-links {
margin-top: 40px;
display: flex;
}
#header .social-links a {
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.1);
color: #fff;
line-height: 1;
margin-right: 8px;
border-radius: 50%;
width: 40px;
height: 40px;
}
#header .social-links a:hover {
background: #18d26e;
}
#media (max-width: 992px) {
#header h1 {
font-size: 36px;
}
#header h2 {
font-size: 20px;
line-height: 30px;
}
#header .social-links {
margin-top: 15px;
}
#header .container {
display: flex;
flex-direction: column;
align-items: center;
}
}
.nav-menu {
margin-top: -450px;
margin-left: 70%;
}
.nav-menu ul {
display: flex;
margin: 0;
padding: 0;
list-style: none;
}
.nav-menu li + li {
margin-left: 30px;
}
.nav-menu a {
display: block;
position: relative;
color: rgba(255, 255, 255, 0.7);
font-size: 16px;
font-family: "Poppins", sans-serif;
font-weight: 400;
}
.nav-menu a:before {
content: "";
position: absolute;
width: 0;
height: 2px;
bottom: -4px;
left: 0;
background-color: #18d26e;
visibility: hidden;
width: 0px;
transition: all 0.3s ease-in-out 0s;
}
.nav-menu a:hover:before, .nav-menu li:hover > a:before, .nav-menu .active > a:before {
visibility: visible;
width: 25px;
}
.nav-menu a:hover, .nav-menu .active > a, .nav-menu li:hover > a {
color: #fff;
text-decoration: none;
}
.mobile-nav-toggle {
position: fixed;
right: 15px;
top: 15px;
z-index: 9998;
border: 0;
background: none;
font-size: 24px;
transition: all 0.4s;
outline: none !important;
line-height: 1;
cursor: pointer;
text-align: right;
}
.mobile-nav-toggle i {
color: #fff;
}
.mobile-nav {
position: fixed;
top: 55px;
right: 15px;
bottom: 15px;
left: 15px;
z-index: 9999;
overflow-y: auto;
background: rgba(0, 0, 0, 0.7);
transition: ease-in-out 0.2s;
opacity: 0;
visibility: hidden;
border-radius: 10px;
padding: 10px 0;
border: 2px solid rgba(255, 255, 255, 0.12);
}
.mobile-nav * {
margin: 0;
padding: 0;
list-style: none;
}
.mobile-nav a {
display: block;
position: relative;
color: #fff;
padding: 10px 20px;
font-weight: 500;
outline: none;
}
.mobile-nav a:hover, .mobile-nav .active > a, .mobile-nav li:hover > a {
color: #18d26e;
text-decoration: none;
}
.mobile-nav-overly {
width: 100%;
height: 100%;
z-index: 9997;
top: 0;
left: 0;
position: fixed;
background: rgba(9, 9, 9, 0.6);
overflow: hidden;
display: none;
transition: ease-in-out 0.2s;
}
.mobile-nav-active {
overflow: hidden;
}
.mobile-nav-active .mobile-nav {
opacity: 1;
visibility: visible;
}
.mobile-nav-active .mobile-nav-toggle i {
color: #fff;
}
/* Header Top */
#header.header-top {
height: 80px;
position: fixed;
left: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.9);
}
#header.header-top .social-links, #header.header-top h2 {
display: none;
}
#header.header-top h1 {
margin-right: auto;
font-size: 36px;
}
#header.header-top .container {
display: flex;
align-items: center;
}
#header.header-top .nav-menu {
margin: 0;
}
#media (max-width: 768px) {
#header.header-top {
height: 60px;
}
#header.header-top h1 {
font-size: 26px;
}
}
section {
overflow: hidden;
position: absolute;
width: 100%;
top: 140px;
bottom: 100%;
opacity: 0;
transition: ease-in-out 0.4s;
z-index: 2;
}
section.section-show {
top: 100px;
bottom: auto;
opacity: 1;
padding-bottom: 45px;
}
section .container {
background: rgba(0, 0, 0, 0.9);
padding: 30px;
}
#media (max-width: 1080px) {
section {
top: 120px;
}
section.section-show {
top: 80px;
}
}
.section-title h2 {
font-size: 14px;
font-weight: 500;
padding: 0;
line-height: 1px;
margin: 0 0 20px 0;
letter-spacing: 2px;
text-transform: uppercase;
color: #aaaaaa;
font-family: "Poppins", sans-serif;
}
.section-title h2::after {
content: "";
width: 120px;
height: 1px;
display: inline-block;
background: #4ceb95;
margin: 4px 10px;
}
.section-title p {
margin: 0;
margin: -15px 0 15px 0;
font-size: 36px;
font-weight: 700;
text-transform: uppercase;
font-family: "Poppins", sans-serif;
color: #fff;
}
.about-me .content h3 {
font-weight: 700;
font-size: 26px;
color: #18d26e;
}
.about-me .content ul {
list-style: none;
padding: 0;
}
.about-me .content ul li {
padding-bottom: 10px;
}
.about-me .content ul i {
font-size: 20px;
padding-right: 2px;
color: #18d26e;
}
.about-me .content p:last-child {
margin-bottom: 0;
}
.counts {
padding: 70px 0 60px;
}
.counts .count-box {
padding: 30px 30px 25px 30px;
width: 100%;
position: relative;
text-align: center;
background: rgba(255, 255, 255, 0.08);
}
.counts .count-box i {
position: absolute;
top: -25px;
left: 50%;
transform: translateX(-50%);
font-size: 24px;
background: rgba(255, 255, 255, 0.1);
padding: 12px;
color: #18d26e;
border-radius: 50px;
}
.counts .count-box span {
font-size: 36px;
display: block;
font-weight: 600;
color: #fff;
}
.counts .count-box p {
padding: 0;
margin: 0;
font-family: "Raleway", sans-serif;
font-size: 14px;
}
.skills .progress {
height: 50px;
display: block;
background: none;
}
.skills .progress .skill {
padding: 10px 0;
margin: 0 0 6px 0;
text-transform: uppercase;
display: block;
font-weight: 600;
font-family: "Poppins", sans-serif;
color: #fff;
}
.skills .progress .skill .val {
float: right;
font-style: normal;
}
.skills .progress-bar-wrap {
background: rgba(255, 255, 255, 0.15);
}
.skills .progress-bar {
width: 1px;
height: 10px;
transition: .9s;
background-color: #18d26e;
}
.interests .icon-box {
display: flex;
align-items: center;
padding: 20px;
background: rgba(255, 255, 255, 0.08);
transition: ease-in-out 0.3s;
}
.interests .icon-box i {
font-size: 32px;
padding-right: 10px;
line-height: 1;
}
.interests .icon-box h3 {
font-weight: 700;
margin: 0;
padding: 0;
line-height: 1;
font-size: 16px;
color: #fff;
}
.interests .icon-box:hover {
background: rgba(255, 255, 255, 0.12);
}
.testimonials .testimonial-item {
box-sizing: content-box;
min-height: 320px;
}
.testimonials .testimonial-item .testimonial-img {
width: 90px;
border-radius: 50%;
margin: -40px 0 0 40px;
position: relative;
z-index: 2;
border: 6px solid rgba(255, 255, 255, 0.12);
}
.testimonials .testimonial-item h3 {
font-size: 18px;
font-weight: bold;
margin: 10px 0 5px 45px;
color: #fff;
}
.testimonials .testimonial-item h4 {
font-size: 14px;
color: #999;
margin: 0 0 0 45px;
}
.testimonials .testimonial-item .quote-icon-left, .testimonials .testimonial-item .quote-icon-right {
color: rgba(255, 255, 255, 0.25);
font-size: 26px;
}
.testimonials .testimonial-item .quote-icon-left {
display: inline-block;
left: -5px;
position: relative;
}
.testimonials .testimonial-item .quote-icon-right {
display: inline-block;
right: -5px;
position: relative;
top: 10px;
}
.testimonials .testimonial-item p {
font-style: italic;
margin: 0 15px 0 15px;
padding: 20px 20px 60px 20px;
background: rgba(255, 255, 255, 0.1);
position: relative;
border-radius: 6px;
position: relative;
z-index: 1;
}
.testimonials .owl-nav, .testimonials .owl-dots {
margin-top: 5px;
text-align: center;
}
.testimonials .owl-dot {
display: inline-block;
margin: 0 5px;
width: 12px;
height: 12px;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.3) !important;
}
.testimonials .owl-dot.active {
background-color: #18d26e !important;
}
#media (max-width: 767px) {
.testimonials {
margin: 30px 10px;
}
}
.honeycomb
{
display: flex;
flex-wrap: wrap;
list-style: none;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding-bottom: 10px;
transform: translateY(80px);
}
.honeycomb-cell
{
-webkit-box-flex: 0;
flex: 0 1 250px;
max-width: 250px;
height: 137.5px;
margin: 65.4px 12.5px 25px;
position: relative;
padding: 0.5em;
text-align: center;
z-index: 1;
box-shadow: 0px 0px 15px 0 rgba(0,0,0,0.1);
}
.honeycomb-cell_img
{
object-fit: cover;
object-position: center;
filter: grayscale(100%);
}
.honeycomb-cell_title
{
height: 100%;
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
-webkit-box-pack: center;
justify-content: center;
-webkit-hyphens: auto;
hyphens: auto;
word-break: break-word;
text-transform: uppercase;
color: #fff;
font-weight: 700;
font-size: 1.75em;
transition: opacity 350ms;
}
.honeycomb-cell_title > small
{
font-weight: 300;
margin-top: 0.25em;
}
.honeycomb-cell::before,
.honeycomb-cell::after
{
content: '';
}
.honeycomb-cell::before,
.honeycomb-cell::after,
.honeycomb-cell_img
{
top: -50%;
left: 0;
width: 100%;
height: 200%;
display: block;
position: absolute;
-webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
z-index: -1;
}
.honeycomb-cell::before
{
background: #fff;
transform: scale(1.055);
}
.honeycomb-cell::after
{
background: #111111;
opacity: 0.7;
transition: opacity 350ms;
-webkit-transition: opacity 350ms;
}
.honeycomb-cell:hover
.honeycomb-cell_title
{
opacity: 0;
}
.honeycomb-cell:hover
.honeycomb-cell_img
{
filter: grayscale(0%);
}
.honeycomb-cell:hover::before
{
background: #18d26e;
}
.honeycomb-cell:hover::after
{
opacity: 0;
}
.honeycomb_Hidden
{
display: none;
opacity: 0;
width: 250px;
margin: 0 12.5px;
}
#media (max-width: 550px)
{
.honeycomb-cell
{
margin: 81.25px 25px;
}
}
#media (min-width: 550px) and (max-width: 1080px)
{
.honeycomb-cell:nth-child(3n)
{
margin-right: calc(50% - 125px);
margin-left: calc(50% - 125px);
}
.honeycomb_Hidden:nth-child(3n + 5)
{
display: block;
}
}
#media (min-width: 825px) and (max-width: 1100px) {
.honeycomb-cell:nth-child(5n + 4)
{
margin-left: calc(50% - 275px);
}
.honeycomb-cell:nth-child(5n + 5)
{
margin-right: calc(50% - 275px);
}
.honeycomb_Hidden:nth-child(5n),
.honeycomb_Hidden:nth-child(5n + 3)
{
display: block;
}
}
#media (min-width: 1100px)
{
.honeycomb-cell:nth-child(7n + 5) {
margin-left: calc(50% - 400px);
}
.honeycomb-cell:nth-child(7n + 7),
.honeycomb-cell:nth-child(7n + 5):nth-last-child(2)
{
margin-right: calc(50% - 400px);
}
.honeycomb_Hidden:nth-child(7n + 7),
.honeycomb_Hidden:nth-child(7n + 9),
.honeycomb_Hidden:nth-child(7n + 11)
{
display: block;
}
}
.services .icon-box {
text-align: center;
background: rgba(204, 204, 204, 0.1);
padding: 80px 20px;
transition: all ease-in-out 0.3s;
}
.services .icon-box .icon {
margin: 0 auto;
width: 64px;
height: 64px;
background: #18d26e;
border-radius: 5px;
transition: all .3s ease-out 0s;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
transform-style: preserve-3d;
}
.services .icon-box .icon i {
color: #fff;
font-size: 28px;
}
.services .icon-box .icon::before {
position: absolute;
content: '';
left: -8px;
top: -8px;
height: 100%;
width: 100%;
background: rgba(255, 255, 255, 0.15);
border-radius: 5px;
transition: all .3s ease-out 0s;
transform: translateZ(-1px);
}
.services .icon-box h4 {
font-weight: 700;
margin-bottom: 15px;
font-size: 24px;
}
.services .icon-box h4 a {
color: #fff;
}
.services .icon-box p {
line-height: 24px;
font-size: 14px;
margin-bottom: 0;
}
.services .icon-box:hover {
background: #18d26e;
border-color: #18d26e;
}
.services .icon-box:hover .icon {
background: #fff;
}
.services .icon-box:hover .icon i {
color: #b2c2b9;
}
.services .icon-box:hover .icon::before {
background: #35e888;
}
.services .icon-box:hover h4 a, .services .icon-box:hover p {
color: #fff;
}
#-webkit-keyframes animate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#keyframes animate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.credits {
position: fixed;
right: 0;
left: 0;
bottom: 0;
padding: 15px;
text-align: right;
font-size: 13px;
color: #fff;
z-index: 999999;
}
#media (max-width: 992px) {
.credits {
text-align: center;
padding: 10px;
background: rgba(0, 0, 0, 0.8);
}
}
.credits a {
color: #18d26e;
transition: 0.3s;
}
.credits a:hover {
color: #fff;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Rodrigo C. Programmer</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon/favicon.ico" rel="icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
<link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
<link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="header-tops">
<div class="container">
<h1>Rodrigo Carrard</h1>
<h2>Apenas um <span>Programador</span> do Brasil</h2>
<div class="social-links">
<i class="icofont-instagram"></i>
</div>
<nav class="nav-menu d-none d-lg-block">
<ul>
<li class="active">Home</li>
<li>About</li>
<li>Portfolio</li>
<li>Services</li>
<li>Contact</li>
</ul>
</nav><!-- .nav-menu -->
</div>
</header><!-- End Header -->
<!-- ======= Portfolio Section ====== -->
<section id="portfolio" class="portfolio">
<div class="container">
<div class="section-title">
<h2>Portfolio</h2>
<p>Meus projetos</p>
</div>
<ul class="honeycomb">
<li class="honeycomb-cell">
<img class="honeycomb-cell_img" src="assets/img/LogoRc.png">
<div class="honeycomb-cell_title">R.C Portfolio</div>
</li>
<li class="honeycomb-cell">
<img class="honeycomb-cell_img" src="assets/img/clientes/diceshield.png">
<div class="honeycomb-cell_title">Party Buddy</div>
</li>
<li class="honeycomb-cell honeycomb_Hidden">
</li>
</ul>
</div>
</section>
<!-- ======= Services Section ======= -->
<section id="services" class="services">
<div class="container">
<div class="section-title">
<h2>Services</h2>
<p>Meus serviços</p>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 d-flex align-items-stretch">
<div class="icon-box">
<div class="icon"><i class="bx bxl-dribbble"></i></div>
<h4>Desenvolvimento de site</h4>
<p>Farei seu site do utilizando Html / Css / JavaScript / Php </p>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 mt-md-0">
<div class="icon-box">
<div class="icon"><i class="bx bx-file"></i></div>
<h4>Wordpress Site</h4>
<p>Desenvolverei seu site profissional ultilizando o Wordpress</p>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 mt-lg-0">
<div class="icon-box">
<div class="icon"><i class="bx bx-tachometer"></i></div>
<h4>Criação de aplicativos Mobile</h4>
<p>Desenvolverei seu aplicativo mobile com base no seu pedido</p>
</div>
</div>
</div>
</div>
</section><!-- End Services Section -->
<!-- ======= Contact Section ======= -->
<section id="contact" class="contact">
<div class="container">
<div class="section-title">
<h2>Contact</h2>
<p>Meu contato</p>
</div>
<div class="row mt-2">
<div class="col-md-6 d-flex align-items-stretch">
<div class="info-box">
<i class="bx bx-map"></i>
<h3>Endereço</h3>
<p>Itapema, Meia Praia, SC, Brasil</p>
</div>
</div>
<div class="col-md-6 mt-4 mt-md-0 d-flex align-items-stretch">
<div class="info-box">
<i class="bx bx-share-alt"></i>
<h3>Social Profiles</h3>
<div class="social-links">
<i class="icofont-instagram"></i>
</div>
</div>
</div>
<div class="col-md-6 mt-4 d-flex align-items-stretch">
<div class="info-box">
<i class="bx bx-envelope"></i>
<h3>Meu email</h3>
<p>rodrigocarrard.pessoal#gmail.com</p>
</div>
</div>
<div class="col-md-6 mt-4 d-flex align-items-stretch">
<div class="info-box">
<i class="bx bx-phone-call"></i>
<h3>Telefone</h3>
<p>Ainda não disponivel</p>
</div>
</div>
</div>
<form action="forms/contact.php" method="post" role="form" class="php-email-form mt-4">
<div class="form-row">
<div class="col-md-6 form-group">
<input type="text" name="name" class="form-control" id="name" placeholder="Your Name" data-rule="minlen:4" data-msg="Please enter at least 4 chars" />
<div class="validate"></div>
</div>
<div class="col-md-6 form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your Email" data-rule="email" data-msg="Please enter a valid email" />
<div class="validate"></div>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" data-rule="minlen:4" data-msg="Please enter at least 8 chars of subject" />
<div class="validate"></div>
</div>
<div class="form-group">
<textarea class="form-control" name="message" rows="5" data-rule="required" data-msg="Please write something for us" placeholder="Message"></textarea>
<div class="validate"></div>
</div>
<div class="mb-3">
<div class="loading">Loading</div>
<div class="error-message"></div>
<div class="sent-message">Your message has been sent. Thank you!</div>
</div>
<div class="text-center"><button type="submit">Send Message</button></div>
</form>
</div>
</section>
<!-- Vendor JS Files -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<script src="assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="assets/vendor/counterup/counterup.min.js"></script>
<script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/venobox/venobox.min.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>
You can replace this for your body styling
body{
position:relative;
z-index:1;
color:#070707;
}
body::before{
content:"";
width:100vw;
height:100vh;
background-image: url("https://i.stack.imgur.com/ILQso.png");
background-repeat:no-repeat;
background-size:cover;
background-position:center center;
background-attachment:fixed;
position:absolute;
z-index:-1;
}
I have positioned the body relative and body::before pseudo element position absolute and made it go at the back of the body using z-index for it to appear as a background. Try out this implemetation. For the Image I have used an online image url
In CSS #lang-dropdown-button:focus should set pointer-events: all in #router-list , but it seems it doesn't work. The anchor doesn't navigate to the German on the dropdown. Why is that so?
*{
margin: 0px;
padding: 0px;
border:none;
}
body {
background-image: url(assets/bg.png);
background-repeat: no-repeat;
background-attachment: fixed;
}
#header {
width: 94%;
height: 50px;
border-radius: 34px;
margin: 35px 3% 0px;
background-color: rgb(255, 255, 255);
display: flex;
justify-content: space-between;
background-size: cover;
filter: drop-shadow(0px 4px 20px rgba(0, 0, 0, 0.1));
position: relative;
z-index: 100;
}
#body {
width: 94%;
height: 1000px;
margin: 35px 3% 35px;
border-radius: 25px;
background-color: rgb(255, 255, 255);
filter: drop-shadow(0px 4px 20px rgba(0, 0, 0, 0.1));
}
#logo {
align-self: center;
height: 70px;
width: 70px;
border-radius: 14px;
background-size: cover;
cursor: pointer;
}
#cont1 {
display: flex;
align-self: center;
}
#cont2 {
align-self: center;
}
#lang-dropdown {
height: fit-content;
width: fit-content;
flex-direction: column;
display: flex;
margin-right: 20px;
border-radius: 15px;
}
#elipse {
height: 10px;
width: 10px;
border-radius: 100%;
align-self: center;
background-color: #333333;
}
#title {
align-self: center;
margin-left: 10px;
display: flex;
flex-direction: row;
}
#privacy {
margin-left: 14px;
font-family: Ubuntu-Md;
font-style: normal;
line-height: 1;
font-size: 18px;
position: absolute;
align-self: center;
color: #333333;
}
#lang {
font-family: Ubuntu-Md;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
align-self: center;
color: #333333;
}
#text-container {
padding: 0px;
}
#policy-date {
font-family: Ubuntu;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
align-self: center;
color: #838383;
margin-top: 10px;
padding-left: 3.5%;
padding-bottom: 10px;
}
#text1 {
font-family: Ubuntu-Md;
font-style: normal;
font-weight: bold;
font-size: 28px;
align-self: center;
color: #333333;
padding: 3% 3% 0px;
}
#body-header {
width: 100%;
/* border-bottom: #d6d6d6 solid 1px; */
}
#globe {
color: #333333;
margin-left: 3px;
width: 25px;
height: 25px;
}
#arrow {
color: #333333;
margin-left: 1px;
margin-top: 1px;
align-self: center;
}
#lang-dropdown-button {
height: fit-content;
width: fit-content;
justify-content: space-around;
flex-direction: row;
display: flex;
background-color: rgba(255, 255, 255, 0);
cursor: pointer;
border-radius: 15px;
transition: all 0.6s ease;
width: 110px;
}
#router-list ul {
position: absolute;
background-color: #E7E7E7;
display: flex;
justify-content: space-around;
flex-direction: column;
align-items: center;
height: 35px;
width: 110px;
border-radius: 0px 0px 15px 15px;
}
#router-list li {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
transition: all 0.4s ease;
}
#last {
border-radius: 0px 0px 15px 15px;
}
#router-list {
position: relative;
z-index: 50;
opacity: 0;
transform: translateY(-10px);
transition: all 0.4s ease;
pointer-events: none;
}
#last #lang-btn {
padding-bottom: 8px;
}
#router-list li:hover {
background-color: #d4d1d1;
border-radius: 0px;
}
#router-list #last:hover {
background-color: #d4d1d1;
border-radius: inherit;
}
/* #lang-dropdown-button:focus + #lang-dropdown{
border-radius: 15px 15px 0px 0px;
} */
#lang-dropdown-button:focus {
outline: none;
background-color: #E7E7E7;
border-radius: 15px 15px 0px 0px;
}
#lang-dropdown-button:focus + #router-list {
opacity: 1;
pointer-events: all;
z-index: 200;
transform: translateY(0px);
}
#lang-dropdown-button:hover{
background-color: #d4d1d1;
}
#lang-btn {
background-color: rgba(255, 255, 255, 0);
width: 100%;
height: 100%;
font-family: Ubuntu-Md;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
text-decoration: none;
color: #333333;
display: flex;
justify-content: center;
align-items: center;
}
#lang-btn:hover {
cursor: pointer;
}
#font-face {
font-family: "Ubuntu-md";
src: url("assets/Ubuntu-Medium.ttf");
}
#font-face {
font-family: "Ubuntu";
src: url("assets/Ubuntu-Regular.ttf");
}
#media only screen and (max-width: 370px){
#privacy {
margin-right: 127px;
font-size: 16px;
}
#text1 {
font-size: 24px;
}
}
#media only screen and (max-width: 620px){
#text1 {
padding: 5% 5% 0px;
}
#policy-date {
padding: 0% 6% 10px;
}
}
#media only screen and (max-width: 325px){
#text1 {
padding: 6% 6% 0px;
}
#policy-date {
padding: 0% 7% 10px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style_v2.css" rel="stylesheet"/>
<title>Document</title>
</head>
<body>
<div id="header">
<div id="cont1">
<img id="logo" src="assets/logo.png" >
<div id ="title"><div id="elipse"></div> <div id="privacy">Privacy Policy</div> </div>
</div>
<div id="cont2">
<div id="lang-dropdown">
<button id="lang-dropdown-button" data-toggle="dropdown" >
<img id="arrow" src="assets/keyboard_arrow_down-24px 1.svg"/>
<div id="lang">English</div>
<img id="globe" src="assets/globe-24px.svg"/>
</button>
<div id="router-list" >
<ul>
<li id="last">Deutsch</li>
</ul>
</div>
</div>
</div>
</div>
<div id="box"></div>
<div id="body">
<div id="text-container">
<div id="body-header">
<div id="text1">title</div>
<div id="policy-date">Effective Date: m d, y</div>
</div>
<div></div>
</div>
</div>
</body>
</html>
i believe it has something to do with the hierarchy of the css combinators
https://www.w3schools.com/css/css_combinators.asp
i couldn't get it work either.. maybe because the combinator is acting on the div... but the links are actually li's inside a ul. thats just a guess tho.
I did however find you a work around. Switch to visibility:hidden instead of pointer-events. i tested it in VS code
it solves your hidden link being clickable thing
#router-list {
position: relative;
top: 20px;
z-index: 50;
opacity: 0;
transform: translateY(-10px);
transition: all 0.4s ease;
visibility: hidden;
/* pointer-events: none; */
}
#lang-dropdown-button:focus + #router-list {
opacity: 1;
/* pointer-events: all; */
visibility: visible;
z-index: 200;
transform: translateY(0px);
}
Just Change the
pointer-events: none; to pointer-events: all;
I'm trying to create a small website and want to place an image (logo, square, svg) in the navbar. I want the logo to fit the navbar but it simply just won't scale no matter what I try.
I've tried floating a div with the image to the left and the navbar to the right but it still won't scale. It's really frustrating.
Here's an image of the problem:
Here's my code (sorry it's messy):
#import url('https://fonts.googleapis.com/css?family=Montserrat');
.heading {
display: inline-block;
font-family: "Montserrat";
font-weight: lighter;
text-align: left;
margin-left: 20vw;
line-height: 30vw;
}
body {
width: 100%;
margin: auto;
font-family: 'Montserrat', sans-serif;
background-color: white;
}
.container {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
margin-top: 30px;
flex-flow: row wrap;
margin-top: -10vw;
}
img {
margin: 9px;
transition: filter 0.2s;
filter: brightness(100%);
display: inline-block;
min-height: 100px;
height: 50vh;
}
img:hover {
filter: brightness(80%);
}
.responsive:hover {}
header {
position: relative;
height: 50vh;
background-image: linear-gradient(rgb(50, 50, 50), rgb(30, 30, 30));
margin-top: -20px;
transform: skewY(-5deg);
transform-origin: top left;
}
.fullwidth {
width: 100%;
}
.headertitle {
margin-top: -36vh;
margin-left: 12vw;
position: absolute;
font-size: calc(13px + 2.5vw);
color: white;
font-family: 'Montserrat';
font-weight: lighter;
}
/* navbar */
nav {
background: rgb(52, 52, 52);
position: relative;
z-index: 1;
height: calc(18px + 6vh);
box-shadow: 0 3px 3px -1px rgba(0, 0, 0, 0.065);
overflow: auto;
width: 100vw;
}
nav ul {
margin: 0;
padding: 0;
text-align: left;
margin-left: 1.2vw;
}
nav ul li {
display: inline-block;
list-style: none;
font-size: 1.2em;
padding: 1vh;
}
.navul a {
text-decoration: none;
color: white;
line-height: 5.5vh;
height: 5.5vh;
font-size: calc(15px + 0.25vh + 0.15vw);
}
.navuul a:visited,
a:link,
a:active {
text-decoration: none;
color: white;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
.navuul a:hover {
text-decoration: none;
color: grey;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
.submit {
float: right;
margin-right: 1.5vw;
}
.submit a {
color: white;
border-radius: 5px;
}
.navimg img {
max-width: 100%;
max-height: 20%;
}
.navimgdiv {
height: 1.5vh;
}
/* navbar end */
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="pgallerystyles.css">
<title> Photo Gallery </title>
<link rel="shortcut icon" href="logo.ico">
</head>
<body>
<div class="fullwidth">
</div>
<nav>
<ul class="navul">
<li>
<div class="navimgdiv"><img class="navimg" src="logo.svg"></div>Lumastock</li>
<li>Photos</li>
<li>Featured</li>
<li>Contact</li>
<li>Pricing</li>
<li>Assesment Requirements</li>
<li class="submit">Submit a photo</li>
</ul>
</nav>
<header>
</header>
<h1 class="headertitle">Image Gallery</h1>
Thanks!
Simply use the logo outside of the list. I have added max-width for logo image. Optionally padding and margin you can customize based on your requirement. I hope this solution will be helpful.
.heading {
display: inline-block;
font-family: "Montserrat";
font-weight: lighter;
text-align: left;
margin-left: 20vw;
line-height: 30vw;
}
body {
width: 100%;
margin: auto;
font-family: 'Montserrat', sans-serif;
background-color: white;
}
.container {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
margin-top: 30px;
flex-flow: row wrap;
margin-top: -10vw;
}
img {
/* margin: 9px;
transition: filter 0.2s;
filter: brightness(100%);
display: inline-block;
min-height: 100px;
height: 50vh; */
max-width: 100%;
}
img:hover {
filter: brightness(80%);
}
.responsive:hover {}
header {
position: relative;
height: 50vh;
background-image: linear-gradient(rgb(50, 50, 50), rgb(30, 30, 30));
margin-top: -20px;
transform: skewY(-5deg);
transform-origin: top left;
}
.fullwidth {
width: 100%;
}
.headertitle {
margin-top: -36vh;
margin-left: 12vw;
position: absolute;
font-size: calc(13px + 2.5vw);
color: white;
font-family: 'Montserrat';
font-weight: lighter;
}
/* navbar */
nav {
background: rgb(52, 52, 52);
position: relative;
z-index: 1;
height: calc(40px + 6vh);
box-shadow: 0 3px 3px -1px rgba(0, 0, 0, 0.065);
overflow: auto;
width: 100vw;
display: flex;
}
nav ul {
margin: 0;
padding: 0;
text-align: left;
margin-left: 1.2vw;
}
nav ul li {
display: inline-block;
list-style: none;
font-size: 1.2em;
padding: 1vh;
}
.navul a {
text-decoration: none;
color: white;
line-height: 5.5vh;
height: 5.5vh;
font-size: calc(15px + 0.25vh + 0.15vw);
}
.navuul a:visited,
a:link,
a:active {
text-decoration: none;
color: white;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
.navuul a:hover {
text-decoration: none;
color: grey;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
.submit {
float: right;
margin-right: 1.5vw;
}
.submit a {
color: white;
border-radius: 5px;
}
.navimgdiv img {
max-width: 50px;
}
.navimgdiv {
padding: 5px 0;
}
<div class="fullwidth"></div>
<nav>
<a class="navimgdiv"><img src="https://cdn.worldvectorlogo.com/logos/react.svg"></a>
<ul class="navul">
<li>Lumastock</li>
<li>Photos</li>
<li>Featured</li>
<li>Contact</li>
<li>Pricing</li>
<li>Assesment Requirements</li>
<li class="submit">Submit a photo</li>
</ul>
</nav>
<header></header>
<h1 class="headertitle">Image Gallery</h1>