重温HTML

来源:互联网 发布:淘宝千牛店铺名怎么改 编辑:程序博客网 时间:2024/06/16 11:38

1.HTML主要标签
a.标题标签:

<h1>-<h6>逐渐减小特点:加粗,加黑,单独占用一行,与其他行有一定行间距 

b.注释<!-- -->
c.段落标签:<p></p>
d.字体标签:<font color=" " size =" " face ="楷体" ></font>
e.图片标签:<img src="../../img/logo2.png" alt="logo图片" width=" px" height=" px"/>
f.无序列表:

<ul><li><a href="a.html"></a><li><li><a href="a.html"></a><li><li><a href="a.html"></a><li></ul>

g.表格:

<table border="1px" width="400px" height="400px" align="center" bgcolor="chartreuse" cellspacing="0px" cellpadding="0px">            <tr height="200px" bgcolor="chocolate">                <td>1</td>                <td>2</td>                <td>3</td>            </tr></table>

h.描述:cellspacing :设置边框和边框之间的间距 cellpadding:设置边框和内容之间的属性
colspan:跨列 colspan:跨行
i.空格:&nbsp;
j.框架:

<frameset rows="20%,*">        <frame src="top.html" />        <frameset cols="40,*">            <frame src="left.html" />            <frame name="right" />     name的值为下面target的值        </frameset>    </frameset>    <a href="right.html" target="right">会员管理</a>  <br />

2.案例:一个注册表单的书写

<form action="#" method="get">            隐藏字段:<input type="hidden" name="id" value=""/><br />            用户名:<input type="text" name="username"  value="zhangsan" readonly="readonly"              placeholder="请输入用户名" maxlength="5"/> <br />            密码:<input type="password" name="password" required="required" /><br />            确认密码:<input type="password" name="repassword"/><br />            Email:<input type="text"/><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="遛狗" checked="checked"/>遛狗<br />            头型:<input type="file" name="file"/><br />            籍贯:<select name="province">                    <option>请选择</option>                    <option value="北京" selected="selected">北京</option>                    <option value="上海">上海</option>                    <option value="广州">深圳</option>                </select><br/>                自我介绍:<textarea name="textarea">                   </textarea><br />                提交:<input type="submit" value="注册"/>    <br />                普通按钮:<input type="button" value="zhuce" /> <br />                重置:<input type="reset" value="重置" /><br /></form>

实现的效果如下
这里写图片描述

0 0
原创粉丝点击