Edrol97
Bronze Coder
Hi all, I have problems with a nav bar on a word game I've made. Currently the page is in two columns- one larger than the other. How do I ensure the nav bar is at the top of the page? Full code below and a screenshot of how it looks in practice.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Politicordle</title>
<link rel="stylesheet" href="words.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div class="sunnavigationbar">
<a href="Hi.html">Hi</a>
<a href="about_me.html">Bio</a>
<a href="Art.html">Show-Off</a>
<a href="cv.html">CV</a>
<a href="Inspa.html">Inspa</a>
<a href="Games.html">Play</a>
</div>
<br />
<br />
<div class="wrapper">
<h1>Guess the Word</h1>
<div class="content">
<input type="text" class="typing-input" maxlength="1" />
<div class="inputs"></div>
<div class="details">
<p class="hint">Hint: <span></span></p>
<p class="guess-left">Remaining guesses: <span></span></p>
<p class="wrong-letter">Wrong letters: <span></span></p>
</div>
<button class="reset-btn">Reset Game</button>
</div>
</div>
<script src="words.js"></script>
<script src="wordsl.js"></script>
</body>
</html>
CSS:
@font-face {
font-family: Eliot Lord;
src: url(Fonts/Eliothand2-Regular.otf);
}
body {
display: flex;
padding: 0 10px;
min-height: 100vh;
align-items: center;
justify-content: center;
font-family: Eliot Lord;
cursor: url(img/background/cursors/Mouse%20cursor.png),
url(img/background/cursors/pointer1.png), pointer;
}
.sunnavigationbar {
background-color: #ec1801;
padding: 20px 20px 20px;
font-family: Helvetica;
font-weight: 100;
text-decoration: none;
}
.sunnavigationbar a {
font-family: Helvetica;
font-size: 2.6dvw;
color: white;
padding: 10px;
text-decoration: none;
display: inline-block;
}
header .sunnavigationbar a:hover {
font-family: Helvetica;
color: white;
padding: 10px;
font-weight: 900;
font-size: 2.6dvw;
float: none;
text-decoration: none;
display: inline-block;
background-image: url(img/background/Underline%20White.png);
background-repeat: no-repeat;
background-size: 100% 20%;
background-position: 0px 85%;
}
:hover {
cursor: url(img/background/cursors/pointer1.png);
}
p {
font-size: 80px;
}
.wrapper {
width: 100%;
background: #fff;
border-radius: 10px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0);
}
.wrapper h1 {
font-size: 25px;
font-weight: 500;
padding: 20px 25px;
}
.wrapper .content {
margin: 25px 25px 35px;
}
.content .inputs {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.inputs input {
font-family: Eliot Lord;
height: 57px;
width: 56px;
margin: 4px;
font-size: 24px;
font-weight: 500;
color: white;
text-align: center;
outline: none;
background: url(img/background/Politicordle%20right.png) no-repeat left top;
pointer-events: none;
border: white;
background-size: 100% 100%;
text-transform: uppercase;
}
.typing-input {
opacity: 0;
z-index: -999;
position: absolute;
pointer-events: none;
}
.inputs input:first-child {
margin-left: 0px;
}
.content .details {
margin: 20px 0 25px;
}
.details p {
font-size: 30px;
margin-bottom: 10px;
}
.content .reset-btn {
font-family: Eliot Lord;
width: 100%;
border: none;
cursor: pointer;
color: #fff;
outline: none;
padding: 15px 0;
font-size: 17px;
border-radius: 5px;
background: black;
transition: all 0.3s ease;
}
.content .reset-btn:hover {
background: #18a589;
}
@media screen and (max-width: 460px) {
.wrapper {
width: 100%;
}
.wrapper h1 {
font-size: 22px;
padding: 16px 20px;
}
.wrapper .content {
margin: 25px 20px 35px;
}
.inputs input {
height: 51px;
width: 50px;
margin: 3px;
font-size: 22px;
}
.details p {
font-size: 17px;
}
.content .reset-btn {
padding: 14px 0;
font-size: 16px;
}
}
Attachments
Last edited: