viewInheritStyle
Property of css/cssom/propertiescss/cssom/properties
Syntax
var result = element.viewInheritStyle;
element.viewInheritStyle = value;
Examples
The content of the primary document is shown in the code snippet below. In the following sample a div tag contains a custom element that has an element behavior attached to it. The div tag that is located in the primary document sets a number of CSS attributes, specifically the following:
The next code snippet shows the content of the HTC file, viewInheritStyle.htc
.
The HTC file contains a simple document fragment, which also includes a div tag that uses the following CSS styles.
<public:component tagName="abc">
<attach event="oncontentready" onevent=init() />
</public:component>
<script>
function init(){
defaults.viewLink=document;
defaults.viewInheritStyle = false;
docFragCaption.innerText = "viewInheritStyle is now set to false";
}
function btnChangeInheritance_onClick(){
boolInherit = defaults.viewInheritStyle;
if (boolInherit == true) {
defaults.viewInheritStyle = false;
docFragCaption.innerText = "viewInheritStyle is now set to false";
}
else
{
defaults.viewInheritStyle = true;
docFragCaption.innerText = "viewInheritStyle is now set to true";
}
}
</script>
<BODY>
<DIV id="docFragCaption" style= "font-size:20pt;border:2px solid green"></DIV>
<BR>
<INPUT id=btnChangeInheritance type=button value="Toggle viewInheritStyle property" onclick="btnChangeInheritance_onClick()">
</BODY>
Notes
Remarks
For more information on the CSS styles that can be inherited when viewInheritStyle is set to true, see About Viewlink CSS Inheritance. Inheritable CSS styles are only applied to elements in the document fragment that do not already have the corresponding CSS styles defined.
Syntax
See also
Related pages
- defaultSelecteddefaultSelected
Conceptual
Introduction to Viewlink
About Viewlink CSS Inheritance
About Element Behaviors
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]