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
JS and CSS files loaded on pages often contain parameters, such:
There are two possibilities for using parameters,
The script does not exist, but is dynamically generated by the server. Therefore, a version number is provided to indicate 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:
1. The style displayed by the image, that is, the color and transparency of the image. 2,
Algorithm It is a simple line, rectangle, circle, slice, polygon, etc. JavaScript and CSS are undoubtedly the best partners, the most basic element of all
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
June January : 35% July February : 40% July March : 87% July April : 45% August 1, May : 23% February January : 35% February 1, February : 40% February 1, March : 87% February 1, April : 45%
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
It is usually a very small value. After the layer-by-layer amplification and distortion, the entire layout is distorted. CSS is a simple language that is easy to learn and use, but also the easiest way to get rid of spam.
Code . This is because we
Xmlns = "http://www.w3.org/1999/xhtml">
Original password:
New password: (The password length is 6 ~ 20 bytes. Leave it blank if it is not modified)
Duplicate password:
Mailbox settings: (We will not send you any
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
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
jb51.net provides JavaScript/CSS special effect code. Script home all kinds of programming source code, provide all kinds of programming source code script home (jb51.net) jb51.net script home
We usually use the following two methods to write css styles using js:
In general, we use js to set the style of element objects in this form:Copy codeThe Code is as follows: var element = document. getElementById ("id ");Element. style. width = "
Take a good look at the code and I believe it will help you a lot.
Xmlns = "http://www.w3.org/1999/xhtml">
Life Satisfaction:
63%
Job satisfaction:
38%
Love satisfaction:
86%
However, the checkbox radio and so on will also change. These two controls are often not very satisfactory.
There is a way to change the style of other input controls without affecting checkbox and radio.
I haven't found any proper code for a long
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.