I've got a problem while adding an image to my project site.
So, when I use the element tag name only like 'img' then there is no horizontal scroll but when i use that image using a class selector like '.class img', then the horizontal scroll appears. Please help me I have never see a problem like this...
html,body {
height: 100%;
margin: 0;
}
nav {
display: flex;
background-color: #ffffff;
padding: 10px;
}
nav a {
text-decoration-line: none;
color: black;
font-size: 20px;
padding-right: 25px;
}
.about {
margin-left: auto;
}
.home {
padding-left: 20px;
padding-right: 0;
}
.first-img{
width: auto;
height: auto;
}
<html>
<head>
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<nav>
<a class="home" href="#">Home</a>
<a class="about" href="#">About</a>
<a class="menu" href="#">Menu</a>
<a class="contact" href="#">Contact</a>
</nav>
<div class="first-img">
<img class="first" src="hamburger.jpg" />
</div>
<script type="text/javascript" src="script.js"></script>
</body>
</html>