HTML-常用标签解析

来源:互联网 发布:java使用odata 编辑:程序博客网 时间:2024/05/29 17:02
<i>斜体</i>  //斜体<hr />       //水平线<hr size=“5”> //size:水平线的高度,单位像素<hr noshade=“noshade” /> //noshade:没有阴影,取值:noshade,表示纯色<img src=“../logo.pngwidth=“” height=“”  alt=“占位文字说明”/>//../logo.png表示相对路径的图片    eg; ../img/logo.png<a href=“” target=“”></a> // target:_blank  新开页面跳转//空格表示&nbsp//a标签<a href="#"></a>   #点击不跳转里面可以是img,//无序列表<ul><li>coffee</li><li>milk</li></ul>//有序列表<ol><li>coffee</li><li>milk</li></ol>//表格标签//cellpadding:边框与内容距离  cellspacing:边框与边框距离<table border=“1px”,cellpadding="1px",cellspacing="1px">    <tr>        <td></td>        <td></td>        <td></td>    </tr></table><td colpsan=“2”></td> //表格跨列,2列.右边列内容清除<td rowsan=“2”></td>  //表格跨行,2行.下一行内容清除//框架标签(cols:水平分向切割,rows:垂直方向切割)//e.g.:水平切割,左右各为25%,75%的html<frameset cols="25%,*">    <frame src="left.html" />    <frame src="right.html" /></frameset>//e.g.:垂直切割上下两层20%,80%.水平切割左右两层20%,80%.<frameset rows="20%,*">        <frame src="top.html" />            <frameset cols="20%,*">                <frame src="left.html" />                <frame src="right.html" />        </frameset></frameset>//表单标签 form action:整个表单提交的位置(可以是一个页面,也可以说一个后台的java代码)method:提交的方式(get/post/delete...等7种)//文本输入项<input type=“text” name=“” size=“” maxlength=“” readonly=“” placehoder=“”>//密码输入项<input type=”password” =”” /> //单选按钮<input type=”radio” =”” value=””  checked=””/> //多选按钮<input type=”checkbox” name=”” value=”” checked=”” /> //下拉列表<select    name=””>        <option value=“” selected=“”>北京</option>    <option>上海</option> </select> //文件上传项<input type=”file” name=””/> //文本输入域<textarea name=””></textarea> //提交按钮<input type=“submit” value =””/> //普通按钮<input type=”button” value=””/> //重置按钮<input type=”reset” value=””/> //隐藏项<input type=”hidden” name=””/> 

表单标签的例子

<form action="#" method="get">            隐藏字段:<input type="hidden" name="id" value="" /><br />            用户名:<input type="text" name="username" readonly="readonly" value="zhangsan" size="40px" maxlength="5"  placeholder="请输入用户名"/><br />            密码:<input type="password" name="password" required="required"/><br />            确认密码:<input type="password" name="repassword"/><br />            性别:<input type="radio" name="sex" value="男"/>男            <input type="radio" name="sex" value="女" checked="checked"/>女<br />            爱好:<input type="checkbox" name="hobby" value="钓鱼"/>钓鱼            <input type="checkbox" name="hobby" value="打电动"/>打电动            <input type="checkbox" name="hobby" value="写代码" checked="checked"/>写代码<br />            头像:<input type="file" name="file"/><br />            籍贯:<select name="province">                <option>--请选择--</option>                <option value="北京">北京</option>                <option value="上海" selected="selected">上海</option>                <option value="广州">广州</option>            </select><br />            自我介绍:                <textarea name="zwjs">                </textarea><br />            提交按钮:<input type="submit" value="注册"/><br />            普通按钮:<input type="button" value="zhuce"/><br />            重置按钮:<input type="reset" />        </form>

//效果图
表单标签例子

原创粉丝点击