这是我写的第一个WML页面并经过改良源码,目的是测试WML中最基本的元素属性。通过与HTML的比较,可以发现WML比HTML简单,它的元素的属性也比较少。根据xml节点中encoding属性可以更改编码属性,这里设置成utf-8以完成中文显示。 <? xml version="1.0" encoding="utf-8" ?> <!-- created by WAPtor (http://www.waptop.net/) --> <! DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml" > < wml > <!-- THIS IS THE FIRST CARD IN THE DECK --> < card newcontext ="false" ordered ="true" id ="home" title="活动列表" > < p align ="center" mode ="nowrap" > < img alt ="顶部图像" src ="120_20.gif" vspace ="0" hspace ="0" width ="120" height ="20" align ="bottom" /> < br /> </ p > < p align ="center" mode ="nowrap" > < img alt ="左边图像" src ="15_15.gif" vspace ="0" hspace ="0" width ="15" height ="15" align ="bottom" /> < a href ="#children1" > 有奖活动介绍 </ a > < img alt ="右边图像" src ="15_15.gif" vspace ="0" hspace ="0" width ="15" height ="15" align ="bottom" /> < br /> </ p > < p align ="center" mode ="nowrap" > < img alt ="左边图像" src ="15_15.gif" vspace ="0" hspace ="0" width ="15" height ="15" align ="bottom" /> < a href ="#children2" > 校园免费聊 </ a > < img alt ="右边图像" src ="15_15.gif" vspace ="0" hspace ="0" width ="15" height ="15" align ="bottom" /> < br /> </ p > < p align ="center" mode ="nowrap" > < img alt ="左边图像" src ="15_15.gif" vspace ="0" hspace ="0" width ="15" height ="15" align ="bottom" /> < a href ="#children3" > 搜索 </ a > < img alt ="右边图像" src ="15_15.gif" vspace ="0" hspace ="0" width ="15" height ="15" align ="bottom" /> < br /> </ p > </ card > < card newcontext ="false" ordered ="true" id ="children1" title ="有奖活动介绍" > < p > 有奖介绍 </ p > < p align ="left" > 活动名称: < br /> 活动时间: < br /> 活动规则: < br /> < a href ="#home" > 返回上一页 </ a > </ p > </ card > < card newcontext ="false" ordered ="true" id ="children2" title ="校园免费聊" > < p > 校园免费聊 </ p > < p align ="left" > 产品介绍: < br /> 象MSN一样的聊天工具,通过手机号码填加为好友 < br /> 使用说明: < br /> 输入好友的手机号码即可加为好友,并享受免费畅聊 < br /> < a href ="#home" > 返回上一页 </ a > </ p > </ card > < card newcontext ="false" ordered ="true" id ="children3" title ="梦网全搜索" > < p > 梦网全搜索 </ p > < p align ="left" > 产品介绍: < br /> 吃喝玩乐住等生活娱乐信息任你免费搜 < br /> 使用说明: < br /> 按要搜索的分类按步骤进行搜索或直接输入想找的内容进行查找 < br /> < a href ="#home" > 返回上一页 </ a > </ p > </ card > </ wml >