How to create a gradient background on a webpage

Source: Internet
Author: User
Method 1:
Graph implementation
1. Cut a 1*760 gradient background image.
2. Add background information in dw

Method 2:
The code is as follows:
<Html>
<Body style = "FILTER: progid: DXImageTransform. Microsoft. Gradient (gradientType = 0, startColorStr = # ffffff, endColorStr = #000000)">
<Center>
<Font size = "+ 3"> <strong> webpage background color gradient <br>
(From white to black) </strong> </font> <br>
<Br>
</Center>
</Body>
</Html>

Below is a diagonal gradient.
<Html>
<Body style = "FILTER: Alpha (style = 1, opacity = 25, finishOpacity = 100, startX = 50, finishX = 100, startY = 50, finishY = 100 ); background-color: skyblue ">
<H1> background gradient (upper left to lower right) </Body>
</Html>
COOL!

Method 3:
Implemented using javascript
<Script language = "javascript">

<! -- Hide from old browsers
Var Color = new Array (9 );
Color [1] = "ff ";
Color [2] = "ee ";
Color [3] = "dd ";
Color [4] = "cc ";
Color [5] = "bb ";
Color [6] = "aa ";
Color [7] = "99 ";
Color [8] = "88 ";
Color [9] = "77 ";
Color [10] = "66 ";
Color [11] = "55 ";
Color [12] = "44 ";
Color [13] = "33 ";
Color [14] = "22 ";
Color [15] = "11 ";
Color [16] = "00 ";
/* Do not display text on a fading background. Instead, let it
Fade in and out once or twice, then load a new page .*/
Function fadeIn (where ){
If (where> = 1 ){
Document. bgColor = "#" + Color [where] + "0000 ";
Where-= 1;
SetTimeout ("fadeIn (" + where + ")", 15 );
} Else {
SetTimeout ('fadeout (1) ', 15 );
}
}
Function fadeOut (where ){
If (where <= 16 ){
Document. bgColor = "#" + Color [where] + "0000 ";
Where + = 1;
SetTimeout ("fadeOut (" + where + ")", 15)
} Else {
SetTimeout ("fadeIn (16)", 15 );
// Window. location. href = "http ://";
}
}
// Unhide -->
</SCRIPT>

<Body bgcolor = "# fef4d9" onLoad = "fadeIn (16)">


<

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.