• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

B. Introduction to Stylesheets > Internal Stylesheets

Internal Stylesheets

If you want the style specification to apply to all <circle> elements in a single document, add an internal stylesheet. A style sheet consists of selectors (the names of the elements you want to affect) and the style specifications for those selectors. The style specification is enclosed in curly braces. The following applies styles to <circle> and <rect> elements:

<style type="text/css"><![CDATA[
      circle {
        stroke: red; stroke-width: 3px;
        fill: #ccccff;
      }
      rect { fill: gray; stroke: black; }
     ]]></style>

When you put a <style> element into an SVG document, you should enclose its contents within <![[CDATA[ and ]]>. This notation tells XML parsers that the contents are pure character data and should not, under any circumstances, be treated as information for XML to parse.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint