HTML常用标签介绍(下)

1、 table标签

<body>
        <table width="50%" height="200px" border="1" cellspacing="0" cellpadding="0" bgcolor="green" align="center">
            <caption>我喜欢的歌曲</caption>
                <thead>
                    <tr>
                        <th>歌名</th>
                        <th>作者</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>咏春</td>
                        <td>七朵</td>
                    </tr>
                    <tr>
                        <td>千梦</td>
                        <td>阿杰</td>
                    </tr>
                    <tr>
                        <td>倩女幽魂</td>
                        <td rowspan="2">张国荣</td>
                    </tr>
                    <tr>
                        <td>与谁共鸣</td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="2" align="right">歌曲数目:4</td>
                    </tr>
                </tfoot>
        </table>
    </body>

2、form标签

  • form标签的语法结构:
<form action="表单提交的地址" method="提交方法">
            ....文本框、按钮等表单元素...
        </form>
  • form标签的常用属性
    1. action:指定表单提交后由哪一个服务器程序处理,如果省略 action 属性,则 action 会被设置为当前页面。
    2. enctype:用于指定表单数据的编码方式
      application/x-www-form-urlencoded:默认的编码方式,将表单控件中的数据编码成URL数据
      multipart/form-data:以二进制方式处理数据
      text/plain:以表单的action属性值为mailto:URL的形式处理
    3. method 属性规定在提交表单时所用的 HTTP 方法(GET 或 POST)

3、常用的表单元素:
这里写图片描述
4、input元素的常用属性
这里写图片描述
5、

<body>
        <form name="regForm" action="https://www.baidu.com" method="post">
            单行文本框<input type="text" name="username" id="username"/></br>
            <label for="password">密码框</label><input type="password" name="password" id="password"/></br>
            隐藏域<input type="hidden" name="hidden" id="hidden"/></br>
            单选框<input type="radio" name="sex" id="male" checked="checked"/>男
                <input type="radio" name="sex" id="female"/>女</br>
            复选框<input type="checkbox" name="hobby" value="1" id="football"/>足球
                    <input type="checkbox" name="hobby" value="2" id="basketball"/>篮球
                    <input type="checkbox" name="hobby" value="3" id="pingbang"/>乒乓球
                    <input type="checkbox" name="hobby" value="4" id="running"/>跑步</br>

            图像域<input type="image" src="QQ截图20170212200047.png" width="100px" height="70px"/></br>
            文件上传域<input type="file" name="file"/></br>
            提交按钮<input type="submit" name="submit" value="提交按钮"/></br>
            重置按钮<input type="reset" name="reset" value="重置"/></br>
            普通按钮<input type="button" name="button"value="普通按钮"/></br>
            <button type="submit" name="sub1" value="提交按钮"><i>提交按钮</i></button></br>
            <button type="reset" name="re" value="重置"><i>重置按钮</i></button>
        </form>
    </body>
  • 列表框和下拉菜单
列表框:</br>
        <select id="city" name="city" mutiple="mutiple" size="3">
            <option>北京</option>
            <option>上海</option>
            <option>广州</option>
            <option>深圳</option>
        </select></br>
        下拉菜单:</br>
        <select id="cities" name="cities">
            <option>北京</option>
            <option>上海</option>
            <option>广州</option>
            <option>深圳</option>
        </select>
  • 媒体标签
<object width="400" height="40"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">
<param name="SRC" value="bookmark.swf">
<embed src="bookmark.swf" width="400" height="40"></embed>
</object>

详细内容可以参考以下网站:
参考网站

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值