Ola Mohey Ola Mohey - 1 year ago 80
CSS Question

How to set background to div

I tried to set image in background of a div but disappeared! I want the background image covers all page, thanks.

<!DOCTYPE html>
<style type="text/css">
div {
height: 100%;
background-image: url('https://static.vecteezy.com/system/resources/previews/000/094/491/original/polygonal-texture-background-vector.jpg');

Answer Source

for this make parents 100% by:

html,body{width:100%;height: 100%;}