IHTMLCurrentStyle Interface

本文介绍了IHTMLCurrentStyle接口及其多个版本的发展历程,详细解释了这些接口如何为开发者提供访问HTML元素样式属性的能力。从基本的背景颜色设置到复杂的布局属性调整,这些接口覆盖了诸如字体、边距、边框、位置等多种样式特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

IHTMLCurrentStyle Interface

Provides the ability to programmatically access the style properties of the element.

IHTMLCurrentStyle Members

acceleratorRetrieves a string that indicates whether the object represents a keyboard shortcut.
backgroundAttachmentRetrieves how the background image is attached to the object within the document.
backgroundColorRetrieves the color behind the content of the object.
backgroundImageRetrieves the background image of the object.
backgroundPositionXRetrieves the x-coordinate of the IHTMLStyle::backgroundPosition property.
backgroundPositionYRetrieves the y-coordinate of the IHTMLStyle::backgroundPosition property.
backgroundRepeatRetrieves how the backgroundImage property of the object is tiled.
behaviorRetrieves the location of the Dynamic HTML (DHTML) behavior.
blockDirectionGets a string value that indicates whether the content in the block element flows from left to right, or from right to left.
borderBottomColorRetrieves the color of the bottom border of the object.
borderBottomStyleRetrieves the style of the bottom border of the object.
borderBottomWidthRetrieves the width of the bottom border of the object.
borderCollapseRetrieves a value that indicates whether the row and cell borders of a table are joined in a single border or detached as in standard HTML.
borderColorRetrieves the border color of the object.
borderLeftColorRetrieves the color of the left border of the object.
borderLeftStyleRetrieves the style of the left border of the object.
borderLeftWidthRetrieves the width of the left border of the object.
borderRightColorRetrieves the color of the right border of the object.
borderRightStyleRetrieves the style of the right border of the object.
borderRightWidthRetrieves the width of the right border of the object.
borderStyleRetrieves the style of the left, right, top, and bottom borders of the object.
borderTopColorRetrieves the color of the top border of the object.
borderTopStyleRetrieves the style of the top border of the object.
borderTopWidthRetrieves the width of the top border of the object.
borderWidthRetrieves the width of the left, right, top, and bottom borders of the object.
bottomRetrieves the bottom position of the object in relation to the bottom of the next positioned object in the document hierarchy.
clearRetrieves whether the object allows floating objects on its left side, right side, or both, so that the next text displays past the floating objects.
clipBottomGets the bottom coordinate of the object clipping region.
clipLeftGets the left coordinate of the object clipping region.
clipRightGets the right coordinate of the object clipping region.
clipTopGets the top coordinate of the object clipping region.
colorRetrieves the color of the text of the object.
cursorRetrieves the type of cursor to display as the mouse pointer moves over the object.
directionRetrieves the reading order of the object.
displayRetrieves whether the object is rendered.
fontFamilyRetrieves the name of the font used for text in the object.
fontSizeRetrieves a value that indicates the font size used for text in the object.
fontStyleRetrieves the font style of the object as italic, normal, or oblique.
fontVariantRetrieves whether the text of the object is in small capital letters.
fontWeightGets the numeric weight of the font of the object.
getAttributeRetrieves the value of the specified attribute.
heightRetrieves the height of the object.
imeModeRetrieves the state of an Input Method Editor (IME).
layoutGridCharRetrieves the size of the character grid used for rendering the text content of an element.
layoutGridLineRetrieves the gridline value used for rendering the text content of an element.
layoutGridModeRetrieves whether the text layout grid uses two dimensions.
layoutGridTypeRetrieves the type of grid used for rendering the text content of an element.
leftRetrieves the position of the object relative to the left edge of the next positioned object in the document hierarchy.
letterSpacingRetrieves the amount of additional space between letters in the object.
lineBreakRetrieves line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean.
lineHeightRetrieves the distance between lines in the object.
listStyleImageRetrieves a value that indicates which image to use as a list-item marker for the object.
listStylePositionRetrieves a variable that indicates how the list-item marker is drawn relative to the content of the object.
listStyleTypeRetrieves the predefined type of the line-item marker for the object.
marginRetrieves the width of the top, right, bottom, and left margins of the object.
marginBottomRetrieves the height of the bottom margin of the object.
marginLeftRetrieves the width of the left margin of the object.
marginRightRetrieves the width of the right margin of the object.
marginTopRetrieves the height of the top margin of the object.
overflowRetrieves a value indicating how to manage the content of the object when the content exceeds the height or width of the object.
overflowXRetrieves how to manage the content of the object when the content exceeds the width of the object.
overflowYRetrieves how to manage the content of the object when the content exceeds the height of the object.
paddingRetrieves the amount of space to insert between the object and its margin or, if there is a border, between the object and its border.
paddingBottomRetrieves the amount of space to insert between the bottom border of the object and the content.
paddingLeftRetrieves the amount of space to insert between the left border of the object and the content.
paddingRightRetrieves the amount of space to insert between the right border of the object and the content.
paddingTopRetrieves the amount of space to insert between the top border of the object and the content.
pageBreakAfterRetrieves a value indicating whether a page break occurs after the object.
pageBreakBeforeRetrieves a string indicating whether a page break occurs before the object.
positionRetrieves the type of positioning used for the object.
rightRetrieves the position of the object relative to the right edge of the next positioned object in the document hierarchy.
rubyAlignRetrieves the position of the ruby text specified by the rt object.
rubyOverhangRetrieves the position of the ruby text specified by the rt object.
rubyPositionRetrieves the position of the ruby text specified by the rt object.
styleFloatRetrieves on which side of the object the text will flow.
tableLayoutRetrieves a string that indicates whether the table layout is fixed.
textAlignRetrieves whether the text in the object is left-aligned, right-aligned, centered, or justified.
textAutospaceRetrieves the autospacing and narrow space width adjustment of text.
textDecorationRetrieves a value that indicates whether the text in the object has blink, line-through, overline, or underline decorations.
textIndentRetrieves the indentation of the first line of text in the object.
textJustifyRetrieves the type of alignment used to justify text in the object.
textJustifyTrimNot implemented.
textKashidaNot implemented.
textTransformRetrieves the rendering of the text in the object.
topRetrieves the position of the object relative to the top of the next positioned object in the document hierarchy.
unicodeBidiRetrieves the level of embedding with respect to the bidirectional algorithm.
verticalAlignRetrieves the vertical alignment of the object.
visibilitySets or retrieves whether the content of the object is displayed.
widthRetrieves the width of the object.
wordBreakRetrieves line-breaking behavior within words, particularly where multiple languages appear in the object.
zIndexRetrieves the stacking order of positioned objects.

