Jerry Wang
    • 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
    # HTML & CSS ## Box Model https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model#Types_of_CSS_boxes https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flow_Layout/Block_and_Inline_Layout_in_Normal_Flow ### Block boxes * 佔滿整個 container 的寬度 * 產生新的一行 * 可設定 width, height * padding, margin, border 會將其他的 element 推開 ### Inline boxes * 不會產生新的一行 * 無法設定 width, height * 設定上和下的 padding, margin, border 不會將其他的 element 推開 * 設定左和右的 padding, margin, border 會將其他的 element 推開 ### Outer display types * element 之間互相排版的方式 * inline, block ### Inner display types * element 在 container 內以何種方式排版 * flexbox, grid, normal flow(inline, block 樣式) ### others * inline-block (outer: inline, inner: block) * 可以設定 width, height * 上下的 padding, margin, border 會把其他的 element 推開 * inline-flex (outer: inline, inner: flex) ### Box model * content box * padding box * border box * margin box ### box sizing * standar * 設定 width, height 是給 content box * 整個元件實際看到的所佔的空間(width, height),還會加上了 content + padding, border * border-box * 設定 width, height 是給 content box + padding + border ### margin * 可以有負值 * element 之間 maring 重疊的話,會以 margin 大的當作顯示的margin ### border * 沒有負值 ### padding * 沒有負值 ## CSS layout ## position * relative 不會脫離原本的flow, 其他元素不會取代原本的位置 * absolute, fixed 會脫離原本的 flow,其他元素會取代其原本的位置。 * fixed, absolute 元素,原本是 block 的,fixed / absoluted 後,長寬不再佔滿整個 container,而是依照內容而決定長寬。 ## float * 會脫離原本的flow, 其他會取代其原本的位置。 * 原本是 block 的,float 後,長寬不再佔滿整個 container,而是依照內容而決定長寬。 ### Flex Layout one-dimensional layout * x-軸:main axis y-軸:cross axis * flex item (main size, cross size) * 預設的 flex item 是在row排列的(flex-direction: row;), 可改成用column 排列(flex-direction: column;) * flex 是一維的layout,但當column 數多時畫面會擁擠,此時可設置 flex-warp: warp; ,就會將column自動換行。 * flex-flow: row wrap ==> flex-direction: row; flex-wrap: wrap; * flex 對外為 block layout,內部為 flex layout。因此元件設為 flex 後,該元件及內部的 flex item ,都可以設定寬和高 (不論該元件及 flex item 原本為inline or block) * inline-flex => 對外是 inline, 對內是flex。因此如同 inline的特性,該元件的寬高是由內部的flex item 撐起來的。 * justify-content(左右), align-items(上下): flex container 控制 flex item 整行和整列的位置 * flex-direction: row 時,justify-content(左右), align-items(上下) * flex-direction: column 時,justify-content(上下), align-items(左右) * align-items 都是在做 cross axis 的 align * justify-content 都是在做 main axis 的 align * align-content: align-items 的多行版本(flex-wrap: wrap 時) * flex-direction: row 時,justify-content(左右), align-content(上下) * flex-direction: column 時,justify-content(上下), align-content(左右) * align-self: 控制 flex item 自己的位置 (做 cross axis 的 align) * flex: 「flex-grow」、「flex-shrink」和「flex-basis」 * flex: * initial: 等於 flex: 0 1 auto, 即使 container 中有剩餘空間,flex item 仍無法延伸,但當空間不足時,元素可收縮。 * auto: 等於 flex: 1 1 auto, flex item 可延伸與收縮,未佈滿 flex 容器時元件會伸長、超出 flex 容器時元件會壓縮。 * none: 等於 flex: 0 0 auto,flex item 不可延伸與收縮,是完全非彈性的:既不會縮短,也不會伸長来適應 flex 容器 ### Grid Layout two-dimensional layout * grid-template-columns, grid-template-rows * grid-template-areas * justify-items, align-items: grid container 控制 grid item 的位置 * justify-self, align-self:grid item 控制自己的位置 https://paper.dropbox.com/doc/HTML-learning--A15nD~Ma2Hcsn_Gh3wuPrz3sAg-OW2o8K75RgDqpYI2eU8fZ https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout https://github.com/OceanFireSoftware/python-simple-proxy https://themes.gohugo.io/hugo-future-imperfect-slim

    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