使用CSS來顯示XML

來源:互聯網
上載者:User

標籤:style   blog   http   color   io   os   使用   ar   資料   

 

實現效果
學號 姓名 班級 課程 教師

表格背景設為綠色,儲存格置中顯示

學號部分,藍色字型,16磅大小;

姓名部分紅色字型,帶有底線,12磅大小

班級課程名,教師,綠色字型,12磅大小

 XML代碼:

 1 <?xml version="1.0" encoding="UTF8"?> 2 <?xml-stylesheet type="text/css" href="student.css"?> 3 <students> 4 <student> 5 <sid>學號</sid> 6 <sname>姓名</sname> 7 <sclass>班級</sclass> 8 <scourse>課程</scourse> 9 <teacher>任課教師</teacher>10 </student>11 <student>12 <sid>1215115001</sid>13 <sname>果果</sname>14 <sclass>軟體設計</sclass>15 <scourse>資料結構</scourse>16 <teacher>王岷</teacher>17 </student>18 19 <student>20 <sid>1215115001</sid>21 <sname>明明</sname>22 <sclass>資料庫</sclass>23 <scourse>演算法分析</scourse>24 <teacher>王博</teacher>25 </student>26 <student>27 <sid>1215115001</sid>28 <sname>貝貝</sname>29 <sclass>遊戲開發</sclass>30 <scourse>資料庫編程</scourse>31 <teacher>陸路</teacher>32 </student>33 </students>

css代碼:

 1 students 2 { 3     border:1px solid; 4     color: #33FF66; 5     width:500px; 6     height:170px; 7  text-align:center; 8  vertical-align: middle; 9  position:middle;10 }11 student12 {13 background-color:#33FF66;14 display:block;15 margin:5px 5px 5px 5px ;16 border:1px solid;//表格邊框17 width:500px;18 19 }20 sid21 {22 color:blue;23 font-size:16pt;24 display:inline;25 line-height:30px;//表格高度26 27 }28 sname29 {30 color:red;31 font-size:12pt;32 text-decoration:underline;33 display:inline;34 line-height:30px;35 36 }37 sclass,scourse,teacher38 {39 40 color:green;41 font-size:12pt;42 display:inline;43  line-height:30px;44 }

參考連結:http://xml.jz123.cn/xml_display.asp.htm

http://www.divcss5.com/rumen/r119.shtml

 

使用CSS來顯示XML

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.