Cascading Style Sheets
Web authors gain unprecedented control over the look of documents with Cascading Style Sheets (CSS). This section contains a list of articles that are available for CSS.
Overviews/Tutorials
About Element PositioningWindows Internet Explorer supports the ability to position HTML elements in x- and y-coordinates and to overlap elements in planes along the z-axis, which extends toward and away from the viewer in a Web document. These capabilities allow authors to precisely place elements, images, controls, or text on to a web page. By using scripts to manipulate the position coordinates and other dynamic styles, authors can move elements around a page, creating animated effects. The combination of dynamic styles, positioning, transparent Microsoft ActiveX Controls, and transparent images presents authors with a rich set of animation options.
Color TableColors can be specified in HTML pages by using numbers to denote an RGB color value, or by using a color name. In Internet Explorer 9 and later, you can also define colors by hue-saturation-lightness (HSL) values and alpha transparency.
Compatibility in Internet Explorer 5.5This document describes the features in Microsoft Internet Explorer 5.5 that may not be compatible with applications you developed for earlier versions of Internet Explorer.
Controlling Presentation with Measurement and Location Properties In Quirks ModeDynamic HTML (DHTML) exposes measurement and location properties that you can use to change the size and position of HTML elements on your Web pages. When you understand what these properties are and how they affect elements on a page, you can achieve greater control over the appearance of your Web pages. For example, you can use these properties to design pages that are similar to documents in other applications, such as Microsoft PowerPoint or Microsoft Word.
Controlling Presentation with Measurement and Location Properties In Strict ModeDHTML exposes measurement and location properties that can be used to change the size and position of HTML elements on your web pages. An understanding of these properties and their impact on the elements in a page can help you achieve greater control over the layout of your websites. This article explains how you can use measurement and location properties to control the appearance of a web page that is rendered using the Internet Explorer 7 strict mode.
CSS How-to - Optimize Pages for Printing Using CSSUsing CSS print styles, you can control how your webpage will appear when users transfer the page's contents to paper (or other media) using a printer (or any output device listed in the user's Print dialog box).
CSS Improvements in Internet Explorer 8Internet Explorer 8 is fully compliant with the CSS, Level 2 Revision 1 (CSS2.1) specification and supports some features of CSS, Level 3 (CSS3). This topic is composed of a comprehensive list of the changes to CSS support in Internet Explorer 8.
CSS Length Units ReferenceThis topic defines the supported values and units for CSS
How to Fly Text in DHTMLThis article demonstrates both ways to implement flying text through the marquee element and through CSS positioning.
How to Manipulate Text Effects in Response to Mouse EventsSome DHTML effects require minimal scripting to attain. One such effect, activating text in response to mouse events, is achieved largely through the use of CSS rules and the className property. Creating text effects in this manner yields ease of maintenance and succinct code.
Introduction to Dynamic StylesYou can dynamically change the style of any HTML element in a document. You can change colors, fonts, spacing, indentation, position, and even the visibility of text. Because the DHTML Document Object Model (DOM) makes every HTML element and attribute accessible, it is easy to use scripts to dynamically read and change styles.
Managing Style SheetsDynamically changing CSS styles that are applied to documents is not limited to the inline styles (styles defined on HTML elements with the STYLE attribute). Global style sheets defined with a LINK or STYLE tag in the HEAD section of the document can be manipulated through script. Manipulating the global style sheet is a powerful way to dynamically change the styles that apply to Web pages.
Measuring Element Dimension and LocationThis topic is designed to help web developers understand how to access the dimension and location of elements on the page through the CSS Object Model (CSSOM) in Internet Explorer 9.
Printing and Style SheetsThe style and link elements support the MEDIA attribute, which defines the output device for the style sheet.
Understanding CSS SelectorsThe basic building blocks of a CSS style sheet are its style rules. Selectors are used to "select" elements on an HTML page so that they can be styled. Without selectors, there would be no way to determine how the rules should be applied. This article introduces the fundamentals of CSS declaration syntax, to describe how selectors are used.
Collections
importsRetrieves a collection of all the imported style sheets defined for the respective styleSheet object.
pagesRetrieves a collection of page objects, which represent @page rules in a styleSheet.
rulesRetrieves a collection of rules defined in a style sheet.
styleSheetsRetrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
Attributes/Properties
acceleratorGets or sets a string that indicates whether the object represents a keyboard shortcut.
backgroundGets or sets up to five separate background properties of the object.
backgroundAttachmentGets or sets how the background image is attached to the object within the document.
backgroundClipGets or sets the background painting area.
backgroundColorGets or sets the color behind the content of the object.
backgroundImageGets or sets the background image of the object.
backgroundOriginGets or sets the background positioning area of a box or multiple boxes.
backgroundPositionSets or retrieves the position of the background of the object.
backgroundPositionXGets or sets the x-coordinate of the backgroundPosition property.
backgroundPositionYGets or sets the y-coordinate of the backgroundPosition property.
backgroundRepeatGets or sets how the backgroundImage property of the object is tiled.
backgroundSizeGets or sets the size of the background images.
baselineShiftGets or sets a value that indicates how the dominant baseline should be repositioned relative to the dominant baseline of the parent text content element.
behaviorGets or sets the location of the DHTML behavior.
borderSets or retrieves the properties to draw around the object.
borderBottomSets or retrieves the properties of the bottom border of the object.
borderBottomColorGets or sets the color of the bottom border of the object.
borderBottomLeftRadiusGets or sets one or two values that define the radii of the quarter ellipse that defines the shape of the lower-left corner for the outer border edge of the current box.
borderBottomRightRadiusGets or sets one or two values that define the radii of the quarter ellipse that defines the shape of the lower-right corner for the outer border edge of the current box.
borderBottomStyleGets or sets the style of the bottom border of the object.
borderBottomWidthGets or sets the width of the bottom border of the object.
borderCollapseGets or sets 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.
borderColorGets or sets the border color of the object.
borderLeftSets or retrieves the properties of the left border of the object.
borderLeftColorGets or sets the color of the left border of the object.
borderLeftStyleGets or sets the style of the left border of the object.
borderLeftWidthGets or sets the width of the left border of the object.
borderRadiusGets or sets one or more values that define the radii of a quarter ellipse that defines the shape of the corners for the outer border edge of the current box.
borderRightSets or retrieves the properties of the right border of the object.
borderRightColorGets or sets the color of the right border of the object.
borderRightStyleGets or sets the style of the right border of the object.
borderRightWidthGets or sets the width of the right border of the object.
borderSpacingGets or sets the distance between the borders of adjoining cells in a table.
borderStyleGets or sets the style of the left, right, top, and bottom borders of the object.
borderTopSets or retrieves the properties of the top border of the object.
borderTopColorGets or sets the color of the top border of the object.
borderTopLeftRadiusGets or sets one or two values that define the radii of the quarter ellipse that defines the shape of the upper-left corner for the outer border edge of the current box.
borderTopRightRadiusGets or sets one or two values that define the radii of the quarter ellipse that defines the shape of the upper-right corner for the outer border edge of the current box.
borderTopStyleGets or sets the style of the top border of the object.
borderTopWidthGets or sets the width of the top border of the object.
borderWidthGets or sets the width of the left, right, top, and bottom borders of the object.
bottomGets or sets the bottom position of the object in relation to the bottom of the next positioned object in the document hierarchy.
boxShadowGets or sets a comma-separated list of shadows that attaches one or more drop shadows to the current box.
boxSizingGets or sets the box model to use for object sizing.
captionSideGets or sets where the caption of a table is located.
clearGets or sets whether the object allows floating objects on its left side, right side, or both, so that the next text displays past the floating objects.
clipSets or retrieves which part of a positioned object is visible.
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.
colorGets or sets the color of the text of the object.
contentGets or sets generated content to insert before or after an element.
counterIncrementGets or sets a list of counters to increment.
counterResetGets or sets a list of counters to create or reset to zero.
cssTextGets or sets the persisted representation of the style rule.
cursorGets or sets the type of cursor to display as the mouse pointer moves over the object.
directionGets or sets the reading order of the object.
displayGets or sets whether the object is rendered.
dominantBaselineGets or sets a value that determines or redetermines a scaled-baseline table.
emptyCellsDetermines whether to show or hide a cell without content.
fillGets or sets a value that indicates the color to paint the interior of the given graphical element.
fillOpacityGets or sets a value that specifies the opacity of the painting operation that is used to paint the interior of the current object.
fillRuleGets or sets a value that indicates the algorithm that is to be used to determine what parts of the canvas are included inside the shape.
filterGets or sets the filter or collection of filters that are applied to the object.
fontSets or retrieves a combination of separate font properties of the object. Alternatively, sets or retrieves one or more of six user-preference fonts.
fontFamilyGets or sets the name of the font used for text in the object.
fontSizeGets or sets a value that indicates the font size used for text in the object.
fontSizeAdjustGets or sets a value that specifies an aspect value for an element that will effectively preserve the x-height of the first choice font, whether it is substituted or not.
fontStretchGets or sets a value that indicates a normal, condensed, or expanded face of a font family.
fontStyleGets or sets the font style of the object as
fontVariantitalic,normal, oroblique.Gets or sets whether the text of the object is in small capital letters.
fontWeightGets the numeric weight of the font of the object.
fontWeightGets or sets the weight of the font of the object.
glyphOrientationHorizontalGets or sets a value that alters the orientation of a sequence of characters relative to an inline-progression-direction of horizontal.
glyphOrientationVerticalGets or sets a value that alters the orientation of a sequence of characters relative to an inline-progression-direction of vertical.
hasLayoutGets a value that indicates whether the object has layout.
heightGets or sets the height of the object.
imeModeGets or sets the state of an Input Method Editor (IME).
kerning
Gets or sets a value that indicates whether Internet Explorer should adjust inter-glyph spacing based on kerning tables that are included in the relevant font (that is, enable auto-kerning) or instead disable auto-kerning and set inter-character spacing to a specific length (typically zero).
layoutFlowGets or sets the direction and flow of the content in the object.
layoutGridSets or retrieves the composite document grid properties that specify the layout of text characters.
layoutGridCharGets or sets the size of the character grid used for rendering the text content of an element.
layoutGridLineGets or sets the gridline value used for rendering the text content of an element.
layoutGridModeGets or sets whether the text layout grid uses two dimensions.
layoutGridTypeGets or sets the type of grid used for rendering the text content of an element.
leftGets or sets the position of the object relative to the left edge of the next positioned object in the document hierarchy.
letterSpacingGets or sets the amount of additional space between letters in the object.
lineBreakGets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean.
lineHeightGets or sets the distance between lines in the object.
listStyleSets or retrieves up to three separate listStyle properties of the object.
listStyleImageGets or sets a value that indicates which image to use as a list-item marker for the object.
listStylePositionGets or sets a variable that indicates how the list-item marker is drawn relative to the content of the object.
listStyleTypeGets or sets the predefined type of the line-item marker for the object.
marginGets or sets the width of the top, right, bottom, and left margins of the object.
marginBottomGets or sets the height of the bottom margin of the object.
marginLeftGets or sets the width of the left margin of the object.
marginRightGets or sets the width of the right margin of the object.
marginTopGets or sets the height of the top margin of the object.
markerGets or sets a value that specifies the marker symbol that is used for all vertices on the given path element or basic shape.
markerEndGets or sets a value that defines the arrowhead or polymarker that is drawn at the final vertex of a given path element or basic shape.
markerMidGets or sets a value that defines the arrowhead or polymarker that is drawn at every other vertex (that is, every vertex except the first and last) of a given path element or basic shape.
markerStartGets or sets a value that defines the arrowhead or polymarker that is drawn at the first vertex of a given path element or basic shape.
maskGets or sets a value that indicates a Scalable Vector Graphics (SVG) mask.
maxHeightGets or sets the maximum height for an element.
maxWidthGets or sets the maximum width for an element.
minHeightGets or sets the minimum height for an element.
minWidthGets or sets the minimum width for an element.
msBlockProgressionGets or sets the block progression and layout orientation.
msInterpolationModeObsolete. Gets or sets the interpolation (resampling) method used to stretch images.
msTransformGets or sets a list of one or more transform functions that specify how to translate, rotate, or scale an element in 2-D space.
msTransformOriginGets or sets one or two values that establish the origin of transformation for an element.
opacityGets or sets a value that specifies object or group opacity in CSS or SVG.
orphansGets or sets the minimum number of lines of a paragraph that must appear at the bottom of a page.
outlineGets or sets the color, style, and width of the outline frame.
outlineColorGets or sets the color of the outline frame.
outlineStyleGets or sets the style of the outline frame.
outlineWidthGets or sets the width of the outline frame.
overflowGets or sets a value indicating how to manage the content of the object when the content exceeds the height or width of the object.
overflowXGets or sets how to manage the content of the object when the content exceeds the width of the object.
overflowYGets or sets how to manage the content of the object when the content exceeds the height of the object.
paddingGets or sets the amount of space to insert between the object and its margin or, if there is a border, between the object and its border.
paddingBottomGets or sets the amount of space to insert between the bottom border of the object and the content.
paddingLeftGets or sets the amount of space to insert between the left border of the object and the content.
paddingRightGets or sets the amount of space to insert between the right border of the object and the content.
paddingTopGets or sets the amount of space to insert between the top border of the object and the content.
pageBreakAfterGets or sets a value indicating whether a page break occurs after the object.
pageBreakBeforeGets or sets a string indicating whether a page break occurs before the object.
pageBreakInsideGets or sets a string indicating whether a page break is allowed to occur inside the object.
pixelBottomSets or retrieves the bottom position of the object.
pixelHeightSets or retrieves the height of the object.
pixelLeftSets or retrieves the left position of the object.
pixelRightSets or retrieves the right position of the object.
pixelTopSets or retrieves the top position of the object.
pixelWidthSets or retrieves the width of the object.
pointerEventsGets or sets a value that specifies under what circumstances a given graphics element can be the target element for a pointer event in SVG.
posBottomSets or retrieves the bottom position of the object in the units specified by the bottom attribute.
posHeightSets or retrieves the height of the object in the units specified by the height attribute.
positionGets or sets the type of positioning used for the object.
posLeftSets or retrieves the left position of the object in the units specified by the left attribute.
posRightSets or retrieves the right position of the object in the units specified by the right attribute.
posTopSets or retrieves the top position of the object in the units specified by the top attribute.
posWidthSets or retrieves the width of the object in the units specified by the width attribute.
quotesGets or sets the pairs of strings to be used as quotes in generated content.
rightGets or sets the position of the object relative to the right edge of the next positioned object in the document hierarchy.
rubyAlignGets or sets the position of the ruby text specified by the rt object.
rubyOverhangGets or sets the position of the ruby text specified by the rt object.
rubyPositionGets or sets the position of the ruby text specified by the rt object.
scrollbar3dLightColorGets or sets the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
scrollbarArrowColorGets or sets the color of the arrow elements of a scroll arrow.
scrollbarBaseColorGets or sets the color of the main elements of a scroll bar, which include the scroll box, track, and scroll arrows.
scrollbarDarkShadowColorGets or sets the color of the gutter of a scroll bar.
scrollbarFaceColorGets or sets the color of the scroll box and scroll arrows of a scroll bar.
scrollbarHighlightColorGets or sets the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
scrollbarShadowColorGets or sets the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
scrollbarTrackColorGets or sets the color of the track element of a scroll bar.
stopColorGets or sets a value that indicates what color to use at the current gradient stop.
stopOpacityGets or sets a value that defines the opacity of the current gradient stop.
strokeGets or sets a value that indicates the color to paint along the outline of a given graphical element.
strokeDasharrayGets or sets one or more values that indicate the pattern of dashes and gaps used to stroke paths.
strokeDashoffsetGets or sets a value that specifies the distance into the dash pattern to start the dash.
strokeLinecapGets or sets a value that specifies the shape to be used at the end of open subpaths when they are stroked.
strokeLinejoinGets or sets a value that specifies the shape to be used at the corners of paths or basic shapes when they are stroked.
strokeMiterlimitGets or sets a value that indicates the limit on the ratio of the length of miter joins (as specified in the strokeLinejoin property).
strokeOpacityGets or sets a value that specifies the opacity of the painting operation that is used to stroke the current object.
strokeWidthGets or sets a value that specifies the width of the stroke on the current object.
styleFloatGets or sets on which side of the object the text will flow.
tableLayoutGets or sets a string that indicates whether the table layout is fixed.
textAlignGets or sets whether the text in the object is left-aligned, right-aligned, centered, or justified.
textAlignLastGets or sets how to align the last line or only line of text in the object.
textAutospaceGets or sets the autospacing and narrow space width adjustment of text.
textDecorationGets or sets a value that indicates whether the text in the object has blink, line-through, overline, or underline decorations.
textDecorationBlink
Sets or retrieves a Boolean value that indicates whether the object's textDecoration property has a value of "blink."
textDecorationLineThroughSets or retrieves a Boolean value indicating whether the text in the object has a line drawn through it.
textDecorationNoneSets or retrieves the Boolean value indicating whether the textDecoration property for the object has been set to
textDecorationOverlinenone.Sets or retrieves a Boolean value indicating whether the text in the object has a line drawn over it.
textDecorationUnderlineSets or retrieves whether the text in the object is underlined.
textIndentGets or sets the indentation of the first line of text in the object.
textJustifyGets or sets the type of alignment used to justify text in the object.
textKashidaSpaceGets or sets the ratio of kashida expansion to white space expansion when justifying lines of text in the object.
textOverflowGets or sets a value that indicates whether to render ellipses(...) to indicate text overflow.
textTransformGets or sets the rendering of the text in the object.
textUnderlinePositionGets or sets the position of the underline decoration that is set through the textDecoration property of the object.
topGets or sets the position of the object relative to the top of the next positioned object in the document hierarchy.
typeRetrieves the CSS language in which the style sheet is written.
unicodeBidiGets or sets the level of embedding with respect to the bidirectional algorithm.
verticalAlignGets or sets the vertical alignment of the object.
visibilityGets or sets whether the content of the object is displayed.
whiteSpaceGets or sets a value that indicates whether lines are automatically broken inside the object.
widowsGets or sets the minimum number of lines of a paragraph that must appear at the top of a document.
widthGets or sets the width of the object.
wordBreakGets or sets line-breaking behavior within words, particularly where multiple languages appear in the object.
wordSpacingGets or sets the amount of additional space between words in the object.
wordWrapGets or sets whether to break words when the content exceeds the boundaries of its container.
writingModeGets or sets the direction and flow of the content in the object.
zIndexGets or sets the stacking order of positioned objects.
zoomGets or sets the magnification scale of the object.
Methods
addImportAdds a style sheet to the imports collection for the specified style sheet.
addRuleCreates a new rule for a style sheet.
createStyleSheetCreates a style sheet for the document.
getExpressionRetrieves the expression for the given property.
removeExpressionRemoves the expression from the specified property.
removeImportRemoves the imported style sheet from the imports collection based on ordinal position.
removeRuleDeletes an existing style rule for the styleSheet object, and adjusts the index of the rules collection accordingly.
setExpressionSets an expression for the specified object.