第 1 章 html5 怎么工作的

1. html5 的語法結(jié)構(gòu)

<!doctype html >
<html>
   <head>
      <meta charset="UTF-8">
      <title> 網(wǎng)頁 </title>
      <link ref="stylesheet "  href=" style.css" >
      <script src="script.js"></script>
      <base src="./ ">
  <head>
  <body>
        <h1>this is a  head </h1>
        <p> this is  a  paragraph</p>
         <p>
                today is a good day.  it's sunny.
                <img src="weather.jpg">  
         </p>
  </body>
</html>

2. Html, Css , JavaScript 分別起什么作用

3. html5 是如何工作的

  1. 瀏覽器加載一個(gè)由 html 和 css 寫的文檔

document
markup written in HTML
style written in CSS

the browser loads a document, including markup written in HTML and style written in CSS

  1. 當(dāng)瀏覽器加載你的網(wǎng)頁的同時(shí), 內(nèi)部創(chuàng)建了一個(gè) 你的文檔模型, 該模型包含了 html 標(biāo)記語言的全部元素。

model of your document
一個(gè)表示 html 元素的樹結(jié)構(gòu)對(duì)象, 我們稱這個(gè)樹為 Document Object Model , 簡(jiǎn)稱 DOM

  1. 當(dāng)瀏覽器加載網(wǎng)頁的時(shí)候, 同時(shí)也加載了 javaScript 代碼, 只是一般在網(wǎng)頁加載后執(zhí)行

你可以使用 javaScript 操控 DOM 與網(wǎng)頁交互, 對(duì)用戶和瀏覽器事件做出響應(yīng), 或者使用新的JavaScript API 接口與用戶交互。

  1. 通過API 可以訪問 audio video 2D drawing with the canvas , local storage 和其他需要?jiǎng)?chuàng)建app 的技術(shù)

API 即 Application , Programming Interfaces
暴露一些 objects , methods , properties ,我們能夠通過他們?cè)L問這些技術(shù)的所有功能。

Bulliet Points

  1. <script> tag 或者 in a stylesheet link to CSS , 不再需要 type 屬性, JavaScript 和 CSS 是默認(rèn)使用的。

  2. html5 中的許多新特性需要使用 javaScript

  3. 使用 JavaScript 能與 DOM 交互 。DOM , Document Object Model

  4. DOM 是網(wǎng)頁的內(nèi)部表示, 使用 JavaScript 你能訪問元素,改變?cè)卦黾有略氐?DOM

  5. JavaScript API 是一個(gè)應(yīng)用編程接口,API 能夠控制html5 的方方面面,例如 2D drawing , video playback 等。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容