常用标签

 ifram标签     用于一个页面嵌套另一个页面,

属性:framborder="0" 用于展示边框为0,如果不写iframe默认会有个border 会不好看

name属性要和a标签结合使用

src="#"代表当前页面  

也可写src="http:// www.baidu.com"  例如:<ifram src="http:// www.baidu.com"  name=xxx  framborder="0"></ifram> 

<ifram src="./index2"  name=xxx  framborder="0"></ifram>   src相对路径,会渲染当前目录下index2

点击baidu  会在嵌套页面打开baidu.com  点击qq会在嵌套页面打开baidu

<ifram src="#"  name=xxx  framborder="0"></ifram> 

<a target=xxx href="http://www.baidu.com">baidu</a> 在name为xxx的窗口打开

<a target=xxx href="http://www.qq.com">qq</a>



a标签 用于跳转网页链接

1.   target属性

target=_blank 空白页面打开      target=_self  当前页面打开         target=_parent  父页面打开  target=_top 顶级页面打开

2.   download属性用来下载

<a href="http://qq.com" download>download</a>

3. href属性

href=qq.com相当于打开一个qq.com文件,

a 要想跳转必须写http协议

 b <a href="//qq.com" download>download</a>  当前协议是什么协议就是什么协议 

    注:(npm -i -g  http-server 小工具)http-server  -c -1无缓存

c  href ="index2.html"

d href =“#” 锚点 不发送请求但是会刷新页面, 其余都发送GET请求

e  href ="?name=哈哈哈"

f 伪协议 JavaScript:;不   跳转,点击后什么都不做

g href=" " 跳转自己 发送GET请求

h 不写href 相当于个span



form标签也是跳转页面,发起post请求,和a标签相反成对的 也有target标签与a标签的target一样

<form action=“index2.html?chaxuncanshu”  methd="post">

<input type="text"   name="usersname"   >  name的值username是请求参数http 请求中的第四部分

<input type="password"   name="password"   >

<input type="submit"   value="提交"   >

</form>                                                  //form表单如果没有submity提交按钮 就无法提交form表单  如果不写method默认get



input标签<input></input>

<input type="submit"   value="提交"   >

<input type="button"   value="button"   >

<input type="checkbox"   id="xxx"   ><label for="xxx">单选框右侧文字,不写label,点击文字不会选中checbox,结合for id </label>

============================checkbox=================================

 <label><input type="checkbox"    name="sport"  value ="basketball>篮球</label>           //label将input包起来就不用写id

<label><input type="checkbox"    name="sport"  value="football">足球</label>

==============================radio=======================

<label><input type="radio"    name="sport"  value="football">足球</label>        //radio 如果有同一个name 就会单选

<label><input type="radio"    name="sport"  value="basketball">篮球</label>

===============================select========================

<select  name="group"  multiple>     多选

<option value =" ">-</option>    //写空 或者不写  代表空值

<option value ="1">first</option>

<option value ="2">sec</option>

<option value ="3"   disabled>third/option>   //不可选择

<option value ="4" selected>four</option>   // 默认选中

</select>

============================button==================

<input type="button"   value="button"   >

<button>button</button>如果button按钮没有写type类型  自动升级为submit 按钮 form表单可以提交,如果button 写type不能提交



table  标签

<table  border="1">    宽度为1边框

<colgroup ><col   bgcolor=red  width=100>  <col   width=100>  <col   width=100>    </colgroup>   //列宽度

==============================thead=====================

        <thead>                                  / /表头

               <tr>                                //table row

                  <th>姓名</th>  <th>年龄</th>     <th>电话</th>              

                </tr>

          </thead>  

=============================tbody==================================

        <tbody>      //身体

             < tr>                                //table row

                     <td>张三</td><td>18</td> <td>18888888888</td>              //table  dat

              </tr>

               <tr>                              //table row 

                       <td>李四</td><td>18</td> <td>16688888888</td>              //table  dat

               </tr>

            </tbody>  //身体

            <tfoot><</tfoot>   //尾部

<table>

备注:如果不写tbody  thead tfoot 浏览器会默认放在tbody中,将按顺序展示











最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • HTML 常用标签 Iframe标签 HTML内联框架元素 表示嵌套的浏览上下文, 有效地将另一个HTML页面嵌入...
    YjjTT阅读 453评论 0 0
  • 1. iframe 标签 iframe 标签主要用途是嵌套页面,目前使用较少,只有一些遗留项目在用。具体可以参考 ...
    大喵chary阅读 474评论 0 0
  • 本文将会介绍HTML中的一些常用标签,后面还会陆续整理 1:什么是HTML HTML (Hypertext Mar...
    憨憨二师兄阅读 968评论 0 0
  • 这篇文章将简单介绍几个在HTML常用的标签:iframe标签、a标签、form标签、input标签、button标...
    宣泽彬阅读 381评论 0 0
  • 一、常用标签 1. iframe 标签 嵌套页面。需要新开一个窗口,速度比较慢。 iframe 直接使用 直接打开...
    养乐多__阅读 622评论 0 5