satbeachgrl satbeachgrl - 2 years ago 161
CSS Question

Loading a background image

I have tried following tutorials on W3schools, and I've also dug into Developer Tools on the website I'm tasked with cloning, and have gone back to my previous project when I had to do a

background image

I know this is a user error, but I am stuck.

My HTML looks like this:

<section class="introduction"> <img src="background-image">

and my CSS looks like this:

.introduction {
background-image: url('../images/karma-background.jpg');

Answer Source

You don't require an image object

<img src="...">

css and background images work like so.

<section class="introduction"></section>

.introduction {

so actually the problem is you haven't ended your section tag like I have in my example. You may have to add additional css for sizing

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download