expression_html/css_WEB-ITnose in css
Recently, I am more interested in the behavior in CSS. Although it does not meet the standards and can only be recognized by IE, it does expand the functions of CSS a lot. The following are text and examples taken from the Internet. Because they have been corrupted, the source cannot be indicated.
IE5 and later versions support the use of expression in CSS to associate CSS attributes with Javascript expressions. The CSS attributes here can be inherent attributes of the element or custom attributes. That is to say, the CSS attribute can be followed by a Javascript expression, and the value of the CSS attribute is equal to the result of the Javascript expression calculation. You can directly reference the properties and methods of the element itself in the expression, or use other browser objects. The expression is as if it were within a member function of this element.
Assign values to the inherent attributes of the element
The following is to define the width of the container container. If <725, it is its own width, otherwise it is equal to 725, which is equivalent to max- width:725px;.
Assign a value to the element's custom attribute
For example, eliminate the link dotted box on the page. The usual approach is:
At a glance, the advantages of using expression may not be apparent, but if there are dozens or even hundreds of links on your page, would you still use Ctrl C and Ctrl V mechanically at this time, let alone compare the two? , which one generates more redundant code?
The way to use expression is as follows:
link1
link2
< a href="link3.htm">link3
Explanation: The star in is an attribute defined arbitrarily by you. You can define it as you like, and then include it in The statement in expression() is a JS script. Don’t forget there is a quotation mark between the custom attribute and expression. Because the essence is still CSS, it is placed in the style tag instead of the script. OK, so it is easy to eliminate the link dotted box in the page in one sentence. But don’t be complacent. If the special effect triggered is a CSS attribute change, the result will be different from your original intention. For example, if you want to change the color of the text box on the page as the mouse moves in and out, you may naturally think that it should be written as
But the result is a script error. The correct way to write it is Write the definition of CSS style into the function, as follows:
Note: is not very necessary, generally It is not recommended to use expression because expression requires relatively high browser resources.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.
