HTML常用标签

[b]1.锚点链接[/b]
<body>
<a name="t">anthor</a>
<br />
<br />
....
<a href="#t">link</a>
</body>


[b]2.分割线<hr>[/b]
<hr noshade="noshade" c color="blue" width="300" size="2" align="center" />


[b]3.文字的显示效果[/b]
<b>黑体</b>
<i>斜体</i>
<u>上划线</u>
<s>下划线</s>
<sup>上标</sup>
<sub>下标</sub>


[b]4.文字的布局[/b]
<p>分段显示</p>

<div>分层显示</div>

<span>分块显示</span>

<ul>
<li type="disc">符号列表</li>
</ul>

<ol>
<li>数字列表</li>
</ol>

<pre>保持原有格式</pre>


[b]5.图片[/b]
<img src="../images/01.jpg" alt="图片" border="1" />


[b]6.表格[/b]
<table width="780" align="center" border="2">
<tr>
<!-- 宽度设定一次下面的就不用设置了 -->
<td width="30%" align="center">A</td>
<td width="30%" align="center">B</td>
<td align="center">C</td>
</tr>
<!-- 设定一个格的高度下面的td就跟着变了 -->
<!-- valign是垂直对齐显示,相对于Y轴 -->
<tr>
<td height="50" valign="top">D</td>
<td>E</td>
<td valign="bottom">F</td>
</tr>
<tr>
<td rowspan="2" colspan="2">我是小霸王</td>
<td>我只有一个td了</td>
</tr>
<tr>
<td>我也只有一个td了</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>


[b]7.表单[/b]

■[b] form标签[/b]
<!-- Get:发送较少数据(256byte), 显示在url中, url/userinfo?username=apq&password=123-->
<!-- Post:数据长度无限制,不会显示在url中-->
<form action="01.jsp" method="post">
</form>


■[b] 其它标签[/b]
<form action="01.jsp" method="post">
<!-- 输入框 -->
<input type="text" name="username" size="20" maxlength="10" />

<!-- 密码框 -->
<input type="password" name="pw" size="20" maxlength="10" />

<!-- 单选按钮 -->
<!-- 用法: 同一个name不同的value -->
<input type="radio" name="sex" value="male" checked="checked" />男
<input type="radio" name="sex" value="female"> 女

<!-- 多选按钮 -->
<input type="checkbox" name="fruit" value="apple" checked="checked" />apple
<input type="checkbox" name="fruit" value="pear"/>pear

<!-- 按住ctrl键多选 -->
<select name="fruit" size="8" multiple="multiple">
<option value="apple" selected="selected">apple</option>
<option value="pear">pear</option>
</select>

<!-- 下拉条 -->
<select name="province">
<option value="0" selected="selected">请选择</option>
<option value="ln">辽宁</option>
<option value="bj">北京</option>
</select>

<!-- textarea -->
<textarea name="text" rows="10" cols="80" wrap="hard"></textarea>

<!-- 提交 重置 按钮 -->
<input type="submit" value="提交" />
<input type="reset" value="重置" />
<input type="button" value="按钮" />

<!-- 隐藏域 -->
<input type="hidden" name="fruit" value="apple" />

</form>


[b]8.框架[/b]
■[b] frameset[/b]
<title>A</title>
</head>
<!-- 注意:不要有body标签 -->

<frameset cols="20%, *" framespacing="20">
<frame name="left" src="B.html" noresize scrolling="auto" frameborder="0" />
<frame name="right" src="C.html" frameborder="0" />
</frameset>
<!-- 对不支持框架的浏览器提示 -->
<noframes>
<body>本页面不支持框架显示</body>
</noframes>
</html>

<title>B</title>
</head>

<body bgcolor="#CCCCCC">
<p>B</p>
</body>
</html>

<title>C</title>
</head>

<frameset rows="40%, *" framespacing="10">
<frame name="righttop" src="C_01.html" frameborder="0" />
<frame name="rightbottom" src="C_02.html" frameborder="0" marginwidth="30" marginheight="30" />
</frameset>
<!-- 对不支持框架的浏览器提示 -->
<noframes>
<body>本页面不支持框架显示</body>
</noframes>

</html>

<title>C_01</title>
</head>

<body bgcolor="#CCCCCC">
<p>C_01</p>
</body>
</html>

<title>C_02</title>
</head>

<body bgcolor="#CCCCCC">

<a href="B.html">链接到B</a>
<br />
<a href="C_01.html">链接到C_01</a>
<br />
<a href="B.html" target="righttop">链接到B, 在右上窗口显示</a>
<br />
<a href="B.html" target="_parent">链接到B, 在父窗口显示(C.html)</a>
<br />
<a href="B.html" target="_top">链接到B, 在顶层窗口显示</a>
<br />
<a href="B.html" target="_blank">链接到B, 在新窗口显示</a>

</body>
</html>


■[b] iframe[/b]
<iframe src="u.html" name="w">hhh</iframe>
<br /><br />
<a href="anthor.html" target="w">AAA</a>


[b]9.邮件链接[/b]
<a href="mailto:baby69yy2000@163.com?subject=请给我留言">给我写邮件</a>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值