加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

XML样式

发布时间:2020-12-16 08:03:25 所属栏目:百科 来源:网络整理
导读:今天写了一个简单的XML,丢到浏览器中时有这样的提示: This XML file does not appear to have any style information associated with it. The document tree is shown below. 这是“XML样式”的问题。 可以有两种方式定义XML的样式:CSS和XSLT。 CSS的例

今天写了一个简单的XML,丢到浏览器中时有这样的提示:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

这是“XML样式”的问题。

可以有两种方式定义XML的样式:CSS和XSLT。

CSS的例子如下:

test.xml

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="test.css"?> 
<test>
<name>OldWang</name>
<sex>male</sex>
<birthday>8.22</birthday>
<skill>AI</skill>
</test>

test.css

resume{ display: block;}
name{ display: block; font-size:120%;}
sex{ display:block; text-indent:2em}
birthday{ display:block; text-indent:2em}
skill{ display:block; text-indent:2em}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读