CSS (name)
Accesses the style properties of the first matching element.
--------------------------------------------------------------------------------
Return a style property on the the matched element.
return value
String
Parameters
Name
Before starting this article, let's briefly introduce the HTML tags: using tags, we can define anchors on an HTML page, and anchors have two uses:
Create a link (or hyperlink) to another document by using the href attribute
Create a bookmark
This method will be the address of the CSS file with JavaScript to output, and encrypt characters, we try, what way can show these? Think about it.
&L t;head> block view CSS files although not 100% download or view, but for rookie
Frequently encountered in the page in the download of JS and CSS files with parameters, such as:
There are two possible uses of parameters,
The script does not exist, but it is dynamically generated by the server, so there is a version number
In the trigger JS scroll event Ah, but I met is really not moving, I began to think it is FF above, did not think IE6 and IE7 have such effects, have to Marvel magic.
As I have found the following magic code: only the use of CSS to achieve scrolling
"Clear Demand"
The Web page loads the style sheet default.css, showing the default style. At the same time to achieve a variety of styles, the production of skin1.css,skin2.css,skin3.css three custom styles. If you load a default.css and then load
the difference between Display:none and Visible:hidden
Both Display:none and Visible:hidden can hide an element from the page, but there are differences:
Display:none---does not retain its physical space for the object being hidden, that is, the
For example: elem.style.height or elem.style.height = ' 100px ', it is important to note that any geometry attribute must be set to the specified size unit (such as PX), and that any geometry property returns a string representing the style rather
Copy Code code as follows:
//1, getting and setting styles
$ ("#tow"). attr ("class") Gets the class attribute with ID tow
$ ("#two"). attr ("Class", "Divclass") sets the class attribute with ID two.
2. Append style
$ ("#two").
Modify CSS properties with JavaScript only native JavaScript is written.
1. Use JS to modify the label's Class attribute value:The class attribute is one of the ways to refer to a style sheet on a label, its value is a stylesheet selector, and if
Just see a good article about JS call CSS properties, (^_^) Good! Forgive oneself forget, sum up1, for no underlined CSS properties are generally directly using style. Property name.
such as:
A div displays the img,img width and div the same, but is highly unfixed, requiring only the part of the IMG vertical center to be displayed.
Example:
Original:
Code implementation:
Copy Code code as follows:
onload=
Details determine success or failure! The meaning of browser caching is to improve the execution efficiency, but it also brought some problems, resulting in the service side modified JS, CSS, the client can not update
method to generate a random
Want everyone to do the mask layer of this common function, CSS or jquery implementation, the implementation of diversification, here http://I introduce the way I implemented in the project, Full-screen Mask, part of the area can be operated, very
1, in the web development, will often let you determine the current use of the browser and browser that version, according to the browser version to adjust the style of CSS,
To make the Web interface work best for each browser, here's the code to
Using JavaScript to get pseudo element (pseudo-element) attributes
Everyone knows how to get its CSS style values from an element's style property, but can you get the attribute value of the pseudo element (pseudo-element)? You can also use
This article illustrates the method of js+css realization of the DIV layer in the sensor mouse gradient display. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
The example of this article describes the method of Js+css to realize the tab menu switching effect. Share to everyone for your reference. The implementation methods are as follows:
Index.css is as follows:
Copy Code code as follows:
*
The example in this article describes the method that the JS+CSS implementation can sag to display the selected cells. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
The example of this article describes the method of Js+css to implement Div pop-up windows to darken the background. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
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