The Imports Collection

The Imports collection is Internet Explorer 4.0 specific.

The Imports collection is a collection of all the imported style sheets, defined for the StyleSheet Object. (An imported style sheet is one that has been included in the document using the @import Style Sheet attribute in a <STYLE>. Note that the imports collection can only be accessed through the StyleSheet Object.

<STYLE TYPE="text/css" ID="CSS1">
@import: url ( Sheets/newstyle.css)
@import: url ( Sheets/bigred.css)
@import: url ( Sheets/bigblue.css)
@import: url ( Sheets/crazy.css)
H1 {font-size : 24pt; color : red}



would return Sheets/bigblue.css - the location of the third imported stylesheet for the document. (Note the use of the StyleSheets collection to interrogate the imports collection.


The length property returns the number of elements in the collection. Note that the length count starts at 1, not 0 as the imports collection index does.


The item method retrieves single items, or sub-collections from the all collection. It accepts the following arguments:


For the imports collection, the index argument can only be a number, representing the index of the imported stylesheet of interest.