记录一下,复习备忘,更新中
html对大小写不敏感
内部元素
<p>段落</P>
<h1>标题</h1>值越小字越大
<a href="https://www.runoob.com">这是一个链接</a>
<img src="/images/logo.png" width="258" height="39" />图片单标签,插入图片
<table border="1">一个表格
<tr>
<th>Header 1</th>表头1
<th>Header 2</th>表头2
</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>
无序列表,换成<ol>则会成为有序列表
<ul>
<li>Coffee</li>列表的第一项
<li>Milk</li>
</ul>
表单
<form action="" method='get'>anction指向提交地点,method为提交方式
First name: <input type="text" name="firstname"><br>这里表现为以文本形式填写的输入框
Last name: <input type="password" name="lastname">#吸入类型为密码,输入会变成密文
</form>
实现单选框
<form action="">
<input type="radio" name="sex" value="male">男<br>
<input type="radio" name="sex" value="female">女
</form>
实现复选框
<form>
<input type="checkbox" name="vehicle" value="Bike">我喜欢自行车<br>
<input type="checkbox" name="vehicle" value="Car">我喜欢小汽车
<input type="submit">这里是form的提交按钮
</form>
脚本标签
<script>
document.write("Hello World!");
</script>
调用函数
<script>
function myFunction()
{
document.getElementById("demo").innerHTML="Hello JavaScript!";
}
</script>
<button type="button" onclick="myFunction()">点我</button>
href标识超文本引用,用在*ink和a等元素上,href是引用和页面关联,在当前元素和引用资源之间建立联系。与页面同时加载
src表示引用资源,表示替换当前元素,用在img,script,iframe上,src是页面内容不可缺少的一部分。优先加载
外部框架
<!DOCTYPE html> 声明html文档
<html>
<head>
<meta charset="utf-8">必要, 声明编码模式
<base href="http://www.runoob.com/images/" target="_blank">#为没有指明地址的标签设置一个默认地址
<link rel="stylesheet" type="text/css" href="mystyle.css">#常用于链接到样式表
<style type="text/css">body {background-color:yellow}</style>#样式
<title>文档标题</title>
</head>
<body>
文档内容......
</body>
</html>
功能标签
<br>功能,换行
<hr>画一条水平线
<span>内联元素,可用作文本的容器,不以新行开始</span>
<div id=1>将包含其中的内容看作一个整体</div> 块级元素,新行开始,常用于页面布局,称为div块,方便对其整体进行操作或者格式更改
外观
实际上外观样式主要由css来实现,但是html也存在调整样式的标签
<sub>将此处内容变为</sub>下标
<sup>将此处内容变为</sup>上标
<b>将其中的字体加粗</b> <strong>标签与它类似
规则
属性赋值格式 name="value"
注规则释 <!-- 这是一个注释 -->