Omar Al-Ali Omar Al-Ali - 8 months ago 35
CSS Question

solved div class logo isn't showing

I am having a problem with showing the logo. Here's my html code:

<!doctype html>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/main.css">
<div class="logo"></div>


Here's the CSS code:

body {
background: #43C6DB;

.logo {
background: url('../logo.png') no-repeat;


Div elements by default have no height unless you explicitly specify it. You could put your logo as an image in the div which would give you more control over how it looks inside your div. But to solve your problem you can add this to your css.

.logo {
background: url('../images/logo.png') no-repeat;
height:100px; /*Height of your image*/

Here's a quick example

Cheers and happy coding.