Interface Information

Stock Implementationmshtml.dll
Custom ImplementationNo
Inherits fromIDispatch
Header and IDL filesMshtml.h, Mshtml.idl
Minimum availabilityInternet Explorer 5
Minimum operating systemsWindows 95, Windows NT 4.0, Windows CE 4.0

See Also

 

 

IHTMLCurrentStyle2 Interface

Enables you to programmatically access the style properties of an element.

IHTMLCurrentStyle2 Members

filterRetrieves the filter or collection of filters applied to the object.
hasLayoutGets a value that indicates whether the object has layout.
isBlockGets a value that indicates whether the object is a block-level object.
layoutFlowRetrieves the direction and flow of the content in the object.
scrollbar3dLightColorRetrieves the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
scrollbarArrowColorRetrieves the color of the arrow elements of a scroll arrow.
scrollbarBaseColorRetrieves the color of the main elements of a scroll bar, which include the scroll box, track, and scroll arrows.
scrollbarDarkShadowColorRetrieves the color of the gutter of a scroll bar.
scrollbarFaceColorRetrieves the color of the scroll box and scroll arrows of a scroll bar.
scrollbarHighlightColorRetrieves the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
scrollbarShadowColorRetrieves the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
scrollbarTrackColorRetrieves the color of the track element of a scroll bar.
textAlignLastRetrieves how to align the last line or only line of text in the object.
textKashidaSpaceRetrieves the ratio of kashida expansion to white space expansion when justifying lines of text in the object.
textUnderlinePositionRetrieves the position of the underline decoration that is set through the IHTMLStyle::textDecoration property of the object.
wordWrapRetrieves whether to break words when the content exceeds the boundaries of its container.
writingModeRetrieves the direction and flow of the content in the object.
zoomRetrieves the magnification scale of the object.

