HTML基础

一、超链接:

1)<a href="" title=""></a>;

2)<base href="" target="">设置所有链接,包括<a>,<img>,<link>,<form>标签中的URL;

3)假链接:

1 #    点击后刷新界面;

2javascript:     点击后不刷新;

4)锚点:<a href="index.html#id">

二、列表标签:

1)无序列表(unordered list

2)有序列表(ordered list

3)定义列表(definition list

<ul></ul>   <li>

<ol></ol>    <li>

<dl></dl>    <dt>    <dd>

三、表格标签:

<table>

<tr><th></th></tr>

<tr><td></td></tr>

</table>

四、表单标签:

<form>

<input type="">

</form>

1)<form>属性:

action:表单提交数据接收地址。

Method请求方法;get/post

2)<input>属性:

  (0) disabled="disabled";  //禁用input;

  (1) type="text";

  (2) type="password";

   (3) type="radio";   单选,name=""属性用来互斥。

  (4) type="checked";    多选,checked属性定义默认。

  (5) type="button" value="";

  (6) type="img" src="";

  (7) type="reset";    重置。

  (8) type="submit";

  (9) type="hidden";    不显示,用来提交数据。

  (10) type="file";    上传文件。

  注:name="";    只有设置name属性的<input>才会别提交。

  <label></lable>:    用于关联<input>标签。

  例:

  (1) <lable for="id">账号</lable>

        <input type="text" id="id">

  (2) <label>账号<input type="text"></lable>

3)多选框扩展(不使用只了解):

<datalist>:

例:

<datalist id="id">

<option>1</option>

<option<2</option>

</datalist>

<form>

<input type="text" list="id">

</form>

4)表单边框:<fieldset></fieldset>    

5)边框标题:<legend></legend>

例:

<form>

<fieldset>

<legend>边框标题</legend>

<lable>账号:<input type="text"></lable>

</fieldset>

</form>

五、下拉列表:<select></select>

<option></option>选项

<optgroup label="选项标题"></optgroup>选项分类标题

 

例:

<select>

<optgroup label="广州">

<option>XX</option>

<option>XX</option>

</optgroup>

</select>

六、换行文本框:<textarea></textarea>

属性:

(1) cols=""    列数

(2) rows=""    行数

(3) autofocus    自动获得焦点

(4) maxlength=""    最大字符长度

 

CSS禁止拉伸(默认可手动拉伸):

textarea{

resize:none;

}

posted @ 2019-06-24 19:32  开拖拉机的拉风少年  阅读(143)  评论(0编辑  收藏  举报