CSS does not appear to be showing on the banner

I am struggling to get my banner to display correctly using the CSS code below.

#banner {
    background-image: url(../Images/banner.png); 
    background-repeat: no-repeat;
    background-size: cover; 
    border: 5px solid #dedede;
    height: 200px;
}

For some reason, instead of showing the banner, I am seeing a small white cube in the top left corner.

The complete CSS stylesheet is as follows:

body {
    font-family: lucida grande,tahoma,verdana,arial,sans-serif;
    background-color: #e9e9e9;
}

body p {
    font-size: 0.8em;
    line-height: 1.28;
}

#wrapper {
    width: 1080px;
    background-color: #fff;
    margin: 0 auto;
    padding: 10px;
    border: 5px solid #dedede;
}

#banner {
    background-image: url(../Images/banner.png); 
    background-repeat: no-repeat;
    background-size: cover; 
    border: 5px solid #dedede;
    height: 200px;
}

#content_area {
    float: left;
    width: 750px;
    margin: 20px 0 20px 0;
    padding: 10px;
}

#sidebar {
    clear: right;
    width: 250px;
    height: 400px;
    margin: 20px 10px;
    padding: 10px;
    border: 2px solid #E3E3E3;
 }

footer {
    clear: both;
    width: auto;
    height: 40px;
    padding: 10px;
    border: 3px solid #E3E3E3;
    text-align: center;
    color: #fff;
    text-shadow: 0.1em 0.1em #333;
    background-image: url(../Images/banner.jpg);
}

#navigation {
    height: 60px;
    border: 3px solid #E3E3E3;
    margin-top: 20px;
    text-shadow: 0.1em 0.1em #333;
    background-image: url(../Images/footer.jpg);
}

#nav {
    list-style: none;
}

#nav ul {
    margin: 0;
    padding: 0;
    width: auto;
    display: none;
}

#nav li {
    font-size: 24px;
    float: left;
    position: relative;
    width: 180px;
    height: 50px;
}

#nav a:link, nav a:active, nav a:visited {
    display: block;
    color: #fff;
    text-decoration: none;
}

#nav a:hover {
    color: lightblue;
}

Below is the HTML code I am using:

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><?php echo $title; ?></title>
    <link rel="stylesheet" type="text/css" href="Styles/Stylesheet.css"/>
</head>
<body>
    <div id="wrapper">
        <div id=banner">
    </div>
    <nav id="navigation">    
         <ul id="nav">
             <li><a href="index.php">Home</a></li>   
             <li><a href="#">Books</a></li>
             <li><a href="#">Publications</a></li>    
             <li><a href="#">About Us</a></li>       
        </ul>   
    </nav>    
    <div id="content_area">
        <?php echo $content; ?>
    </div>
    <div id="sidebar"></div>
    <footer>
        <p>All rights reserved</p>
    </footer>
</body>
</html>    

Answer №1

Seems to be a mistake with the double quotation marks in the id attribute

<div id=banner">

Answer №2

Here is my approach: 1. Experiment with the CSS property background-repeat: repeat; to observe the effects. 2. Verify the correctness of the small image by right-clicking on it and selecting "view image". 3. Share the HTML code for further clarity.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

My project is experiencing issues with the execution of JavaScript codes

Greetings, I'm having trouble with my JavaScript codes. The following code works perfectly: function Choice() { var box = document.getElementById('searchh'); if (!count) { var count = 0; } box.onclick = function () ...

I'm having trouble making the colors change on my Icon font/sprite rollover

I am currently attempting to position some related icons above my main navigation menu. The goal is to change the text and icon colors when a user hovers over a specific area (the tag with large padding). Unfortunately, I am facing challenges in achieving ...

Ways to prevent the mousedown event from firing when reaching a particular number during incrementation

