Issue
beginner here! I am following a series of HTML and CSS by Dani Krossing on YouTube, and I followed his series. I reached his video on image in HTML and imported images using div. However for some reason, it's not displaying in my website. I followed the tutorial to a tee but to no avail. Please help me. Here is the HTML code:
* {
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
}
body {
background-color: #eee;
}
.wrapper {
margin: 0 auto 0 60px;
width: 1000px;
}
nav {
background-color: #fff;
width: 100%;
height: 100px;
}
ul {
line-height: 100px;
margin: 0;
}
ul li {
display: inline-block;
float: left;
}
ul li a {
text-decoration: none;
color: #1e1e1e;
display: block;
padding: 0px 20px;
}
ul li a:hover {
color: darkred;
}
.img-lightning {
width: 400;
height: 229;
background-image: url(images/lightning.jpg);
}
<nav>
<div class="wrapper">
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="about.html">About Me</a>
</li>
<li>
<a href="portfolio.html">Portfolio</a>
</li>
<li>
<a href="contact.html">Contact me</a>
</li>
</ul>
</div>
</nav>
<div class="wrapper">
<h1>Front Page</h1>
<div class="img-lightning"></div>
</div>
Here is the image of the website having the error: The website
Solution
You have forgot to mention property unit
.img-lightning {
width: 400px;
height: 229px;
background-image: url(images/lightning.jpg);
}
Answered By - Girish Sawant
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.