百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>CSS教程> 怎样运用CSS显示XML
分享文章到:

怎样运用CSS显示XML

发布时间:11/01 来源:未知 浏览: 关键词:
运用CSS显示XML的办法:第一打开响应的代码文件;然后通过“<?xml-stylesheettype"textcss"href"cd_catalog.css"?>”办法把XML文件链接到CSS文件即可。

运用CSS显示XML的办法:第一打开响应的代码文件;然后通过“”办法把XML文件链接到CSS文件即可。

运用 CSS 显示 XML

通过运用 CSS,可为 XML 文档增加显示信息。

运用 CSS 显示您的 XML?

运用 CSS 来格局化 XML 文档是有可能的。

下面的例子就是对于怎样运用 CSS 样式表来格局化 XML 文档:

这是 XML 文件:CD 名目

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



Empire Burlesque
Bob Dylan
USA
Columbia
10.90
1985


Hide your heart
Bonnie Tyler
UK
CBS Records
9.90
1988


Greatest Hits
Dolly Parton
USA
RCA
9.90
1982


Still got the blues
Gary Moore
UK
Virgin records
10.20
1990


Eros
Eros Ramazzotti
EU
BMG
9.90
1997


One night only
Bee Gees
UK
Polydor
10.90
1998


Sylvias Mother
Dr.Hook
UK
CBS
8.10
1973


Maggie May
Rod Stewart
UK
Pickwick
8.50
1990


Romanza
Andrea Bocelli
EU
Polydor
10.80
1996


When a man loves a woman
Percy Sledge
USA
Atlantic
8.70
1987


Black angel
Savage Rose
EU
Mega
10.90
1995


1999 Grammy Nominees
Many
USA
Grammy
10.20
1999


For the good times
Kenny Rogers
UK
Mucik Master
8.70
1995


Big Willie style
Will Smith
USA
Columbia
9.90
1997


Tupelo Honey
Van Morrison
UK
Polydor
8.20
1971


The very best of
Cat Stevens
UK
Island
8.90
1990


Stop
Sam Brown
UK
A and M
8.90
1988


Bridge of Spies
T'Pau
UK
Siren
7.90
1987


Private Dancer
Tina Turner
UK
Capitol
8.90
1983


Midt om natten
Kim Larsen
EU
Medley
7.80
1983


Pavarotti Gala Concert
Luciano Pavarotti
UK
DECCA
9.90
1991


The dock of the bay
Otis Redding
USA
Atlantic
7.90
1987


Picture book
Simply Red
EU
Elektra
7.20
1985


Red
The Communards
UK
London
7.80
1987


Unchain my heart
Joe Cocker
USA
EMI
8.20
1987

这是样式表:CSS 文件

CATALOG
{
background-color: #ffffff;
width: 100%;
}
CD
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
}
TITLE
{
color: #FF0000;
font-size: 20pt;
}
ARTIST
{
color: #0000FF;
font-size: 20pt;
}
COUNTRY,PRICE,YEAR,COMPANY
{
display: block;
color: #000000;
margin-left: 20pt;
}

最后,请查看结果:由 CSS 文件格局化的 CD 名目

下面是此XML文件的一个片断。 第二行,,把这个 XML 文件链接到 CSS 文件:




  
    Empire Burlesque
    Bob Dylan
    USA
    Columbia
    10.90
    1985
  
  
    Hide your heart
    Bonnie Tyler
    UK
    CBS Records
    9.90
    1988
  
.
.
.
.

注释:运用 CSS 格局化 XML 不是常用的办法,更不克不及代表 XML 文档样式化的将来。W3C 举荐运用 XSLT。

以上就是怎样运用CSS 显示 XML的细致内容,更多请关注 百分百源码网 其它相干文章!

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有152人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板