My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Reference  
Complete listing of all tags, selectors, psuedo selectors, and css rules supported
Updated Aug 27, 2010 by underbluewaters

Selectors

Selectors are used to specify the scope of the rules you define in your stylesheet. If you have experience using CSS to style HTML documents this should be quite familiar, although the element names, attributes, and pseudo classes have changed.

id

Just like with HTML and CSS, you can use id selectors to scope a rule to a single element.

<Folder id="myId">
    <Placemark>...</Placemark>
    <Placemark>...</Placemark>
</Folder>
<Folder id="anotherId">
</Folder>
#myId {
    listStyle: radioFolder;
}

In this case only the children of the "myId" Folder would be displayed as radio options.

attribute selectors

Attribute selectors work as described in the W3C Attribute selectors documentation, though instead of matching against attributes on an element, they can match either the name tag on a KML element or values within the ExtendedData.

<Folder>
    <name>example</name>
    <Placemark>
        <name>stlr</name>
        <Point>
            <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
        </Point>
        <ExtendedData>
            <Data name="id">
                <value>12</value>
            </Data>
            <Data name="type">
                <value>stlr</value>
            </Data>
            <Data name="year">
                <value>1992</value>
            </Data>
            <Data name="count">
                <value>19</value>
            </Data>
        </ExtendedData>
    </Placemark>
</Folder>

For example, either of these selectors will select this single placemark:

Placemark[name="stlr"]
Placemark[year="1992"]

special attribute selectors

Beyond name and ExtendedData values, the following special attributes can be used. They all begin with a hyphen(-) to avoid clashing with ExtendedData field names.

attribute name type description
-area area used to select polygons over or under a specified area.
-length length used to select features over or under a specified area.
-screen-size px When used a KML Region will be created using the Placemark's geometry and the minLODPixels or maxLODPixels set depending on the comparison operator used.
-datetime datetime desc
-filesize size (megabytes, kilobytes) desc

:hover pseudo selector

Style Rules

Basic Styling

This

Powered by Google Project Hosting