簡單說下我對H5的新增的標籤和css3的新增屬性

來源:互聯網
上載者:User

標籤:

  HTML 英文全稱是:HyperText  Markup  language; 中文全稱是超文字標記語言 (HTML)又稱超連結文本標記語言;

  H5呢就是HTML第五代版本;

  首先智能表單

<form action="" method="post">
<input type="color" name="" id="" value="" />
<input type="tel" required="required" autofocus="" autocomplete="off" pattern="" name="" id="" value="" />
<input type="submit"  onactivate=""  name="" id="" value="" />
</form>

  action 提交地址

  method 是提交方式 預設是GET get是沒有做任何保密。 然而POST是加密傳輸傳輸資料無限,

    required是必填項

    autocomoelete  是設定記憶輸入

    autofocus 自動聚焦

    pattern 是判斷正則

  下面是 canvas  畫圖板

    getContext("2d");設定畫筆

    

window.onload=function(){
var m=document.getElementById("mycanvas");
var pen=m.getContext("2d");
//pen.beginPath();
//pen.moveTo(100,100);
//pen.lineTo(220,200);
//pen.lineTo(300,20);
setInterval(function(){
pen.clearRect(0,0,400,400);
var n=Math.random()*300;
pen.beginPath();
pen.moveTo(10,n);
for (i=1;i<7;i++) {
n=Math.random()*300;
pen.lineTo(10+i*50,n);
}
pen.stroke();
pen.closePath();
},1000)


}

這是一個隨機畫線的指令碼

moveTo(100,100); 畫筆起點

lineTo畫線、

closePath() 結束畫圖

.beginPath() 開始繪圖

下面是音視頻

 

video

window.onload=function(){
btn1=document.getElementById("btn1").getElementsByTagName("button");
v=document.getElementById("videol");
zong=document.getElementById("zong");
dang=document.getElementById("dang");
p1=document.getElementById("p");
li1=document.getElementById("ul1").getElementsByTagName("li");
btn1[0].onclick=function(){

if(v.paused==false){
v.pause();
this.innerHTML="播放"
}else{

v.play();
this.innerHTML="暫停"
zong.innerHTML=Math.round(v.duration);
}
btn1[1].onclick=function(){
v.volume-=0.1;
}
btn1[2].onclick=function(){
v.volume+=0.1;
}
btn1[3].onclick=function(){
if(v.muted==false){
v.muted=true;
this.innerHTML="恢複"
}else{
v.muted=false;
this.innerHTML="靜音"
}
btn1[4].onclick=function(){
v.currentTime-=10;
}
btn1[5].onclick=function(){
v.currentTime+=10;
}
btn1[6].onclick=function(){
v.mozRequestFullScreen();
}
btn1[7].onclick=function(){
v.playbackRate=0.5;//滿放
}
btn1[8].onclick=function(){
v.playbackRate=5;
}
btn1[9].onclick=function(){
v.playbackRate=1;
}

}

}
setInterval(function(){
dang.innerHTML=Math.round(v.currentTime);
m=v.currentTime/v.duration;
p1.value=m*100;
},100);
for(var i=0; i<li1.length;i++){
li1[i].onclick=function(){

v.src=this.title;
}
}

}

上面是視頻的簡單控制項 moz   webkit o ms快進 快退webkit 不支援;

開始css3

css 英文全稱是 Cascading style sheet; 中文全稱是層疊樣式表;

CSS3 就是在css基礎上加了點東西而已

     
@keyframes 規定動畫。 3
animation 所有動畫屬性的簡寫屬性,除了 animation-play-state 屬性。 3
animation-name 規定 @keyframes 動畫的名稱。 3
animation-duration 規定動畫完成一個周期所花費的秒或毫秒。預設是 0。 3
animation-timing-function 規定動畫的速度曲線。預設是 "ease"。 3
animation-delay 規定動畫何時開始。預設是 0。 3
animation-iteration-count 規定動畫被播放的次數。預設是 1。 3
animation-direction 規定動畫是否在下一周期逆向地播放。預設是 "normal"。 3
animation-play-state 規定動畫是否正在運行或暫停。預設是 "running"。 3

上面是動畫屬性轉載 W3School

 

簡單說下我對H5的新增的標籤和css3的新增屬性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.