im working in my final proyect to become a Web Developer, and im struggling with my footer, that is creating a minimum horizontal scroll and I cant find why.
I've been doing tests and I can't get rid of that horizontal scroll. An answer as soon as possible would be of great help to me, since this is my final project.
footer {
position: absolute;
bottom: 100;
left: 0;
right: 0;
background: #111;
height: auto;
width: 100%;
padding-top: 40px;
color: #fff;
}
.footer-content {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
h3 {
font-size: 2rem;
font-weight: 500;
text-transform: capitalize;
line-height: 4rem;
color: yellow;
}
}
.socials {
list-style: none;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
li {
margin: 0 0px;
}
a {
text-decoration: none;
color: #fff;
padding: 5px;
&:hover {
color: rgb(255, 251, 0);
transition-duration: 1s;
}
}
}
.footer-bottom {
background: #000;
width: 100%;
padding: 20px;
padding-bottom: 40px;
text-align: center;
p {
display: flex;
justify-content: flex-start;
font-size: 14px;
word-spacing: 2px;
text-transform: capitalize;
a {
color: yellow;
font-size: 16px;
text-decoration: none;
}
}
}
#media (max-width: 830px) {
.socials li {
font-size: 14px;
}
}
<footer>
<div class="footer-content">
<h3>KURT BURGERS</h3>
<ul class="socials">
<li>DEFENSA AL CONSUMIDOR</li>
<li>DELIVERY</li>
<li>POLITICAS DE PRIVACIDAD</li>
</ul>
</div>
<div class="footer-bottom">
<p>copyright © KURT BURGERS </p>
</div>
</footer>
I copied your code and removed the width:100% from .footer-bottom the horizontal scroll disappeared.
The reason why you get the scrollbar is because footer-bottom's width is 100% + the 20px padding you have set for each side of the element. If you add padding to an element with a width, the padding will be added on top of the width unless you set box-sizing: border-box;
You could add border-box to footer-bottom as a solution but what you should really do is remove the width 100% from footer-bottom because it is a block element already and it will take up the 100% width by default so there is no need to set it.
The same thing applies to the ul .socials, it has natural padding on the tag so when you set width 100% to it, it will be wider than 100%. In the case of this ul, I simply added padding: 0
In the below snippet, I have removed the width 100% from footer-bottom and I added some minor css to body so it is easier to see your content width.
body,
html {
padding: 0;
margin: 0;
}
footer {
position: absolute;
bottom: 100;
left: 0;
right: 0;
background: #111;
height: auto;
width: 100%;
padding-top: 40px;
color: #fff;
}
.footer-content {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
}
.footer-content h3 {
font-size: 2rem;
font-weight: 500;
text-transform: capitalize;
line-height: 4rem;
color: yellow;
}
.socials {
list-style: none;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 0;
}
.socials li {
margin: 0 0px;
}
.socials a {
text-decoration: none;
color: #fff;
padding: 5px;
}
.footer-bottom {
background: #000;
padding: 20px;
padding-bottom: 40px;
text-align: center;
p {
display: flex;
justify-content: flex-start;
font-size: 14px;
word-spacing: 2px;
text-transform: capitalize;
a {
color: yellow;
font-size: 16px;
text-decoration: none;
}
}
}
#media (max-width: 830px) {
.socials li {
font-size: 14px;
}
}
<footer>
<div class="footer-content">
<h3>KURT BURGERS</h3>
<ul class="socials">
<li>DEFENSA AL CONSUMIDOR</li>
<li>DELIVERY</li>
<li>POLITICAS DE PRIVACIDAD</li>
</ul>
</div>
<div class="footer-bottom">
<p>copyright © KURT BURGERS </p>
</div>
</footer>
You are missing this from your styles:
* {
box-sizing: border-box;
}
Related
Looked up hover effects on navigation bars on YouTube and copied the code but when I try to click the elements on the navigation bar, it won't work. The cursor also doesn't change. It looks and operates just like another text.
This is the video I used: https://www.youtube.com/watch?v=1wfeqDyMUx4
Is there something wrong with my code?
#import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Work+Sans:wght#400;500;700&display=swap');* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Work Sans', sans-serif;
}
body {
min-height: 100vh;
background: linear-gradient(#98c9cd 3%, #e6c3c1 60%, #e4989e 100% )
}
header {
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 20px 100px;
display: flex;
justify-content: space-between;
align-items: center;
}
header .logo
{
color: white;
font-weight: 700;
text-decoration: none;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
}
header ul {
display: flex;
justify-content: center;
align-items: center;
}
header ul li {
list-style: none;
margin-left: 20px;
}
header ul li a {
text-decoration: none;
padding: 6px 15px;
color: white;
border-radius: 20px;
}
header ul li a:hover,
header ul li a.active {
background: white;
color: #2b1055;
}
section {
position: relative;
width: 100%;
height: 100vh;
padding: 100px;
display: flex;
justify-content: center;
align-items: center;
}
section::before {
content: '';
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
background: linear-gradient(to top,#e4989e,transparent);
z-index: 1290;
}
#text {
font-family: 'Fjalla One', sans-serif;
mix-blend-mode: screen;
position: absolute;
color: white;
white-space: nowrap;
text-align: center;
font-size: 7.5.vw;
font-size: 4em;
z-index: 9;
}
#btn {
text-decoration: none;
display: inline-block;
padding: 8px 30px;
border-radius: 40px;
background: white;
color: #2b1055;
font-size: 1.5em;
transform: translateY(100px);
}
.sec {
position: relative;
padding: 100px;
background: #e4989e;
}
.sec h2 {
font-size: 2em;
margin-bottom: 10px;
color: white;
font-weight: 700;
}
p #text1 {
color: #fff;
font-weight: 400;
font-size: 1.5em;
}
<!doctype HTML>
<html>
<head>
<title>Comfort Crate</title>
<link rel="stylesheet" type="text/css" href="styles1.css">
</head>
<body>
<header>
<img src="finallogo.png" width="10%" height="18%" style="margin-top: 20px;">
<ul>
<li>Home</li>
<li>About</li>
<li>Creations</li>
<li>Contact</li>
</ul>
</header>
<section>
<h2 id="text">WELCOME TO COMFORT CRATE!</h2>
Click Here
</section>
<div class="sec">
<h2>About us</h2>
<p id="text1" style="color: white;"">Comfort Crate is a start-up company founded in 2022 by seven students from 12-Dubins of Pasig City Science High School. The notion of entrepreneurs and consumers as mutual benefactors inspired the team to come up with potential products that will make self-care worth spending, guilt-free. Driven by the desire to uplift people’s spirits amidst adversities, each set from Comfort Crate was curated for all people in all situations. The group believes that money cannot buy happiness, but it can buy you a crate that can help you stir up your own happiness.
<br><br></p>
</div>
</body>
</html>
It's because section tag fills the whole page and the header stucks under it. So your mouse always hovers on section. You can see that by adding z-index: 9999; to header.
when using position: absolute, your header element will share the space with its other siblings like normally it would. I would suggest that you add margin top to the section element to that it would get out of the way of the header.
#import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Work+Sans:wght#400;500;700&display=swap');* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Work Sans', sans-serif;
}
body {
min-height: 100vh;
background: linear-gradient(#98c9cd 3%, #e6c3c1 60%, #e4989e 100% )
}
header {
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 20px 100px;
display: flex;
justify-content: space-between;
align-items: center;
}
header .logo
{
color: white;
font-weight: 700;
text-decoration: none;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
}
header ul {
display: flex;
justify-content: center;
align-items: center;
}
header ul li {
list-style: none;
margin-left: 20px;
}
header ul li a {
text-decoration: none;
padding: 6px 15px;
color: white;
border-radius: 20px;
}
header ul li a:hover,
header ul li a.active {
background: white;
color: #2b1055;
}
section {
margin-top: 100px;
position: relative;
width: 100%;
height: 100vh;
padding: 50px 100px 100px;
display: flex;
justify-content: center;
align-items: center;
}
section::before {
content: '';
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
background: linear-gradient(to top,#e4989e,transparent);
z-index: 1290;
}
#text {
font-family: 'Fjalla One', sans-serif;
mix-blend-mode: screen;
position: absolute;
color: white;
white-space: nowrap;
text-align: center;
font-size: 7.5.vw;
font-size: 4em;
z-index: 9;
}
#btn {
text-decoration: none;
display: inline-block;
padding: 8px 30px;
border-radius: 40px;
background: white;
color: #2b1055;
font-size: 1.5em;
transform: translateY(100px);
}
.sec {
position: relative;
padding: 100px;
background: #e4989e;
}
.sec h2 {
font-size: 2em;
margin-bottom: 10px;
color: white;
font-weight: 700;
}
p #text1 {
color: #fff;
font-weight: 400;
font-size: 1.5em;
}
<!doctype HTML>
<html>
<head>
<title>Comfort Crate</title>
<link rel="stylesheet" type="text/css" href="styles1.css">
</head>
<body>
<header>
<img src="finallogo.png" width="10%" height="18%" style="margin-top: 20px;">
<ul>
<li>Home</li>
<li>About</li>
<li>Creations</li>
<li>Contact</li>
</ul>
</header>
<section>
<h2 id="text">WELCOME TO COMFORT CRATE!</h2>
Click Here
</section>
<div class="sec">
<h2>About us</h2>
<p id="text1" style="color: white;"">Comfort Crate is a start-up company founded in 2022 by seven students from 12-Dubins of Pasig City Science High School. The notion of entrepreneurs and consumers as mutual benefactors inspired the team to come up with potential products that will make self-care worth spending, guilt-free. Driven by the desire to uplift people’s spirits amidst adversities, each set from Comfort Crate was curated for all people in all situations. The group believes that money cannot buy happiness, but it can buy you a crate that can help you stir up your own happiness.
<br><br></p>
</div>
</body>
</html>
I'm trying to write the code for a fitness supplement webshop, and as I am making the navigation bar, this weird problem has come up. The unordered list is neither aligned vertically nor horizontally.
HTML:
<div class="menus">
<ul menuList>
<li>SUPPLEMENTER</li>
<li>ACCESSORIES</li>
<li>TØJ</li>
<li>ANDET</li>
</ul>
</div>
CSS:
.menus {
background-color: #00C9FF;
height: 42px;
width: 100%;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
justify-content: center;
bottom: 0%;
}
.menus ul li {
list-style: none;
padding-left: 50px;
padding-right: 50px;
}
.menus ul {
display: flex;
flex-direction: row;
margin-top: auto;
}
.menus ul li a {
font-weight: 800;
font-style: italic;
font-size: 30pt;
text-decoration: none;
color: white;
}
If you needed this:
body {
margin: 0;
}
.menus {
background-color: #00C9FF;
height: 50px;
width: 100%;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
justify-content: center;
bottom: 0%;
}
.menus ul li {
list-style: none;
padding-left: 50px;
padding-right: 50px;
}
.menus ul {
display: flex;
flex-direction: row;
margin-top: auto;
}
.menus ul li a {
font-weight: 800;
font-style: italic;
font-size: 30pt;
text-decoration: none;
color: white;
}
<div class="menus">
<ul menuList>
<li>SUPPLEMENTER</li>
<li>ACCESSORIES</li>
<li>TØJ</li>
<li>ANDET</li>
</ul>
</div>
Then the body margin was not set to 0 and the navbar needed a little bit more of height.
And yes... that code is not responsive.
right now the purple just covers the text but it should be a nice block of colour like the dropdown is. Also, I have a bar under my nav img that should not be there when I hover. I know it is a width/height thing, but no matter where I put the code it does not work.
https://codepen.io/Smoki248/pen/NWxrOWK
li {
list-style: none;
}
a {
color: #f2f2f2;
text-decoration: none;
}
a:hover {
background-color: #8781bd;
}
.container {
max-width: 100%;
width: 100%;
margin: 0 auto;
text-align: center;
}
.btn {
padding: 0 20px;
height: 40px;
font-size: 1em;
font-weight: 400;
font-family: "Amatic SC", Roboto, sans-serif;
border: 1px #8781bd solid;
border-radius: 2px;
background: #8781bd;
color: #f2f2f2;
cursor: pointer;
}
.grid {
display: flex;
}
header {
position: fixed;
top: 0;
min-height: 75px;
padding: 0px 0px;
display: flex;
align-items: center;
background-color: #2f2f2f;
}
#media (max-width: 600px) {
header {
flex-wrap: wrap;
}
}
.logo {
width: 60vw;
}
#media (max-width:650px) {
.logo {
margin-top: 15px;
width: 100%;
position: relative;
}
}
.logo > img {
width: 100%;
height: 100%;
max-width: 100px;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin-left: 20px;
}
#media (max-width: 650px) {
.logo > img {
margin: 0 auto;
}
}
nav {
font-weight: 400;
}
#media (max-width: 650px) {
nav {
margin-top: 10px;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 0 50px;
}
}
h1 {
font-family: "Amatic SC", Raleway, Roboto, sans-serif;
font-size: 35pt;
width: 100%;
text-align: center;
}
h2 {
font-family: "Amatic SC", Raleway, Roboto, sans-serif;
font-size: 24pt;
width: 100%;
text-align: center;
}
nav li {
padding-bottom: 30px 0px;
}
nav > ul {
width: 30vw;
display: flex;
flex-direction: row;
justify-content: space-around;
}
#media (max-width: 650px) {
nav > ul {
flex-direction: column;
}
}
.dropdown > li{
float: right;
overflow: hidden;
}
.dropdown > li a {
font-size: 16px;
border: none;
outline: none;
color: #f4f4f4;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
nav > li a:hover, .dropdown:hover a {
background-color: #8781bd;
color:#f4f4f4;
}
.dropdown-content {
display: none;
position: absolute;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
color: #f4f4f4;
z-index: 1;
margin-top: 20px;
min-width: 100px;
}
.dropdown-content li a {
float: none;
color: #f4f4f4;
padding: 10px 14px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content li a:hover {
background-color: #625aa9;
color: #f4f4f4;
}
.dropdown:hover .dropdown-content {
display: block;
}
<header id="page-wrapper">
<header id="header">
<div class="logo">
<nav>
<a href="http://www.wrecklessdevelopment.com"><img id="header-img"
src="images/wreckless-development-logo.gif" alt="Wreckless Development Logo"/></a>
</nav>
</div>
<h1>Wreckless Development</h1>
<nav id="navbar">
<ul>
<li>About</li>
<li>Services</li>
<div class="dropdown">
<li><i class="fa fa-caret-down"></i> Portfolio<li>
<div class="dropdown-content">
<ul>
<li>Photography</li>
<li>Composite</li>
<li>Logos</li>
<li>Branding</li>
<li>Advertising</li>
</ul>
</div>
</div>
<li>Contact</li>
<li>Blog</li>
</ul>
</nav>
</header>
</header>
The problem is tag a's default display is inline, so if you want to adjust height of a tag, you have to change it's default display to display: inline-block like this, and then you may be able to do whatever you want with that a tag, you can refer my code below for more details:
#header a {
display: inline-block; // change display style
height: 75px;
line-height: 75px; // center the text
padding-left: 12px;
padding-right: 12px;
}
.dropdown > li > a {
padding: 0 16px; // no need to padding top and bottom because we already had line-height and height
}
.dropdown-content{
margin-top: 75px; // push the .dropdown-content further to fit new css
}
#header .dropdown-content li a{
display: block; // set an <a> tag to full with of the dropdown
height: auto;
line-height: 16px; // center the text with current font-size
}
you can take a look in my codepen.io for more details here. Hope it will help
I have one regular box and I wish the text to float above it and resize the text's font size appropriately.
This is what I have done: https://jsfiddle.net/a87uo3t2/
#import url('https://fonts.googleapis.com/css?family=Share+Tech+Mono');
body {
margin: 0 auto;
overflow: hidden;
}
#content {
width: 100%;
height: 2527px;
background-image: url('../images/wallpaper.jpg');
}
#menu-container,
#button-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 30%;
height: 40%;
border: 1px line #ccc;
background-color: #ffffff;
background-image: url('../images/brick-wall.png');
box-shadow: 0 0 3em #ccc;
}
#button-container {
border: none;
box-shadow: none;
}
.button-sub-container {
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
h1 {
position: relative;
bottom: 120px;
left: 6px;
text-align: center;
font-family: 'Share Tech Mono', monospace;
font-size: 5vw;
text-transform: uppercase;
text-decoration: none;
letter-spacing: 15px;
}
/*BUTTONS*/
.main-button {
text-decoration: none;
font-family: 'Share Tech Mono', monospace;
font-size: 35px;
margin: 15px;
color: #000;
letter-spacing: 5px;
text-transform: uppercase;
transition: letter-spacing 0.5s, color 0.8s;
}
.main-button:hover {
letter-spacing: 15px;
color: red;
}
.main-button:active {
letter-spacing: 2px;
color: blue;
}
<div id="content">
<div id="menu-container">
<h1>welcome</h1>
<div id="button-container" class="button-sub-container">
<a class="main-button" href="about.html">about</a>
<a class="main-button" href="projects.html">projects</a>
<a class="main-button" href="contact.html">contact</a>
</div>
</div>
As you can see I have tried setting it on top by positioning it relatively yet this means upon resizing it shifts, I can fix this by using vw as font size to a point, since if one would have a very wide monitor, it would go over my small menu-container.
Side-Note: don't bring attention to the buttons-text breaking out of the box, I have a a media-key to fix that
A solution with flexbox
and changing only the font-size of the box
#import url('https://fonts.googleapis.com/css?family=Share+Tech+Mono');
html,
body {
height: 100%;
}
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
.box {
font-family: 'Share Tech Mono', monospace;
max-width: 50%;
text-align: center;
/* Change to your needs */
font-size: 20px;
}
.box h1 {
text-transform: uppercase;
margin-top: 0;
}
.box ul {
list-style: none;
margin: 0;
padding: 15px;
border: 1px line #ccc;
background-color: #ffffff;
background-image: url('../images/brick-wall.png');
box-shadow: 0 0 3em #ccc;
}
.box a {
text-decoration: none;
color: #000;
text-transform: uppercase;
white-space: nowrap;
transition: letter-spacing 0.5s, color 0.8s;
}
.box a:hover {
letter-spacing: 3px;
color: red;
}
/* Change to your needs */
#media screen and (min-width: 600px) {
.box {
font-size: 20px;
}
}
/* Change to your needs */
#media screen and (min-width: 1200px) {
.box {
font-size: 30px;
}
}
<div class="box">
<h1>Heading</h1>
<!-- It's a list -->
<ul>
<li>Site 1</li>
<li>Site 2</li>
<li>Site 3</li>
</ul>
</div>
I want to left align text in a drop-down menu but I'm having some problems. I have this HTML
<nav>
<a>Vote</a>
<a>Search</a>
<a>About</a>
</nav>
and this CSS for the drop down menu
nav {
display: none;
width: 30rem;
padding: 0rem;
background-color: red;
position: absolute;
right: 0%;
top: 100%;
text-align: left;
}
.nav-open {
display: block;
}
nav a {
display: block;
width: 100%;
text-align: left;
padding: 1.4rem 1.6rem;
text-decoration: none;
cursor: pointer;
font-size: 1.2rem;
color: #000;
}
But as you can see, when you click the menu icon the text isn't even visible. Interestingly, when I change:
text-align: left;
to
text-align: center;
I can see the text again, but it is not aligned where i want it. How do I left align my text and keep it visible?
$('.menu-btn').click(function() {
$('nav').toggleClass('nav-open');
});
style* {
margin: 0 auto;
font-family: sans-serif;
}
body {
margin: 0 auto;
font-family: Benton Sans, -apple-system, BlinkMacSystemFont, Roboto, Helvetica Neue, Helvetica, Tahoma, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
}
header {
width: 100%;
background-color: orange;
text-align: center;
position: relative;
}
#pageTitle {
display: flex;
padding: 10px;
}
#pageTitle h2 {
justify-content: center;
/* align horizontal */
align-items: center;
width: 95%;
}
.menu-btn {
position: absolute;
display: inline-block;
cursor: pointer;
}
.menu-btn div {
position: absolute;
left: 100%;
top: 0%;
padding-right: 8px;
margin-top: -0.50em;
line-height: 1.2;
font-weight: 200;
vertical-align: middle;
z-index: 99;
}
.menu-btn span {
display: block;
width: 20px;
height: 2px;
margin: 4px 0;
background: #989da1;
z-index: 99;
}
nav {
display: none;
width: 30rem;
padding: 0rem;
background-color: red;
position: absolute;
right: 0%;
top: 100%;
text-align: left;
}
.nav-open {
display: block;
}
nav a {
display: block;
width: 100%;
text-align: left;
padding: 1.4rem 1.6rem;
text-decoration: none;
cursor: pointer;
font-size: 1.2rem;
color: #000;
}
nav a:hover {
background-color: #111;
color: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<header>
<div id="pageTitle">
<h2>Page Title</h2>
<div class="mobile-nav">
<button class="menu-btn" id="menu-btn">
<div></div>
<span></span>
<span></span>
<span></span>
</button>
<nav>
<a>Vote</a>
<a>Search</a>
<a>About</a>
</nav>
</div>
</div>
</header>
The problem comes from the rem unit you are using when giving width to your nav. You should use vw viewport width. This is relative from the screen width going from 0 to 100 turning the viewport width into a percentage.
Hope this helps
$('.menu-btn').click(function() {
$('nav').toggleClass('nav-open');
});
style* {
margin: 0 auto;
font-family: sans-serif;
}
body {
margin: 0 auto;
font-family: Benton Sans, -apple-system, BlinkMacSystemFont, Roboto, Helvetica Neue, Helvetica, Tahoma, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
}
header {
width: 100%;
background-color: orange;
text-align: center;
position: relative;
}
#pageTitle {
display: flex;
padding: 10px;
}
#pageTitle h2 {
justify-content: center;
/* align horizontal */
align-items: center;
width: 95%;
}
.menu-btn {
position: absolute;
display: inline-block;
cursor: pointer;
}
.menu-btn div {
position: absolute;
left: 100%;
top: 0%;
padding-right: 8px;
margin-top: -0.50em;
line-height: 1.2;
font-weight: 200;
vertical-align: middle;
z-index: 99;
}
.menu-btn span {
display: block;
width: 20px;
height: 2px;
margin: 4px 0;
background: #989da1;
z-index: 99;
}
nav {
display: none;
width: 100vw;
padding: 0rem;
background-color: red;
position: absolute;
right: 0%;
top: 100%;
text-align: left;
}
.nav-open {
display: block;
}
nav a {
display: block;
width: 100%;
text-align: left;
padding: 1.4rem 1.6rem;
text-decoration: none;
cursor: pointer;
font-size: 1.2rem;
color: #000;
}
nav a:hover {
background-color: #111;
color: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<header>
<div id="pageTitle">
<h2>Page Title</h2>
<div class="mobile-nav">
<button class="menu-btn" id="menu-btn">
<div></div>
<span></span>
<span></span>
<span></span>
</button>
<nav>
<a>Vote</a>
<a>Search</a>
<a>About</a>
</nav>
</div>
</div>
</header>
As others have pointed out already, the text is actually aligned left, but your screen size might prevent it from showing up due to the big width of your menu.
Try changing the width of your nav element to something relative to the page width, like 80%:
nav {
display: none;
width: 80%;
padding: 0rem;
background-color: red;
position: absolute;
right: 0%;
top: 100%;
text-align: left;
}
https://jsfiddle.net/1y8n08aq/1/