Chi-Chung Chang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## HTML、CSS和JavaScipt #### >[!Important]推薦學習網站 [W3C School](https://www.w3schools.com/) ### 一、環境準備 網頁前端三個重要技術:HTML、CSS 和 JavaScript。建立一個簡易的 Web 伺服器,將方便我們學習它們,有兩個方式: - 利用 python 內建的 http 伺服器 先切換到 Web 伺服器所在的資料夾,再利用命令 **python -m http.server 80** 其中 80 表示服務埠號 ![image](https://hackmd.io/_uploads/SyfGaupbgx.png) - 利用 XAMPP 建立 XAMPP 包含了 Apache、MariaDB、PHP 和 Perl 四個服務,請到 [XAMPP](https://www.apachefriends.org/zh_tw/index.html) 的網站下載。如果下載 portable 版本,可以不用安裝,直接解壓縮就可以使用。 ![image](https://hackmd.io/_uploads/rJDxCOTWxg.png) ### 二、HTML :::info 網頁基礎框架 ::: ```html= <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <!-- 網頁內容描述 --> <meta name="description" content="A simple HTML document"> <meta name="keywords" content="HTML, CSS, JavaScript"> <meta name="author" content="Your Name"> <link rel="stylesheet" href="styles.css"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <!-- 網頁標題 --> <title>Document</title> </head> <body> <header> <h1>Welcome to My Web Page</h1> </header> <nav> <ul> <li><a href="#home">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#contact">Contact</a></li> </ul> </nav> <main> <section id="home"> <h2>Home Section</h2> <p>This is the home section of the webpage.</p> </section> <section id="about"> <h2>About Section</h2> <p>This section contains information about the webpage.</p> </section> <section id="contact"> <h2>Contact Section</h2> <p>You can contact us through this section.</p> </section> </main> <footer> <p>&copy; 2025 Your Name. All rights reserved.</p> </footer> <!-- JavaScript --> <script src="script.js"></script> </body> </html> ``` :::info 元素(element)的標籤(tag)與屬性(attribute) ::: ![image](https://hackmd.io/_uploads/Skl31Kpbeg.png) >[!Tip] 常見的 HTML 元素 ```html 標題 <h1> ... <h6> 分隔線 <hr> 段落 <p> </p> 換行 <br> 圖片 <img src="#" text="說明" alt="替代顯示"> 超連結 <a href="#" target=" ">…</a> target:_blank、_self、_top、_parent 無序清單 <ul> <li> ... </li> </ul> 有序清單 <ol> <li> ... </li> </ol> 表格 <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Points</th> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table> 群組 <fieldset> <legend> 群組標題 </legend> </fieldset> 程式碼 <code> </code> 保持原始格式 <pre> </pre> 內嵌頁框 <iframe src="http://www.w3schools.com"> </iframe> 聲音 <audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> 影像 <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video> 特定區塊 <div> </div> <span> </span> ``` >[!Note] 特殊字元 ```html non breaking space &nbsp; < &lt; > &gt; & &amp; © &copy; ® &reg; ``` >[!Tip] 表單元素 ```html 表單 <form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"> <label for="username">ID:</label> <input type="text" id="username" name="username"> <label for="passwd">Password:</label> <input type="password" id="passwd" name="passwd" > </form> 按鈕 <input type="button" name="mybutton" value="確定" > <input type="submit" name="submit" value="送出" > <input type="reset" name="reset" value="重設" > 文字輸入框 <input type="password" name="passwd" /> <input type="text" name="username" value="exam" /> <textarea name="memo" rows="10" cols="30"> 人生不相見,動如參與商。 </textarea> 隱藏資訊 <input type="hidden" name="page" value="exam" /> 多選框 <input type="checkbox" name="fruits[]" value="Apple" > Apple <input type="checkbox" name="fruits[]" value="Banana" > Banana <input type="checkbox" name="fruits[]" value="Grape" > Grape 單選框 <input type="radio" name="sex" value="男" >男生 <input type="radio" name="sex" value="女" >女生 下拉式選單 <select name="cars"> <option value="Volvo"> Volvo </option> <option value="Bmw"> Bmw </option> <option value="Toyota"> Toyota </option> </select> ``` :::info 區塊元素與行內元素 ::: HTML的標籤分為區塊元素以及行內元素。區塊元素預設會佔用所在位置的區域,因此其他元素只能在此區塊元素的前面或後面,無法與區塊元素並列一起;行內元素剛好與區塊元素相反,行內元素預設會與其他元素共存在一起,不會排斥。 常見的區塊元素 div、p、ul、ol;行內元素 a、img、span、br ### 三、CSS :::success 框格模型 box-model ::: ![image](https://hackmd.io/_uploads/ByTEVvZfge.png) :::success 選取器(Selector)、屬性 (Property)與屬性值 (Value) ::: ```css= .one /*選取器*/ { /* 屬性: 屬性值 */ width: 200px; padding: 100px; margin: 50px; border-color: darkgreen; border-style: dotted; border-width: 5px; } ``` :::success 常見的選取器 ::: ```css Class selectors(類別選擇器) .one { } Id selectors(id 選擇器) #one { } Type selectors(型態選擇器) p { } Universal selector(通用選擇器) * { } ``` :::success 虛擬類別 ::: ```css :link 連結平常的樣式 :visited 連結查閱後的樣式 :hover 滑鼠滑入的樣式 :active 滑鼠按下的樣式 :focus 目標為焦點的樣式 :first-child 第一個元素的樣式 :last-child 最後一個元素的樣式 ``` ### 四、JavaScript :::warning DOM 與 JavaScript :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully