In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to use the behavior attribute in CSS". The editor shows you the operation process through an actual case. The method of operation is simple and fast, and it is practical. I hope this article "how to use the behavior attribute in CSS" can help you solve the problem.
Syntax and introduction of CSS attribute behavior
In the CSS page layout, we are accustomed to using cookie when refreshing to retain the contents of the form, but it is really troublesome to do so, and behavior in CSS solves this problem for us. Today I will introduce the syntax of the CSS attribute behavior.
The syntax of behavior:
ExampleSourceCode
Behavior:url (url) | url (# objID) | url (# default#behaviorName)
Value:
Url (url): specify the DHTML behavior component (.htc) with an absolute or relative url address
Url (# objID): using binary implementation (as ActiveX? Control). Where # objID is the value of the id attribute of the object object
Url (# default#behaviorName): the default behavior of IE. Specified by the name identification of the behavior (# behaviorName)
Description: sets or retrieves the DHTML behavior of an object. Multiple behaviors are separated by spaces.
When multiple behaviors attached to the same feature conflict, the result depends on the order in which the behavior is applied to the feature. The priority of the latter behavior is higher than that of the previous one. The same rules apply to name conflicts between properties, events, and methods provided by different behaviors.
◆ can use the addBehavior method to dynamically attach behaviors to objects.
This property is read-only to the currentStyle object. It is readable and writable to other objects.
It is important to note that behaviors defined inline using the behavior property of the style sheet (CSS) or attached using the addBehavior method are not automatically detached when objects are removed from the document tree. The behavior defined by the stylesheet rules in the document is automatically separated when the object is removed from the document tree.
The corresponding script feature is behavior.
Example: ExampleSourceCode
P {behavior:url (# default#download);} div {behavior:url (fly.htc) url (shy.htc);} div {behavior:url (# myObject);}
◆ application 1: refresh also retains the text in the input box
ExampleSourceCode
.sHistory {} {behavior:url (# default#savehistory);}
◆ Application 2: call script
ExampleSourceCode
H2 {behavior:url (behave.htc)} put the mouse here div-CSS.net behave.htc functionhig_lite () {element.style.color=255} functionlow_lite () {element.style.color=0}
Note: try to avoid using Behaviors technology when CSS
This is the end of the content about "how to use the behavior attribute in CSS". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.