首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

tref

弃用

该功能已从Web标准中删除。尽管一些浏览器可能仍然支持,但它正在被丢弃。避免使用它并尽可能更新现有的代码; 请参阅本页面底部的兼容性表格来指导您的决定。请注意,此功能可能随时停止工作。

<text>SVG元素的文本内容可以是直接嵌入到<text>元素中的字符数据,也可以是引用元素的字符数据内容,其中引用是通过<tref>元素指定的。

用法上下文

分类

文本内容元素,文本内容子元素

允许的内容

以任意顺序包含以下任意数量的元素:描述性元素<animate>,<animateColor>,<set>

属性

全局属性

  • Conditional processing attributes
  • Core attributes
  • Graphical event attributes
  • Presentation attributes
  • Xlink attributes
  • class
  • style
  • externalResourcesRequired

具体属性

  • xlink:hrefDOM InterfaceThis element implements the SVGTRefElement interface.Example<svg width="100%" height="100%" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <text id="ReferencedText"> Referenced character data </text> </defs> <text x="100" y="100" font-size="45" > Inline character data </text>  <text x="100" y="200" font-size="45" fill="red" > <tref xlink:href="#ReferencedText"/> </text> <!-- Show outline of canvas using 'rect' element --> <rect x="1" y="1" width="998" height="298" fill="none" stroke-width="2" /> </svg>SpecificationsSpecificationStatusCommentScalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<font>' in that specification.RecommendationInitial definitionBrowser compatibilityFeatureChromeFirefox (Gecko)Internet ExplorerOperaSafariBasic supportNo supportNo support???FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileBasic support?No support???See also

扫码关注腾讯云开发者

领取腾讯云代金券