The difference between position and _position in CSS styles

Source: Internet
Author: User

position:fixed; Absolute positioning relative to the browser window.
_position:absolute; Only IE6 can identify, IE6 does not support fixed, so for IE6 use absolute absolute positioning, generally also with an expression script to achieve


Attribute Expression_r: Written for IE6

The advent of CSS makes Web page author in the control of the elements of the page more convenient, of course, there are pros and cons, CSS can only be color, size, distance and other static style effective, for some HTML elements to implement the dynamic style is somewhat inadequate.

With the custom properties of CSS Expression_r, you can define the properties themselves, write the required code in the properties, so you can combine the characteristics of CSS and JS effects, to achieve the same elements on the overall page control.

Let's take the example of how to remove the dotted box on the page.

The usual practice is to:
Link1
Link2
Link3
Rough look may also reflect the advantages of using Expression_r, but if you have dozens of or even hundreds of links on the page, then you will also be mechanically ctrl+c,ctrl+v it, not to mention the comparison between the two, which produces more redundant code? The practice of using Expression_r is as follows:

<style type= "Text/css" >     {: expression_r (Onfocus=this.blur)} </style>

Note: The star inside is the attribute of any definition, you can define it as you like, and then the statement contained in Expression_r () is the JS script, and there is a quotation mark between the custom attribute and the Expression_r, because the essence or CSS, So put it in the style tag, not inside the script. OK, so it is easy to use a sentence to achieve the link in the page to eliminate the dotted box. But don't be complacent, if the trigger is a CSS property change, then the results will be different from what you intended. For example, if you want to change the color of the text box in the page as you move the mouse over, you might assume that it should be written as

<styletype= "Text/css">input{Star:Expression_r (onmouseover=this.style.backgroundcolor= "#FF0000";onmouseout=this.style.backgroundcolor= "#FFFFFF")}</style><inputtype= "text"><inputtype= "text"><inputtype= "text">

But the result is a script error, the correct wording should be the CSS style definition written into the function, as follows:

 <styletype= "Text/css">input{Star:Expression_r (Onmouseover=function () {this.style.backgroundcolor= "#FF0000"}, Onmouseout=function (){this.style.backgroundcolor= "#FFFFFF"}                  )                }</style><inputtype= "text"><inputtype= "text"><inputtype= "text">

Differences between position and _position in CSS styles

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.