图片、表单、下拉选项

2018-01-23  本文已影响0人  竹忧

图片

<img  src="01.jpg"  alt="这是一张图片"  title="点我下载"  usemap="map">
图像映射
<map  name="map"  id="map">
  <area  shape="rect"  coords="0,50,70,70"  href="1.html"  target="_black"
    title="下载">
</map>

H5新增图片标签

<figure>
    <figcaption>故乡的小芳</figcaption>
    <img src="../../dist/images/1.jpg" alt="">
</figure>

表格

<table>
        <colgroup>
            <col style="background-color:#ccc">
            <col style="background-color:#f5f5f5" span="3">
            
        </colgroup>
        <caption>
            <h2>信息统计</h2>
        </caption>
        <thead>
            <tr style="background-color:#999">
                <th>序号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1</td>
                <td>曹操</td>
                <td>男</td>
                <td>45</td>
            </tr>

            <tr>
                <td>2</td>
                <td>诸葛亮</td>
                <td>男</td>
                <td>28</td>
            </tr>
        </tbody>
        <tfoot></tfoot>

    </table>
<table>
        <tr>
            <td rowspan="3">图像</td>
            <th style="width:100px">姓名</th>
            <td> </td>
            <th style="width:100px">年龄</th>
            <td> </td>
        </tr>

        <tr>
            <th>籍贯</th>
            <td> </td>
            <th>性别</th>
            <td> </td>
        </tr>

        <tr>
            <th>个人描述</th>
            <td colspan="3"> </td>
        </tr>

    </table>

H5新增列表语义

<dl>
    <dt>小明:</dt>
    <dd>小红,明天有空吗</dd>
    <dt>小红:</dt>
    <dd>不约</dd>
</dl>

表单

<form action="1.php" method="" ectype="">
<input type="text" placeholder="请输入文本" name="usertext" value="hahaha">
<input type="password" placeholder="请输入密码" name="pwd">
<input type="radio" name="sex" value="m" checked>男
        <input type="radio" name="sex" value="w">女
        <input type="radio" name="sex" value="e">其他
您的财产:
        <input type="checkbox" name="caichan[]">房产
        <input type="checkbox" name="caichan[]">车
        <input type="checkbox" name="caichan[]">银行存款
        <input type="checkbox" name="caichan[]" checked>股票
        <input type="checkbox" name="caichan[]" checked>地
<input type="submit" value="submit提交">
<input type="reset" value="reset重置">
<input type="button" value="按钮">
<input type="image" src="../../dist/images/baidu.gif">
请选择要上传的文件
        <input type="file" name="myfile">
<input type="hidden" name="is_hot" value="1231313">

HTML5表单

input 新增的type属性值

<tr>
    <td>email : </td>
    <td>
        <input type="email" placeholder="请输入邮箱" required name="email" >
    </td>
</tr>
<tr>
    <td>number : </td>
    <td>
        <input type="number" max="1000000" min="0" step="2" placeholder="请输入数字" autofocus>
    </td>
</tr>
<tr>
    <td>range : </td>
    <td>
        <input type="range" max="100" min="0" step="10"> 
    </td>
</tr>
<tr>
    <td>search : </td>
    <td>
        <input type="search" results pattern="\d{5}">
    </td>
</tr>
<tr>
    <td>file : </td>
    <td>
        <input type="file" multiple>
    </td>
</tr>

新增表单标签

<h2>output</h2>
<input type="text" onkeyup="output.innerHTML = this.value">
<output id="output"></output>
<hr>

<h2>datalist</h2>
<input type="text" list="mydata"> <button>搜索</button>

<datalist id="mydata">
    <option value="abc"></option>
    <option value="abac"></option>
    <option value="abb"></option>
    <option value="bac"></option>
    <option value="acc"></option>
    <option value="ade"></option>
</datalist>

<hr>

<h2>keygen</h2>
<keygen name="" value="">

新增属性(适用于部分表单控件)

form元素新增的属性

<p contenteditable="true">
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Modi voluptas odit nulla ad molestiae sunt quo quos nesciunt aliquid laborum, asperiores quidem ducimus esse, consequatur. Voluptatum similique architecto sunt, unde.
</p>
<form action="01.php" method="post" novalidate>

下拉选项

<select>
    <!-- <optgroup label="基础"> -->
    <option disabled value="1">文盲</option>
    <option value="2">小学</option>
    <option value="3">中学</option>
    <!-- </optgroup> -->
    <option value="4" selected>大学</option>
    <option value="5">研究生</option>
</select>

文本域

<textarea name="mytext" cols="40" rows="10">
    sLorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos, maiores.
</textarea>

其他

<form action="#">
    <fieldset>
        <legend>我的表单</legend>

        <label for="userInput">姓名: </label>
        <input type="text" name="username" id="userInput"> <br>
    </fieldset>
    
</form>
上一篇 下一篇

猜你喜欢

热点阅读