Sandeep Sandeep - 7 months ago 9
HTML Question

Adding a background image to a <div> element

Is it possible to make a

<div>
element contain a background image, and if so, how would I go about doing this?

Answer

You mean this?

<style type="text/css">
.bgimg {
    background-image: url('../images/divbg.png');
}
</style>

...

<div class="bgimg">
    div with background
</div>
Comments