zoukankan      html  css  js  c++  java
  • 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属性,该属性表示用户提交的时候进行检查,检查该元素内一定要有输入的内容。

     

     

     

     

  • 相关阅读:
    mysql之指定为definer的用户不存在
    Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法
    MongoDB mongo.exe启动及闪退解决 转载
    pycharm下运行unittest的问题
    mysql大小写敏感与校对规则
    windows7环境下使用pip安装MySQLdb
    HTML中title前面小图标和网站收藏现实的图标
    异步发送的请求---取消操作
    视频文件上传遇到的问题
    vue-devtools 必备开发工具
  • 原文地址:https://www.cnblogs.com/staven/p/4702442.html
Copyright © 2011-2022 走看看