Sometimes, in order to achieve some special effects, you need to set a certain area of the page element to gradient. Generally, this is achieved through the ps image method, however, increasing the number of images will affect the speed of web page opening. This article describes how to use pure CSS to achieve gradient effects supported by IE, Firefox, Chrome, an
One, background-position: (Image positioning)
Three ways to do it:
1): by% ratio, the upper left corner of the smallest (0%,0%), the lower right corner of the largest (100%,%100);2): (x, y) upper left corner min (0,0), lower right corner max (Max,max);3) Top,center,left,right,bottom;
Two, Background-clip:
1, contains the value of that part: border;padding;content;
Three, Background-origin:
1, starting from that part value: Border;padding;con tent;
Four, whether the background image is fixed or
table header, values: top; bottom; 8.table-layout: Used to help the browser display or layout a table, both to set the display table cell. Row. Algorithm rules for columns Value: Auto: Column width is set by cell contents, default value, automatic table layout fixed: Column width is set by table width and column width, Fixed table layout . NOTE: The width and height of TD in auto:table varies depending on the content; nbsp fixed: If it is Chinese, the width of
code as follows:
var Node=document.getelementbyid ("Fade");
var color= "#0000";
var level=1;
Window.load=function Fading () {
Node.style.background=color.+level.tostring () +level.tostring ();
level++;
if (level>16) {
Cleartimeout (fading);
}else{
SetTimeout (fading,300);
}
}
So I don't have to say more, just a stitch and a recurring call to the problem.
* Static Gradient
First to the drawings, we look at
This article for everyone to share the DIV+CSS+JS implementation of the text color gradient effect for everyone to refer to, the specific content as follows
Here is the CSS part of the code:
Here is the DIV section code:
The following is a JavaScript part code:
JavaScript code begins var rs = document.getElementById ("Rvalue");
var
Now we're going to use the radial gradient of the CSS to implement a text shadow effect as shown in the following figure.
You can see the effect of a similar beam of text, highlighting the text very well. This is simple to do, just center the text and set the radiation gradient from the center to the background element, as follows:
The code i
/Images/CSS2_s.jpg "),
-Moz-linear-gradient (left, rgba (0,255, 0, 1), rgba (255, 0, 0 ));
You cannot see the gradient effect.
The source code of the example is as follows:XML/XHTML code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Style
Type
= "Text/CSS"
>
Div {font-size: 24px; font-weight: Bo; D; color: #
Some time ago, the customer sent a website effect diagram. Because the customer is a graphic design engineer and has no experience in making webpages, the effect diagram uses a large number of gradient colors, and multiple layers overlap, as a result, the entire cut graph cannot be performed, so you have to consider using the CSS style.Based on the effect chart, the author roughly simulates a two-layer
This time for you to bring CSS gradient color, using CSS gradient color considerations are what, the following is the actual case, take a look.
Background:-o-linear-gradient (left, #109afd, #3ed3fe); background:-moz-linear-gradient
Objective
The main use of the three CSS properties:
Linear-gradient () the image used to implement the gradient
Background-clip the area to which the background image of the specified object is cropped out
text-fill-color The fill color of the specified text
Instance
Background:linear-gradient (to b
Use CSS to implement webpage background gradientCodeAs follows:
1. gradient from top to bottom
Body {
Filter: progid: DXImageTransform. Microsoft. gradient (gradienttype = 0, startcolorstr = # ffffff, endcolorstr = #000000 )";}
2. gradient from top left to bottom rightBody {
Filter: alpha (style = 1, opacity = 25,
Color Gradient CSSIE seriesFilter:progid:DXImageTransform.Microsoft.Gradient (startcolorstr= ' #FF0000 ', endcolorstr= ' #F9F900 ', gradienttype= ' 0 ');Parameters: StartColorStr start color endcolorstr end color GradientType 0 o'clock for vertical, 1 o'clock for horizontalFirefoxBackground:-moz-linear-gradient (top, #FF0000, #F9F900);Parameters: Top, bottom vertical, left, right level for example: Top from
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.