How to apply gradient color in css?

I want to use the gradient color as the background of the page; how to apply CSS to get the gradient background?

+3
source share
3 answers

CSS 3 supports gradients , but this will not be supported by all browsers (e.g. IE6).

But you could do it, which I think is very similar to the previous answer:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
    body {
        padding:0px;
        margin:0px;
    }
    div#bg {
        background: url(http://www.khiba.com/PSP/FALL01/Testgrad.jpg) repeat-x;
        height:600px;
    }
</style>
</head>

<body>
<div id="bg">
</div>
</body>
</html>
+2
source

, , :

background-image: url(someurl.gif);
background-repeat: repeat-x;

someurl.gif . , -x repeat-y. , .

0

Source: https://habr.com/ru/post/1750103/


All Articles