1. ホーム
  2. html

[解決済み] Adding a background image to a <div> element

2022-03-05 23:44:12

Question

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

How to solved?

You mean this?

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

...

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