以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML源码及示例(仅原创和转载) 』  (http://bbs.xml.org.cn/list.asp?boardid=32)
----  如何用 css 来实现 sml 的 显示  (http://bbs.xml.org.cn/dispbbs.asp?boardid=32&rootid=&id=8664)


--  作者:math_xiaoxin
--  发布时间:7/7/2004 2:59:00 PM

--  如何用 css 来实现 sml 的 显示
我的代码如下:

7.5.xml:

<?xml version="1.0" encoding = "gb2312"?>
<?xml-stylesheet type = "text/css" href = "7.5css"?>
<poem>
<title> 送陈章普</title>
<author>
    <dynasty> 唐</dynasty>
    <name> 李颀</name>
</author>
<content>
四月南风大麦黄,造化为洛铜冶厂。
青山找别母换件,司马出门四九项。
陈侯立身和坦荡,求徐虎美仍达说。
傅钟珠出一万卷,不肯低头在草莽。
</content>
</poem>


7.5.css:

poem
{display:block;
margin:3em;
width:27em;
height:27em;
border-tyle:groove;
border-width:5px;
border-color:black;
padding:5em;}
title
{display:block;
text-align:center;
font-size:14pt;
font-weight:bolder;}
author
{display:block;
font-size:10pt;
text-align:center;}
dynasty
{font-weight:bolder;}
name
{letter-spacing:1em;}
content
{display:block;
text-align:center;}


可是显示结果很令人失望:


此主题相关图片如下:
按此在新窗口浏览图片


--  作者:diegor
--  发布时间:7/20/2004 4:15:00 PM

--  
注意: 7.5css,连接错误


看看下面代码就是好的!

XML Source document (sample.xml)

<?xml version='1.0'?>
<?xml-stylesheet type="text/css" href="sample.css"?>
<book-review>
   <book>
      <headline><title>A Good Book</title></headline>
      <headline><author>Robert Brown</author></headline>
      <headline><publisher>The Publisher</publisher></headline>
      <headline><date>Feb. 16, 2000</date></headline>
   </book>
   <Review>
<title>A Good Book</title> by <author>Rober Brown</author>, published by <publisher>The Publisher</publisher> on <date>Feb. 16, 2000</date>, is indeed a very good book.
   </Review>
</book-review>
Cascading Style Sheet (sample.css)

title {display:inline; color:red}
author {display:inline; font-style:italic}
publisher {display:inline; color:olive}
date {display:inline; color:blue}
review {display:block; font-size:12}
book {display:block; font-size:16; font-weight:bold}
headline {display:block; margin:1em}


--  作者:anders_wen
--  发布时间:8/2/2004 12:50:00 AM

--  
我觉得非常奇怪,为什么开始怎么都连接不进去css文件,但是在我改成一楼这种css格式以后就连接进去了(到xml)。然后我把css格式又改成我开始写的那种格式,而这次居然连接成功了,真不知道为什么???有哪位高手可以解释一下为什么吗?
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
66.406ms