How can I set background in HTML?

i want to set a background image using html

Best Asked on June 3, 2020 in Website.
Add Comment
  • 1 Answer(s)

    if you want to set a particular color then use this syntax . #ffffff is hex code for white color. You can choose many different colors .

    <div style =”background:#ffffff” >

    </div>

    if you want to use image as the background then use this syntax. “image.jpg” is the name of the image .

    <div style=”background:image.jpg” >

    </div>

    if the image is any other folder then you have to give path.

    <div style=”background:images/imageName.jpg” >

    </div>

    Best Answered on June 3, 2020.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.