I'm currently building an HTML web page and encountering an issue with the header. It seems that the header is wider than my screen size, resulting in a horizontal scroll bar appearing. I've tried some solutions, but none of them seem to work. Any insights on why this might be happening?
Here's the code for my header:
<header>
<!--NAV BAR-->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top elegant-color-dark">
<div class="container-fluid">
<!-- NAV BRAND-->
<a class="navbar-brand" href="index.html">
<img src="http://eprticher.mx/images/tich.gif" height="30" class="d-inline-block align-top mr-2" alt="">
TICHER | Seguridad Privada
</a>
<div class="navbar-nav navbar-right">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">Inicio</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Servicios</a>
<div class="dropdown-menu dropdown-primary" aria-labelledby="dropMenu">
<a class="dropdown-item" href="servicios_seguridad.html">Servicios Seguridad</a>
<a class="dropdown-item" href="tranp_ejecutiva.html">Transporte Ejecutivo</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="quienes_somos.html">¿Quienes Somos?</a>
</li>
<li class="nav-item">
<a class="nav-link" href="porque_elegirnos.html">¿Porqué Elegirnos?</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contactanos.html">Contáctanos</a>
</li>
</ul>
</div>
</div>
</nav>
And here's the CSS code related to the header:
body {
background-color: #ffffff;
padding-top: 60px;
}
header {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box;
}
.sizeAdj img {
width: auto;
height: 500px;
max-height: 500px;
}
.img-resp {
width: 100%;
}
/* More CSS styles... */
The Header CSS modification was one solution I attempted, but unfortunately, it doesn't seem to be effective...
When incorporating the header into another HTML file, I follow this structure:
<!DOCTYPE html>
<html lang="en">
<!-- Head section with necessary links and scripts -->
<body>
<div id="header"></div>
<!-- Main content section -->
<div id="footer"></div>
</body>
<!-- Scripts section with required JavaScript libraries -->
</html>