Where is the error in the CSS

NorseMan

Member
The logo/background picture doesn't show. Where is the error?

div.logo_div{
height: 48px;
width: 356px;
background-image: url ("../img/logo_small.png");
}

<div class="logo_div"></div>

The DIV box showes up in the right size.
 
The issue in your code lies with the space between url and the opening parenthesis. In CSS, when specifying a URL for the background-image property, there should be no space between url and the opening parenthesis. Here's the corrected code:

div.logo_div {
height: 48px;
width: 356px;
background-image: url("../img/logo_small.png");
}

Make sure to remove the space between url and the opening parenthesis. This should allow the background image specified by the URL to display correctly within the logo_div element.
Also, ensure that the relative path "../img/logo_small.png" is correct and that the image file exists at that location relative to the CSS file or the HTML file where the CSS is applied.
 
Hello this is Gulshan Negi
Well, you need to replace your code with below code.

div.logo_div {
height: 48px;
width: 356px;
background-image: url("../img/logo_small.png");
}

Thanks
 
Back
Top