HTML 学习总结
1.HTML是什么,它是用来干什么的?
HTML是一种超文本标签语言,它不是程序语言,它是一套标记语言,标记语言是一种标签,HTML就是用标签来描述网页的。其实,学习HTML就是学习标签,所以标签就显得尤为重要。
2.那什么是标签?
HTML标签是有尖括号包围的关键词。比如<html>。标签通常都是成对出现的,<html>和</html>。第一个标签是开始标签,第二个标签是结束标签。
3。下面我简单介绍几种常用的标签。
(1)标题标签。例如<h1></h1> 它是用来描述一个标题的。
<h1>This is a heading</h1>
(2)段落标签。例如<p></p>
<p>This is a paragraph.</p>(3)链接。 例如<a></a><a href="http://www.w3school.com.cn">This is a link</a>
(4)图像标签。<img></img><img src="w3school.jpg" width="104" height="142" />
(5)无序标签。<ul></ul>
<ul>
<li>电脑</li>
<li>手机</li><li>美食</li></ul>
(6)有序标签。<ol></ol>
<ol><li>电脑</li><li>手机</li><li>美食</li></ol>
(7)表单。<form></form>. 表单很重要。在浏览器中显示如下
4. HTML框架 通过框架,你可以在同一个浏览器窗口中显示不止一个页面(8)在表单中,有一类很重要的元素-按钮。 按钮科分为普通按钮,提交按钮,重置按钮。我只列举其中一种。<form> <input type="radio" name="sex" value="male" /> Male <br /> <input type="radio" name="sex" value="female" /> Female </form>
(11)表格 <table></table>在浏览器中显示如下
(9)在表单中,还有文本域。<textarea></textarea>, 文本域可以用来插入一段文字。在浏览器中显示如下:<html> <body> <p> This example cannot be edited because our editor uses a textarea for input, and your browser does not allow a textarea inside a textarea. </p> <textarea rows="10" cols="30"> The cat was playing in the garden.
(10) 在表单中的下拉菜单。<select></select><html> <body>
在浏览器中显示:<form> <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select> </form> </body> </html>
<table border="1"> <tr> <th>Heading</th> <th>Another Heading</th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>
在 浏览器中显示
其中,表头用<th>标签
(1)垂直框架(2)水平框架<html> <frameset cols="25%,50%,25%"> <frame src="/example/html/frame_a.html"> <frame src="/example/html/frame_b.html"> <frame src="/example/html/frame_c.html"> </frameset> </html>
<html> <frameset rows="25%,50%,25%"><frame src="/example/html/frame_a.html"> <frame src="/example/html/frame_b.html"> <frame src="/example/html/frame_c.html"></frameset></html>(3)混合框架<html> <frameset rows="50%,50%"> <frame src="/example/html/frame_a.html"> <frameset cols="25%,75%"> <frame src="/example/html/frame_b.html"> <frame src="/example/html/frame_c.html"> </frameset> </frameset> </html>