GithubHelp home page GithubHelp logo

cengbin.github.io's Introduction

cengbin.github.io's People

Contributors

cengbin avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cengbin.github.io's Issues

微信自动播放媒体文件代码

window.onload=function(){
     var bg_audio=document.getElementById('bg');
     //解决微信浏览器不播放媒体的问题
     document.addEventListener("WeixinJSBridgeReady",function() {
           window["WeixinJSBridge"].invoke('getNetworkType',{},function(e) {
               bg_audio.play();
               bg_audio.pause();
           });
     });
}

HTML5新增了哪些标签以及作用?

1.form相关:

  • input元素种类:参考地址https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input

    search:与text文本框类似,用于搜索;
    tel: 与text文本框类似,用于电话;
    url: 与text文本框类似,用于url格式的地址;
    email: 与text文本框类似,用于email格式的地址;
    number: 与text文本框类似,用于数值;
    range: 只允许输入一段范围内的数值,通过min和max属性来设置范围;
    color: 颜色文本框,“#000000”格式的文字;
    file: 文件选择文本框,HTML5中通过multiple属性可以多选;
    datetime、date、month、week、time、datetime-local 各种日期与时间输入的文本框;
    output: 定义不同类型的输出;

  • 表单验证相关:

    required属性:具有该属性的元素,如果其内容为空则不允许提交,并给出相应的提示。

    pattern属性:具有该属性的元素,如果内容不为空则把内容与pattern的值进行正则匹配,匹配不成功则不通过并提示。

    min属性和max属性:它们是值类型和日期类型的input元素专用属性,限制了输入的范围。

    step属性:控制元素的值增加或减少的步幅,如输入1-100之间的数字,且步幅是5,那么只能输入1、6、11....。

2.增强的页面元素

<head>
<nav>
<main>
<section>
<article>
<footer>
<figure>
<figcaption>
<video>
<audio>

3.作用

  1. 页面语义话,便于阅读。
  2. 利于搜索引擎分析页面。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.