Interface Information

Stock Implementationmshtml.dll
Custom ImplementationNo
Inherits fromIDispatch
Header and IDL filesmshtml.h, mshtml.idl
Minimum availabilityInternet Explorer 5.5
Minimum operating systemsWindows 95, Windows NT 4.0, Windows CE 4.0

See Also

 

 

 

IHTMLCurrentStyle3 Interface

Extends the IHTMLCurrentStyle2 interface.

IHTMLCurrentStyle3 Members

minHeightRetrieves the minimum height for an element.
textOverflowSets or retrieves a value that indicates whether to render ellipses(...) to indicate text overflow.
whiteSpaceRetrieves a value that indicates whether lines are automatically broken inside the object.
wordSpacingRetrieves the amount of additional space between words in the object.

Interface Information

Stock Implementationmshtml.dll
Custom ImplementationNo
Inherits fromIDispatch
Header and IDL filesmshtml.h, mshtml.idl
Minimum availabilityInternet Explorer 6
Minimum operating systemsWindows 98, Windows NT 4.0, Windows CE 4.0

See Also

 

 

 

 

IHTMLCurrentStyle4 Interface

Extends the IHTMLCurrentStyle3 interface.

IHTMLCurrentStyle4 Members

maxHeightRetrieves the maximum height for an element.
maxWidthRetrieves the maximum width for an element.
minWidthRetrieves the minimum width for an element.
msInterpolationModeRetrieves the interpolation (resampling) method used to stretch images.

Interface Information

Stock Implementationmshtml.dll
Custom ImplementationNo
Inherits fromIDispatch
Header and IDL filesmshtml.h, mshtml.idl
Minimum availabilityInternet Explorer 7
Minimum operating systemsWindows XP SP2

See Also

 

 

 

IHTMLCurrentStyle5 Interface

 

Extends the IHTMLCurrentStyle4 interface with Cascading Style Sheets, Level 2.1 (CSS2.1)  World Wide Web link properties for Internet Explorer 8.

IHTMLCurrentStyle5 Members

borderSpacingSets or retrieves the distance between the borders of adjoining cells in a table.
boxSizingRetrieves the box model to use for object sizing.
captionSideRetrieves where the caption of a table is located.
contentRetrieves generated content to insert before or after an element.
counterIncrementRetrieves a list of counters to increment.
counterResetRetrieves a list of counters to create or reset to zero.
emptyCellsDetermines whether to show or hide a cell without content.
msBlockProgressionRetrieves the block progression and layout orientation.
orphansRetrieves the minimum number of lines of a paragraph that must appear at the bottom of a page.
outlineRetrieves the color, style, and width of the outline frame.
outlineColorRetrieves the color of the outline frame.
outlineStyleRetrieves the style of the outline frame.
outlineWidthRetrieves the width of the outline frame.
pageBreakInsideRetrieves a string indicating whether a page break is allowed to occur inside the object.
quotesRetrieves the pairs of strings to be used as quotes in generated content.
widowsRetrieves the minimum number of lines of a paragraph that must appear at the top of a page.

Remarks

For a full list of Cascading Style Sheets (CSS) modules, see IHTMLStyle6.

Interface Information

Stock Implementationmshtml.dll
Custom ImplementationNo
Inherits fromIDispatch
Header and IDL filesmshtml.h, mshtml.idl
Minimum availabilityInternet Explorer 8
Minimum operating systemsWindows XP SP2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值