Is there a way to create your own html tag in HTML5?

后端 未结 18 1805
情歌与酒
情歌与酒 2020-11-22 07:39

I want to create something like


    
        aaa
        bbb
    
          


        
18条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 08:06

    Besides writing an XSL stylesheet, as I described earlier, there is another approach, at least if you are certain that Firefox or another full-fledged XML browser will be used (i.e., NOT Internet Explorer). Skip the XSL transform, and write a complete CSS stylesheet that tells the browser how to format the XML directly. The upside here is that you wouldn't have to learn XSL, which many people find to be a difficult and counterintuitive language. The downside is that your CSS will have to specify the styling very completely, including what are block nodes, what are inlines, etc. Usually, when writing CSS, you can assume that the browser "knows" that , for instance, is an inline node, but it won't have any idea what to do with .

    Finally, its been a few years since I tried this, but my recollection is that IE (at least a few versions back) refused to apply CSS stylesheets directly to XML documents.

提交回复
热议问题