ZVON > References > Zvon Example Repository
Example repository: index | categories | search

All > SVG > Style > style-selector-BE-03


File: style-selector-BE-03
Author: Chris lilley
Origin: W3C SVG conformance suite

Rendered imageSVG source
ElementsAttributes
axlink:href |
circleclass | cx | cy | r |
defs
descid |
gclass | id | style | transform |
pathd | style |
polygonclass | points |
rectclass | height | id | style | width | x | y |
styletype |
svgheight | id | width |
textstyle | x | y |
titleid |

Source

<svg id="svg-root" width="450" height="450" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" >
     <title id="test-title">style-selector-BE-03</title>
     <desc id="test-desc"> Test that viewer handles combinations of the simple CSS2 selectors: ancestor, child, sibling.</desc>
     <g id="test-body-content">
          <defs>
               <style type="text/css"> .mummy circle, .mummy rect, .mummy polygon { fill: green} /* all shapes green */ .mummy > .thischild { fill: red } /* top rect red */ .primus + .secundus { fill: red } /* bottom rect red */ .mummy circle:first-child { fill: red} /* bottom circle red */ .mummy { fill: blue } /* make failure of ancestor selector obvious */ /* .gap { stroke: black; stroke-width: 3px } */ /* too complex for BE */ </style>
          </defs>
          <text style="font-family:Helvetica;font-size:12;" x="40" y="14">Rectangle should be red not green</text>
          <text style="font-family:Helvetica;font-size:12;" x="40" y="36">This tests ancestor selectors and child selectors</text>
          <g class="mummy">
               <rect class="thischild" x="220" y="80" width="60" height="40"/>
               <circle cx="160" cy="100" r="30"/>
               <g class="generation gap">
                    <polygon class="thischild" points="300,100, 320,120, 340,110, 360,120, 390,90, 340,70"/>
               </g>
          </g>
          <g transform="translate(0, 200)">
               <text style="font-family:Helvetica;font-size:12;" x="40" y="14">Circle should be red not green; rectangle still red</text>
               <text style="font-family:Helvetica;font-size:12;" x="40" y="36">This tests ancestor, immediate-sibling and first-child selectors</text>
               <g class="mummy">
                    <circle class="primus" cx="160" cy="100" r="30"/>
                    <rect class="secundus" x="220" y="80" width="60" height="40"/>
                    <polygon class="tertius" points="300,100, 320,120, 340,110, 360,120, 390,90, 340,70"/>
               </g>
          </g>
     </g>
     <g id="test-legend" style="fill:black;font-family:Helvetica;font-size:10;">
          <rect x="10" y="390" width="275" height="50" style="fill:none;stroke:#000000;"/>
          <path style="fill:none;stroke:#000000;" d="M10 405 h275 M205 405 v35 M10 426 h195 M205 422 h80"/>
          <text x="25" y="401">Scalable Vector Graphics (SVG) Conformance Suite</text>
          <a xlink:href="copyright-documents-19990405.html">
               <text x="12" y="437" style="fill:blue;"> Copyright 2000 W3C. All Rights Reserved. </text>
          </a>
          <text style="font-size:12;" x="35" y="420">style-selector-BE-03</text>
          <text style="font-size:10;" x="210" y="417">$Revision: 1.1 $</text>
          <text style="font-size:10;" x="210" y="435">Release 2.0</text>
          <rect id="test-frame" x="1" y="1" width="448" height="448" style="fill:none;stroke:#000000;"/>
     </g>
</svg>



Sponsored links: Domain Names, VoIP Internettelefonie, DSL, SDSL, ADSL, UNLIMITED Web Hosting by HostDepartment, conference call service, answering service