html基础知识

来源:互联网 发布:淘宝三国杀ol卡是什么 编辑:程序博客网 时间:2024/05/16 07:25
1.Bascd-web 服务器—HTTP协议—浏览器 轻量级
Client-sever 客户端——浏览器

2.HTML 内容 文字,图片
CSS 样式 颜色,字体模式
JavaScript 事件 鼠标事件,键盘事件

3.浏览器向服务器提出请求,服务器解析成HTML文件返回给浏览器

4.有序列表 <ol><li>
无序列表 <ul><li>
定义列表 <dl><dt><dd>

5.ico图标
<link rel="shortcut icon" herf="abc.ico"/>

6.新窗口打开超链接
<a href="abc" target="__blank"></a>

7.快捷键
<a href="abc" accesskey="A"></a>
实现Alt+A跳转

8.Tab次序
<a href="abc" tabindex="123"></a>

9.表格
<table border="1">
<th colspan="2">标题(加粗)</th>
//合并单元行
<tr>行</tr>
<td rowspan="2">列</td>
//合并单元列
</table>

10.特殊字符(实体)
&nbsp 空格
&it 小于号
&gt 大于号
&copy 版权符号
&reg 已注册符号。。。。。。

11.span标签
<p>我喜欢打<span style='color:red'>篮球</span></p>

12.form表单
<form action="表单处理程序的URL" method="get/post请求方式"></form>
<form action="表单处理程序的URL" method="get/post请求方式" name="123" id=""123 size="10" maxlength="10"></form>

13.input属性
指的是form表单的表单类型
style是设置文件的样式
<input type="text" value="123"/>
<input type="password" value="123"/>

14.Sumit提交表单,Button需要绑定事件才可以用提交数据不可以的,比如说想实现局部刷新,就不能用Sumit了,用Button绑定事件就好了,如果用Sumit绑定事件的话,触发事件也会提交表单的

15.单选按钮
radio
<input type="radio" name="123" id="1" value="2">男</input>
<input type="radio" name="123" id="2" value="3" checked="checked" >女</input>
//name必须相同 checked默认选择

16.复选按钮
checkbox
<input type="checkbox" name="123" id="1" value="2">成都</input>
<input type="checkbox" name="123" id="3" value="4" >上海</input>
<input type="checkbox" name="123" id="5" value="6" checked="checked" >北京</input>
//name必须相同 checked默认选择
//每一组数据的name值是相同的 value不同

17.隐藏字段
hidden
<form action="123" method="get/post">
<input type="text" id="1" name="123">
<input type="hidden" id="1" value="123"/>
<input type="submit" value="提交">
</form>

18.提交附件
file
<form action="123" method="get/post">
<input type="flie" id="1" name="123">
<input type="button" value="提交附件">
</form>

19.下拉列表
<form action="#" method="post" id="456" name="123">
<p>您最喜欢的菜系是什么?</p>
<select id="food" multiple="multiple" size="1">
<option value="1">川菜</option>
<option value="2">京菜</option>
<option value="3">湘菜</option>
<option value="4">东北菜</option>
<option value="5" selected="selected">粤菜</option>
</select>
</form>
//属性:select option
//multiple 多选
//selected 默认选择

20.多行文本框
<textarea rows="5" cols="50" id="789">请输入评论的内容</textarea>

21.submit提交和reset清空
<p><input type="submit" value="提交"></p>
<p><input type="reset" value="清空"></p>
//button和submit的区别:Sumit提交表单,Button需要绑定事件才可以用提交数据不可以的,比如说你想实现局部刷新,就不能用Sumit了,用Button绑定事件就好了,如果用Sumit绑定事件的话,在触发事件的同事,也会提交表单的

22.label 绑定id
<form action="" method="">
<p>
<label for="1">用户名:</label>
<input type="text" id="1">
<input type="text" id="2">
<input type="text" id="3">
</p>
</form>

23.fieldset和legend
<fieldset>
<legend>性别</legend>
<p>
<input typle="radio" name="sex" value="man">男
</p>
<p>
<input typle="radio" name="sex" value="women">女
</p>
</fieldset>
//fieldset就是一个框框 legend是框框上的提示语

24.





0 0
原创粉丝点击