GDSC NTUST
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    ###### tags: `課程` # 前後端系列 - 用實際例子帶你暸解前端 [TOC] ## 安裝 VScode 相關的Extension ## 開始! 1. 創新資料夾 在桌面創建一個新的資料夾 2. 打開 VScode 打開 VScode > 檔案 > 開啟資料夾,將剛才創建的資料夾打開,創建一個新的檔案 `index.html` 3. 創建 HTML 格式 在 `index.html` 中按下 `!`,按下 `tab` 在 `<head>` 中間加入一個 `<style>` ,等等的步驟會用到 :::info Emmet:用來快速生成HTML ::: 4. 加入 body 在 `body` 中輸入 `.login` ,按下 tab,他會自動幫你補全成: ```htmlmixed <body> <div class="login"></div> </body> ``` 5. 在 `style` 中加入 css 的 class 找到一張圖片加入 `background-image` 中,變成頁面的背景圖片 ```css .login{ background-image: url("img/100011.jpg"); } ``` 6. 開啟`index.html`,到瀏覽器的畫面,滑鼠右鍵+檢視(inspect),點選左上角的功能 ![](https://i.imgur.com/G1MqKNY.png) 7. 修改背景圖片大小 在 `head` > `style` > `.login` 中,加入 `width` 以及 `height` 標籤 ```css= .login { background-image: url(img/100011.jpg); width: 100vw; height: 100vh; } ``` 8. 背景不要有白邊,改掉margin ```css html, body{ margin: 0; } ``` 9. 調整背景圖片 我們希望圖片不要重複,所以加上 `background-repeat: no-repeat;` 將圖片的大小改成 `background-size: cover;` 然後讓圖片在中間 `background-position: center;` ```css= .login { background-image: url(img/100011.jpg); width: 100vw; height: 100vh; background-repeat: no-repeat; background-size: cover; background-position: center; } ``` 10. 放入表格 emmet小技巧`input*2` => 在按下Tab ```html <input type="text"><input type="text"> ``` 將第一個輸入框作為輸入帳號的地方, 第二個輸入框作為輸入密碼的地方, 再加入第三個 `input` 的標籤,將其 `type` 改為 `submit` :::info 連續選取多行小工具 Win `Ctr + Atl` 或 `Ctr + D` mac `Command + D` ::: 將第一、二個 `input` 加入 `placeholder`,作為使用者還未輸入時的提示語 ```htmlmixed! <form action=""> <input placeholder="帳號" type="text"> <input placeholder="密碼" type="password"> <input type="submit"> </form> ``` 11. 加入背景卡 我們要在輸入框後面加入一個白色的背景卡,所以在 `style` 的地方加入 `form` 的 `css` 樣式 ```css= form { width: d-color: white; } ``` 12. 將白色小卡置中 如果只是 `left: 50%`, `top: 50%`,可能會跟我們預期的置中不一樣 (因為定位是在左上角) 所以要使用 `calc()` 來計算出小卡的中心點 (把多的部分扣回來) ```css= form { width: 400px; height: 500px; background-color: white; position: relative; left: calc(50% - 200px); top: calc(50% - 250px); } ``` 圓角、模糊 ```css= form { width: 400px; height: 500px; background-color: #ffffff8a; position: relative; left: calc(50% - 200px); top: calc(50% - 250px); backdrop-filter: blur(20px) saturate(100%); border-radius: 30px; } ``` input 欄 ```css= input[type="text"], input[type="password"] { border-color: #2f7bf2; width: calc(100% - 60px); border-top: none; border-left: none; border-right: none; border-width: 3px; background: transparent; padding-bottom: 10px; font-size: 16px; outline: none; } ``` padding: 內距 margin: 外距 ![](https://i.imgur.com/esNgBAp.png) padding, margin 可以打多組(數字) 一組:套用所有方向 兩組:上下跟左右 四組:上下左右 submit button ```css= input[type="submit"] { background-color: #2f7bf2; color: white; padding: 15px 30px; border-radius: 38102389123px; border: none; } ``` (講師說 fcc 是 display: flex 水平置中 垂直置中) 寫完之後,套用到想要加的地方,就可以生效了 要加在想要置中的爸爸物件上 (class="fcc") ```css= .fcc{ display: flex; justify-content: center; align-items: center; } ``` 所以將 `class="fcc"` 加在 `form` ,但發現這樣不會是我們想要的結果 fcc 只會影響到下一層的最上面的小孩,所以要用 div 把它包起來 class 像是標籤,可以同時有很多個 class (用空格分開) ## 完整 code: ```htmlembedded <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Blabla</title> <style> body { margin: 0; } .fcc { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; } .login { background-image: url(./img/wallpaper.jpeg); width: 100vw; height: 100vh; background-repeat: no-repeat; background-size: cover; background-position: center; } form { width: 400px; height: 500px; background-color: #ffffff8a; position: relative; left: calc(50% - 200px); top: calc(50% - 250px); backdrop-filter: blur(20px) saturate(180%); border-radius: 30px; } form input[type="text"], form input[type="password"] { border-color: #2f7bf2; width: calc(100% - 60px); border-top: none; border-left: none; border-right: none; border-width: 3px; background: transparent; padding-bottom: 10px; font-size: 16px; outline: none; } form input[type="submit"] { background-color: #2f7bf2; color: white; padding: 10px 30px; border-radius: 9878123123123px; border: none; } .login .field { height: 200px; } .login .mess { width: 100%; padding: 30px; } </style> </head> <body> <div class="login"> <form action="" class="fcc"> <div class="mess"> <h2>It can work, fine!!</h2> <p>NTUST GDSC blabla</p> </div> <div class="fcc field"> <input placeholder="帳號" type="text"> <input placeholder="密碼" type="password"> <input type="submit"> </div> </form> </div> </body> </html> ```

    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