Style#

Internal Stylesheets

class svgwrite.container.Style(content='', **extra)#

The style element allows style sheets to be embedded directly within SVG content. SVG’s style element has the same attributes as the corresponding element in HTML.

Style.__init__(content='', **extra)#
参数:

content (string) – stylesheet content

Style.append(content)#

Append content to the existing element-content.

Best place for the style element is the defs attribute of the Drawing class:

drawing.defs.add(drawing.style('stylesheet-content'))

父类#

Parent Classes

SVG 属性#

SVG Attributes

  • typestring

    默认值为 'text/css'

  • titlestring

    (为了与 HTML 4 兼容)此属性为 style 元素指定一个建议性的标题。

  • mediastring

    此属性指定样式信息的目标媒介。可以是单个媒介描述符或逗号分隔的列表。 该属性的默认值为 'all'

  • typestring

    default is 'text/css'

  • titlestring

    (For compatibility with HTML 4.) This attribute specifies an advisory title for the ‘style’ element.

  • mediastring

    This attribute specifies the intended destination medium for style information. It may be a single media descriptor or a comma-separated list. The default value for this attribute is 'all'.

标准 SVG 属性#

Standard SVG Attributes