Hi @Joseph Hedbon,
First of all, your problem is that because the height of the image exceeds the height of the div, the excess part is cropped.
You can specifically set the background size.
background-size: 100% 350px;
question i have is if i use the IMG vs background how could i float a horizontal navigation bar over it and not use the container or background image property.
From my understanding, you are trying to set the background image using the <img> tag instead of the background image property.
You can refer to the code below.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
position: relative;
top: -350px;
left: 0px;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
img {
width: 100%;
height: 350px;
}
</style>
<title></title>
</head>
<body>
<img src="https://learn-attachment.microsoft.com/api/attachments/07513f61-1b21-4799-a252-08be06ca99fa?platform=QnA" alt="Banner Image" />
<ul>
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.