Is there a way to disable the mousedown event once a specific condition is met? For instance, in the code below, how can I prevent the Key and event from functioning when the temp reaches 30 $(document).ready(function() { var temp = 0; var to = n ...

Achieving an oval shape using HTML5 and CSS3: Step-by-step guide

<!DOCTYPE html> <head> <title> Oval shape</title> </head> <body> <div style="width:400px; height:400px; background-color:#ff0;">Oval</div> <p> Exploring the creation of an oval shape using HTML5 ...

Troubles with HTML, CSS, and jQuery Double-Level Menu

After creating a simplified version of an HTML, CSS, jQuery navigation menu, I noticed that the submenu items were being considered part of the containing list item. This caused them to not function as intended when clicked because they were being treated ...

Maintain uniform product dimensions for images and configurable swatches in Magento

I am new to using Magento and I am currently working on setting a consistent product image grid size of 500px x 500px for the product detail page. Some of my product images are in square or rectangular shapes, so I need to resize them to fit into the grid ...

Discover the row and column of a selected table cell using vanilla JavaScript, no need for jQuery

In my JavaScript code, I am currently working on creating an onclick function that will display the row and column of a specifically clicked cell in a table. I have successfully implemented functionality to return the column number when the cell is click ...

The website displays perfectly in Atom, however, it is not functional in any web browser

My website is currently in the development phase, and I'm experiencing issues with certain div elements not positioning correctly once the site goes live. Specifically, the "Follow Us" tab at the bottom of the site, among other divs, has been affecte ...

Using Angular to scroll within a <div> that is obstructed by other <div>s and concealed by

I am currently in the process of developing a website using Angular. I have implemented a card feature that allows for text selection from a menu on the left side. The texts are displayed using the *ngIf directive. However, I encountered an issue where if ...

The previous and next buttons are displaying side by side rather than being positioned at the outer edges

I am having an issue where the prev and next buttons are displaying next to each other instead of at the edge of the div. Can someone please assist me in fixing this problem? Below is the provided HTML code: <div id ="moreOption_80322271" class="m ...

React JS onClick() failing intermittently

I've spent hours trying to solve this problem. The issue first arose on iOS while working on a website I had recently launched. I've tested the code below, and it works correctly 90% of the time, but occasionally fails. <button className=" ...

Tips for minimizing the dimensions of images in a slideshow within a gallery

Check out this website: The slideshow images on there are too tall. Can someone assist me in lowering the height of the images? I want both images to be displayed at the same height. Thank you in advance. ...

Is it possible to deactivate an anchor tag based on the result of a conditional statement that returns a string?

I've created an anchor tag (not a button) with text that redirects me to another page <StyledTableCell align="center"> <Link href={`/races/results/${race.id}`}>{race.race_name}</Link> </StyledTableCell> There is a ...

Align the top navigation centered horizontally, with the logo on the left and language selection on the right

Is there a way to center my menu horizontally while keeping the logo aligned to the left and language selection to the right, all with consistent proportions when resizing? I've tried various suggestions but nothing seems to work for my navigation bar ...

The min-height attribute of the tooltip functions, but the min-width attribute does

I found a helpful tooltip on this site: I customized it to work with an input element: <div class="tooltip"> <input type="text" placeholder="Name" name="dp_name"> <span>Full name asd as dasd as dasd</span> </div> ...

Solution: Resolve clientY scrolling issue within an HTML document

I am facing an issue with the positioning of my context menu. When I right-click and scroll down, the menu does not maintain its regular position. Instead of appearing to the right of the mouse cursor when stationary, it moves below the cursor based on how ...

Implemented an HTML hyperlink element precisely positioned

I have the following HTML code. I am trying to fix the position of an anchor tag called "View All" so that it stays in a specific location. However, whenever the value in the dropdown menu changes, the anchor tag moves according to the length of the new se ...

The proper way of aligning text in the middle of a button

I'm currently working on designing a CSS button that will be placed in the top left corner and serve as a back button to the previous page. However, I am facing challenges when it comes to centering the arrow or text perfectly in the middle of the but ...

What could be causing Media-Query to fail when using the max-width media feature?

I recently added a max-width media feature to my code, but for some reason, the colors aren't changing when the width is less than 300px. I've been trying to inspect elements on my laptop to troubleshoot the issue. Additionally, I've made su ...

What is the best way to ensure an input field and a button are aligned perfectly within the same div tag and of equal height?

During a recent HTML-CSS project, I encountered an issue where I struggled to ensure that two elements within a div tag were the same height. The elements in question were an input field and a button with an icon. Here is a snippet of the relevant HTML cod ...