torus-silver
    • 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
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • 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

      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.
      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
    • Engagement control
    • 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
Engagement control 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
Engagement control Commenting, Suggest edit, Emoji Reply
  • 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

    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.
    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 筆記 [toc] ### HTML * 表格 | tr1,th1 | tr1,th2 | tr1,th3 | | ------- | ------- | ------- | | tr2,td1 | tr2,td2 | tr2,td3 | | tr3,td1 | tr3,td2 | tr3,td3 | ``` <table border="1"> <tr> <th> tr1,th1 </th> <th> tr1,th2 </th> <th> tr1,th3 </th> </tr> <tr> <td> tr2,td1 </td> <td> tr2,td2 </td> <td> tr2,td3 </td> </tr>    <tr> <td> tr3,td1 </td> <td> tr3,td2 </td> <td> tr3,td3 </td> </tr>  </table> ``` ![](https://i.imgur.com/D8nyElg.jpg) * 超連結 [YouTube](https://www.youtube.com/) ``` //href指定連結所指向的網頁的URL <a href="http://www.youtube.com">超連結</a> //顯示文字 // 要在新視窗開啟超連結就加 target="_blank" <a href="http://www.youtune.com"><img src="front1.png"/></a> //顯示圖片 <a href="#" onclick="abc()">文字</a> //點擊文字呼叫js函式 ``` * 同一頁內超連結 <a href="#HTML">HTML</a> ``` <a href="#abc">HTML</a> //點擊這裡 <h3 id="abc">HTML</h3> //跳到這裡 ``` * 按鈕 ``` <input type="button" value="buttonname" onclick="function()"/>  // 添加一個按鈕,點擊呼叫js函式 <input type="image" src="button.png" onClick="functionfunction()"/>  // 添加一個圖片按鈕,點擊呼叫js函式 ``` * 註解 ``` <!-- 註解 --> ``` * 換行 ``` <br> //換一行 <p> //換兩行 ``` * 段落 ``` <p> 段落 </p> ``` * 格線 ``` <hr> ``` * 添加 ``` <input type="blank"/> //blank代換成要添加的格式 //比如blank → text 表示添加一個文字輸入欄 ``` * 插入圖片 ``` //src指定了要顯示的圖像路徑 //width和height指定了圖片的寬和長 //alt為圖像提供了一个備用文本 <img src="myPic.jpg" width="120" height="60"/> //width和height都不寫 → 原圖大小 //只寫width → 依原圖比例和width數值調整height //只寫height → 依原圖比例和height數值調整width //都寫 → 依width和height的數值調整圖片大小及比例 ``` --- ### CSS * CSS樣式使用方法 1. 使用 class 和 id 對應 CSS 樣式 在網頁的<head>標籤中添加以下敘述以定義樣式: ``` <style type="text/css"> redtext {color: red;} bluetext {color: blue;} //樣式名稱 {屬性: 值} </style> <p class="redtext">hello</p> //對應redtext開頭的樣式 <p id="bluetext">world</p> //對應bluetext開頭的樣式 //在一個頁面中,同一個class可多次使用,但同一個id只能使用一次 2. 使用外部 CSS 樣式 新增一個"text.css" 連結外部CSS樣式在head中 `<link rel="stylesheet" type="text/css" href="test.css">` 3. 直接套用 CSS 樣式 (不需事先定義) `<p style="color: blue;">hello</p>` * 設定填充 ``` padding-top:25px; //上內邊距 padding-bottom:25px; //下內邊距 padding-right:50px; //右內邊距 padding-left:50px; //左內邊距 ``` ``` padding:25px 50px 75px 100px; //上 右 下 左 padding:25px 50px 75px; //上 左右 下 padding:25px 50px; //上下 左右 padding:25px; //上下左右 ``` * 設定外邊距 ``` margin-top:100px; //上外邊距 margin-bottom:100px; //下外邊距 margin-right:50px; //右外邊距 margin-left:50px; //左外邊距 ``` ``` margin:25px 50px 75px 100px; //上 右 下 左 margin:25px 50px 75px; //上 左右 下 margin:25px 50px; //上下 左右 margin:25px; //上下左右 ``` --- ### JavaScript * 函式 ``` function f() { // 執行程式碼 } ``` * 判斷 ``` if (condition1) { //當condition1為true時執行的程式碼 } else if (condition2) { //當condition2為true時執行的程式碼 } else { //當condition1和condition2皆為false時執行的程式碼 } ``` * 迴圈 ``` for (statement1; statement2; statement3) { 當statement2為true時執行的程式碼 } //statement1 程式碼開始前執行 //statement2 定義執行循環程式碼的條件 //statement3 在循環程式碼執行後執行 ``` * 字串 ``` //儲存字串可用單引或雙引號 var carname = "character "; var carname = 'character '; //可使用索引位置來訪問字串中的每個字元 var character = carname[7]; //字串的索引從0開始,故7為e //你可以在字串中使用引號,字串中的引號不要與字串的引號相同 var answer = "It's alright"; var answer = "He is called 'Johnny'"; var answer = 'He is called "Johnny"'; //可在字串添加轉義字元來使用引號 var x = 'It\' s alright'; var y = "He is called \"Johnny\" "; //可使用length計算字串的長度 var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var a = txt.length; //a == 26 ``` * 陣列 ``` var a=[1, 2, 3, 4, 5]; //宣告陣列a a.push(6) //把6推入陣列尾端 a.concat([6,7,8]) //將兩陣列連接起來後傳回,但必須注意這並不會改變a的內容 b=a.concat([6,7,8]) //如果想把連接的結果記住,可以塞給某變數,例如b a.reverse() //將陣列反轉 a.shift() //從陣列頭部取出一個元素 b.slice(2,4) //用slice取出其中第2個到第4個之間的子陣列(這只會傳回 b[2], b[3], 不包含 b[4])(從b[0]開始算) a.sort() //將a排序(預設為由小到大排列) ``` --- ### 資料 [w3schools](https://www.w3schools.com/html/default.asp) [RUNOOB](https://www.runoob.com/html/html-tutorial.html) [老師的書籍](https://kinmen6.com/root/%E9%99%B3%E9%8D%BE%E8%AA%A0/%E6%9B%B8%E7%B1%8D/JavaScript/) ###### tags: `網頁設計` `大一下課程`

    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

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    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