Page Widget How to - Set body background with linear-gradient








Question

We would like to know how to set body background with linear-gradient.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
    body {<!--from  w  w w.  j  a v a 2 s  .  co m-->
    background-image:
    linear-gradient(45deg, #000 25%, transparent 25%,transparent 75%, #000 75%, #000 100%),
    linear-gradient(45deg, #000 25%, transparent 25%,transparent 75%, #000 75%, #000 100%);
    background-size:100px 100px;
    background-position:0 0, 50px 50px;
}
</style>
</head>
<body>
</body>
</html>

The code above is rendered as follows: