If the page contains a valid doctype declaration, it is displayed in strict mode.
If the page does not have a doctype declaration or there is no valid doctype declaration, it is displayed in compatibility mode.
The following describes the
Compared with JavaScript, CSS syntax is much simpler. It mainly deals with comments, strings, CSS style names, CSS style values, indentation, and line breaks. For details, see
Code.
Xmlns = "http://www.w3.org/1999/xhtml">
body { font-size:
Toggle ()
Switches the visible state of an element.
If the element is visible, switch to hidden. If the element is hidden, switch to visible.
---------------------------------
Example
Switch the visible status of all paragraphs.
Html
Code :
Hello
In order to better control the elements to meet our requirements, we can get the height and width of this part through outerheight (options) and outerwidth (options.
Outerheight (options)Obtain the external height of the First Matching Element
Div + CSS + JS simulates tabs. In this version, you can theoretically add unlimited tabs. In addition, you only need to add lines to the content without modifying Js.
Of course, you have to get a div.
Xmlns = "http://www.w3.org/1999/xhtml">
Although it is difficult to implement it, if you use the built-in SELECT statement, it is very easy to complete, but this
Code In fact, we are telling you about the actual application of Javascript in the web page, and the cooperation among
In fact, careful friends will find that the toolbar on the top is actually a tiled background image, and CSS plays a fixed background role, which is also a unique implementation method.
Xmlns = "http://www.w3.org/1999/xhtml">
Foot
Offset
The offsettop and offsetleft attributes of all the elements in the browser are very useful. They will give the coordinates of your element relative to the parent element.
This sectionCodeIt will search for offsetparent up, and then add
You may be interested in
Article:
Code for implementing the Ajax level-2 cascade menu
Design of intermediate web page menus using Ajax
JS implements a provincial/municipal-level association selection box code sharing
Code learning for
Here is the test page.
Set transparency in Javascript
I use the following
CodeTo set transparency:
Copy codeThe Code is as follows: function setopacity (value ){
Testobj. style. Opacity = value/10;
Testobj. style. Filter = 'Alpha (opacity = '
Effect:
Core code:
CopyCode The Code is as follows:
Full DEMO code:Xmlns = "http://www.w3.org/1999/xhtml">
ID: One Class: One Class: miniclass: Mini, Title: otherclass: Mini, Title: testclass for Mini, title for test
The span under
1. display in the middle. (See: sky100articles1790515)
Copy codeThe Code is as follows:. ordersearchDivCss
{
Position: absolute;
Z-index: 100;
Display: block;
Background-color: # 6ec1df;
}
Js codeCall: // Functions of the object obtained by
However, DOM. style can only access , so that the built-in style in the label is, if the style is written in the and .css files, you can read the style.
In fact, there are other ways to read the style information. There are two methods, one is
You can use the following code:
Copy codeThe Code is as follows: document.exe cCommand ("BackgroundImageCache", false, true );
Of course, for other browsers to pass normally, you need to make a judgment before calling, to make it safer:
Copy codeThe
Test code:
Copy codeThe Code is as follows:
jQuery Css Test
test
The pop-up box displays information:
IE8:
IE7:
IE6:
Firefox:
Chrome:
Opera:
The following are all the same and return the String
Note the differences between the Code and the traditional DHTML. In DHTML, you can change the style by directly modifying specific elements on the page. The code here modifies the style sheet.View the compatibility list of W3C DOM-CSS
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