• HTML5中标记与特殊属性


    不允许写结束标记的元素有(只允许<元素/>):

    area、base、br、col、command、embed、hr、img、input、

    keygen、link、meta、param、source、track、wbr。

     

    可以省略结束标记的元素有:

    li、dt、dd、p、rt、rp、optgroup、option、colgroup、thead、

    tbody、tfoot、tr、td、th

     

    可以省略全部标记的元素有:

    html、head、body、colgroup、tbody

     

    具有boolean值的属性:

    对于具有boolean值的属性,例如disabled与readonly等

    <!-- 只写属性不写属性值代表属性为true -->

    <input type="checkbox" checked>

    <!-- 不写属性代表为false  -->

    <input type="checkbox" >

    <!-- 属性值=属性名,代表属性为true -->

    <input type="check" checked="checked">

    <!-- 属性值=空字符串,代表属性为true -->

    <input type="checkbox" checked="" >

     

    新增表单属性:

    autofocus : 对input(type=text)  、select 、textarea 与button元素指定autofocus属性。让画面打开时自动获得焦点。

    placeholder:对input(type=text)、textarea指定placeholder属性,默认提示信息

    from:input 、output 、 select 、textarea 、 button 与fieldset指定form属性,声明它属于哪个表单。然后将其繁殖在页面上的任何位置,而不是表单之内。

    required:input(type=text)与textarea元素制定required属性,该属性表示用户提交的时候进行检查,检查该元素内一定要有输入的内容。

     

     

     

     

  • 相关阅读:
    [LeetCode] Remove Duplicates from Sorted List
    [LeetCode] Substring with Concatenation of All Words
    [LeetCode] Partition List
    [LeetCode] Reverse Nodes in kGroup
    [LeetCode] Remove Duplicates from Sorted List II
    [LeetCode] Reverse Linked List II
    [LeetCode] Text Justification
    [LeetCode] Swap Nodes in Pairs
    (转)介绍下Nuget在传统Asp.net项目中的使用
    Entity Framework中的Migrations
  • 原文地址:https://www.cnblogs.com/staven/p/4702442.html
Copyright © 2020-2023  润新知