HTML基础篇之表单实体符
html表单<form>:
输入元素:<input>
输入类型属性type:
text | 文本框 |
password | 密码框 |
radio | 单选按钮;多个单选按钮的name值的保持相同 |
checkbox | 复选框 |
reset | 重置按钮,清空表单内容 |
submit | 提交按钮 |
datalist | 预先定义的输入空间选项列表 |
select | 下拉列表 |
optgroup | 选项组 |
option | 下拉列表的选项 |
textarea | 文本域 |
button | 按钮 |
fieldset | 表单的外框 |
legend | fieldset的标题 |
output | 定义一个计算结果 |
html框架<iframe>:
src | 页面路径 |
name | 框架名,可为超链接targe跳转窗口方式值 |
width | 框架宽 |
height | 框架高 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>表单</title>
<style type="text/css">
input{
margin-top: 20px;
}
select{
margin-top: 20px;
}
</style>
</head>
<body>
<form οninput="o.value= parseInt(a.value)+ parseInt(b.value)" style="text-align: center;margin-top: 10px;">
<fieldset>
<legend align="center">我的表单标题</legend>
文本框:<input type="text" /><br />
密码框:<input type="password" /><br />
<input type="radio" name="man"/>男
<input type="radio" name="man"/>女<br />
<input type="checkbox" />美食
<input type="checkbox" />美景<br />
<select>
<optgroup label="手机">
<option>一加</option>
<option>苹果</option>
</optgroup>
<optgroup label="服饰">
<option>衣服</option>
<option>裤子</option>
</optgroup>
</select><br />
<input list="data" />
<datalist id="data">
<option value="香烟"></option>
<option value="红酒"></option>
</datalist>
<input type="button" value="按钮" /><br />
0<input type="range" id="a" value="50"/>100
+ <input type="number" id="b" value="50"/>
=<output name="o" for="a b"></output><br />
<input type="submit" value="提交" />
<input type="reset" value="重置" />
</fieldset>
<hr />
</form>
<iframe src="html之div层表布局.html" width="100%" height="280px">
</iframe>
</body>
</html>
效果图
html颜色:支持十六进制,RGB(),颜色英文单词使用
color:red; background-color:#fff000; text-color:rgb(25,10,34);
html脚本<script>:html的行为层,详情学习JavaScript
当浏览器不支持脚本时 <noscript>标签替代的提示文本
简单例子:
<script>
function Test(){
alert("我是一个警告框");
}
</script>
<noscript>该浏览器不支持JavaScript</noscript>
<body>
<input type="button" value="警告框" οnclick="Test()"/>
</body>
效果图:
![](https://i-blog.csdnimg.cn/blog_migrate/e5eac00915d1b2fb43d7616f5d9ea60a.png)
音标符:
音标符 | 字符 | Construct | 输出结果 |
---|---|---|---|
̀ | a | à | à |
́ | a | á | á |
̂ | a | â | â |
̃ | a | ã | ã |
̀ | O | Ò | Ò |
́ | O | Ó | Ó |
̂ | O | Ô | Ô |
̃ | O | Õ | Õ |
实体符:
空格 | |   | |
< | 小于号 | < | < |
> | 大于号 | > | > |
& | 和号 | & | & |
" | 引号 | " | " |
' | 撇号 | ' (IE不支持) | ' |
¢ | 分 | ¢ | ¢ |
£ | 镑 | £ | £ |
¥ | 人民币/日元 | ¥ | ¥ |
€ | 欧元 | € | € |
§ | 小节 | § | § |
© | 版权 | © | © |
® | 注册商标 | ® | ® |
™ | 商标 | ™ | ™ |
× | 乘号 | × | × |
÷ | 除号 | ÷ | ÷ |