If the page contains a valid DOCTYPE declaration, it is rendered in strict mode.
If the page does not have a DOCTYPE declaration or a valid DOCTYPE declaration, it is rendered in compatibility mode.
There is a difference between the two modes, the
One accepts two input parameters: style attributes and style values, separated by commas. For example we want to change the link color, we can use the following code:
Copy Code code as follows:
$ ("#61dh a"). css (' color ', ' #123456
CSS and JS closely with, for our pages add a lot of chic effect. In order to achieve a particular effect we need to dynamically change the CSS properties of a particular label using JavaScript.
For example, the commonly used closure of a floating
Effect of Flash div+css+js menu
css menu G1 good morning G2 good evening M1 my name is fireyy ;/div> M2mm mm I love u G1 good morning G2good evening M1 my name is fireyy &L
T;/div> M2 mm mm I love u
Way One: Directly write code implementation
The effect is as follows:
The code is as follows:
Copy Code code as follows:
Menu without table
Home
News
Sports
Weather
contact me
mode two: using jquery
Progress bar, is in the user enters your website, can let the user see the webpage downloading how many, this function is very obvious---is lets the user wait for the time to become longer, may effectively make up the space slow shortcoming (of
untitled document &
Lt;style type= "Text/css" > p{font-size:12px;
font-family:arial;
} input{Cursor:pointer; } "Yellow fade" effect
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Test code:
Copy Code code as follows:
jquery Css test
test
Pop-up box display information:
IE8:
IE7:
IE6:
Firefox:
Chrome:
Opera:
The following are all the same, and the string type is
Sometimes we might need to use jQuery to load an external CSS file, such as when switching page layouts. The idea is to create a LINK element and add it to the tag, and see how you can use JQuery first.
Below is my favorite writing:
$ ("")
.
Use JS to manipulate the CSS properties of the writing is a certain pattern:
1, for no underlined CSS properties are generally directly using style. Property name.
such as: Obj.style.margin,obj.style.width,obj.style.left,obj.style.position and so
IE inside with stylefloat
Other use Cssfloat
This article gives you a brief introduction to JS operation CSS Float properties of the special writing, for the CSS with the underlined attributes, each of the underline removed and the first
The effect of the brothers ' questioning in the group
Untitled document Hello,this is a example of stylesheets hello,this is a example of stylesheets
[Ctrl + A All SELECT Note: If the need to introduce external JS
Just came to a post, see as long as a line of code, you can kill IE6.
Copy Code code as follows:
If you are using IE6 now, you can try it. Click the Run Code button below; If the point is not dead, let's say your IE is not 6;
Because "{" and "}" and "{" and "}" in CSS conflict.
It doesn't seem to be in quotes, specifically without testing.
As a result, writing scripts in CSS is not flexible, but what if you want to write a complex script into CSS? is a problem, after
Using jquery to modify CSS with!important style properties
The external style is:
div.test{
Width:auto!important;
Overflow:auto!important
}
by $ ("Div.test"). CSS ("width", "100px"); and $ ("Div.test"). CSS ("width", "100px!important");
Code Description:
In this paragraph, a large block div is defined; and gave him an ID; Below the li,a,span,img four labels respectively; So we can set the four tags in the CSS to achieve the desired effect;
http://www.zishu.cn/blogview.asp?logid=
Determine if a layer is hidden:
Copy Code code as follows:
$ ("#id"). CSS ("display") = = "None";
In all matching elements, set the value of a style property:
Copy Code code as follows:
$ ("P"). CSS ("Color", "red");
Sets
Step one: Define an ID in the element that connects the style sheet, for example
Copy Code code as follows:
The ID I defined is CSS.
The second step: Write a JS function, the code is as follows:
Copy Code code as follows:
If you have a label with "No" in your Web page, let's tell it as a DIV tag;
To set the CSS style for this div in JS, it is common practice to:
var obj = document.getelementbyidx_x_x (' no ');
Obj.style.width = ' 400px ';
Obj.style.height = ' 30
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