XML的显示--CSS

通过CSS样式表,设置XML文档中每个标记的显示方式。
booklist.css
 
/* CSS Document */
booklist
{
display
: block;
margin
: 2px;
padding
: 2px;
width
: 300px;
border
: 1px solid #000000;
font
: 12px georgia;
}

book
{
display
: block;
margin
: 2px;
padding
: 2px;
border
: 1px solid #000000;
}

name
{
display
: block;
font-style
: italic;
font-weight
: bold;
}

price
{
display
: block;
font-family
: georgia;
}

description
{
display
: block;
font-size
: 11px;
}

publisher
{
display
: block;
font-size
: 11px;
}

booklist.xml
引用CSS样式表
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE booklist [
<!ENTITY publisher "ABC company"
>
]>
<?xml-stylesheet type="text/css" href="booklist.css"?>
<booklist>
<book>
<name>Ajax</name>
<price>$5.95</price>
<description>Foundations of Ajax.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>Ajax Patterns</name>
<price>$7.95</price>
<description>Introduction of Ajax Patterns.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>Ajax Web App</name>
<price>$8.95</price>
<description>Edition 2.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>Core CSS</name>
<price>$4.50</price>
<description>A book for CSS.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>JSF and Ajax</name>
<price>$6.95</price>
<description>Apress.</description>
<publisher>&publisher;</publisher>
</book>
</booklist>
运行结果:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值