'How do I remove the blank space on the right side of my website?
I am having trouble removing the blank space on the right side of my website and I am really not sure where the error is. I can't really pinpoint when this happened exactly, I think it's when I padded the text next to the animation square. Here's an image of my website with blank space on the right side
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
document.getElementById("navbar").style.padding = "30px 10px";
document.getElementById("logo").style.fontSize = "25px";
} else {
document.getElementById("navbar").style.padding = "30px 10px";
document.getElementById("logo").style.fontSize = "35px";
}
}
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
body {
margin: 0;
font-family: 'Carter One', cursive;
background-color:#1B1D37;
}
* {
box-sizing: border-box;
}
h1 {
font-weight: normal;
}
a {
text-decoration: none;
font-weight: bold;
background: linear-gradient(135deg, rgba(43,171,217,1) 0%, rgba(0,130,200,1) 100%);
-webkit-background-clip: text;
color: transparent;
}
.box {
padding:150px 150px 2500px;
font-size:30px
}
.card {
position: absolute;
background-color: #F8F8F8;
border-radius: 1.5em;
min-width: 400px;
max-width: 1170px;
width: 30%;
padding: 2.6em 3.8em;
cursor: pointer;
top: 50%;
transform: translate(-50%, -50%);
left: 40%;
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1),
0 8px 8px rgba(0, 0, 0, 0.1),
0 16px 16px rgba(0, 0, 0, 0.1),
0 32px 32px rgba(0, 0, 0, 0.15),
0 64px 64px rgba(0, 0, 0, 0.15);
}
.note::after {
content: '';
width: 20%;
height: 2px;
border-radius: 999px;
background-color: #AFAFAF;
background: linear-gradient(135deg, rgba(43,171,217,1) 0%, rgba(0,130,200,1) 100%);
position: absolute;
top: -1.8em;
left: 0;
}
.note {
font-size: 0.8em;
color: #8A8A8A;
position: relative;
margin-top: 4em;
}
/* Scroller styling */
.scroller {
height: 1.2em;
line-height: 1.2em;
position: relative;
overflow: hidden;
width: 10em;
}
.scroller > span {
position: absolute;
top: 0;
animation: slide 5s infinite;
font-weight: bold;
}
@keyframes slide {
0% {
top: 0;
}
25% {
top: -1.2em;
}
50% {
top: -2.4em;
}
75% {
top: -3.6em;
}
}
.Colortxt {
color: white;
}
.hero-image {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../image/OUTSIDER.png");
filter: blur(8px);
webkit-filter: blur(8px);
height: 70%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
top:25%
}
.hero-text {
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0, 0.4); /* Black w/opacity/see-through */
color: white;
font-weight: bold;
border: 3px solid #f1f1f1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
width: 80%;
padding: 20px;
text-align: center;
}
#navbar {
overflow: hidden;
background-color: #151626;
padding: 90px 10px;
transition: 0.4s;
position: fixed;
width: 100%;
top: 0;
z-index: 99;
border-bottom: 3px solid white;
}
#navbar a {
float: left;
color: white;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-bottom: 3px solid white;
}
#navbar #logo {
font-size: 35px;
font-weight: bold;
transition: 0.4s;
}
#navbar a:hover {
background-color: #ddd;
color: black;
}
#navbar a.active {
background-color: black;
color: white;
}
#navbar-right {
float: right;
}
@media screen and (max-width: 580px) {
#navbar {
padding: 20px 10px !important;
}
#navbar a {
float: none;
display: block;
text-align: left;
}
#navbar-right {
float: none;
}
}
.txtdescriptor {
color: white;
}
<html>
<head>
<meta charset="UTF-8">
<title>We are artists.</title>
<link rel="stylesheet" href="css/stylez.css">
<link href="https://fonts.googleapis.com/css2?family=Carter+One&display=swap" rel="stylesheet">
<script src="js/java1.js"></script>
</head>
<body>
<div id="navbar">
<a href="#default" id="logo">Unlikely Duo.</a>
<div id="navbar-right">
<a class="active" href="#home">Home</a>
<a href="#contact">Our Works</a>
<a href="#how">Method</a>
<a href="#about">About</a>
</div>
</div>
<div class="hero-image">
</div>
<div class="hero-text">
<h1 style="font-size:50px">We are artists.</h1>
<h2>Visuals and sound.</h2>
</div>
<div style="position:relative; right:300px; top:400px;">
<div class="card">
<h1>We do
<div class="scroller">
<span>
Art<br/>
Music<br/>
Albums<br/>
Concepts<br/>
</span>
</div>
</div>
</div>
<div style="position:relative; left: 790px; top:300px;"
<div class="txtdescriptor">
<h2> We're a duo of arts and sound. <br/>We specialize from anything to concept art to making songs for your <br/>project.</h2>
</div>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
