ChunHsing Wu
    • 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 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
    • 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 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Freecodecamp Applied Visual Design ###### tags: `freecodecamp` ## 挑戰1: Create Visual Balance Using the text-align Property Text is often a large part of web content. CSS has several options for how to align it with the text-align property. **`text-align: justify`** causes all lines of text except the last line to meet the left and right edges of the line box. **`text-align: center`** centers the text **`text-align: right`** right-aligns the text **`text-align: left`** (the default) left-aligns the text. ## 挑戰2: Adjust the Width of an Element Using the width Property ``` img { width: 220px; } ``` ## 挑戰3: Adjust the Height of an Element Using the height Property ``` img { height: 20px; } ``` ## 挑戰4: Use the strong Tag to Make Text Bold 如果需要把文字變粗體,可以透過`font-weight: bold;` 的做法來執行 ![](https://i.imgur.com/0W5AvIm.png) 但如果需要特定文字變粗體,則需要使用<strong></strong> ![](https://i.imgur.com/4URo83a.png) ## 挑戰5: Use the u Tag to Underline Text 如果需要把文字加上底線,可以使用css的`text-decoration: underline;`特性來進行 ![](https://i.imgur.com/WrhYbBy.png) 如果是部分文字,則是可以使用<u></u>的方式來進行 ![](https://i.imgur.com/FyYvBxS.png) ## 挑戰6: Use the em Tag to Italicize Text 如果要透過css來斜體,可以使用`font-style: italic;` ![](https://i.imgur.com/pkPicvx.png) 如果是部分文字,可以使用<em></em>來進行 ![](https://i.imgur.com/avaxx7z.png) ## 挑戰7: Use the s Tag to Strikethrough Text 刪除線可以使用`text-decoration: line-through;` ![](https://i.imgur.com/ZxbRxAW.png) 可以使用<s></s>來為部分內容加上刪除線 ![](https://i.imgur.com/PTBUvXV.png) ## 挑戰8: Create a Horizontal Line Using the hr Element 使用`<hr>`則可加入水平線 ![](https://i.imgur.com/J0JMax6.png) ## 挑戰9: Adjust the background-color Property of TextPassed 使用`background-color: rgba(45, 45, 45, 0.1)` 的作法,可以調整顏色與透明度 ![](https://i.imgur.com/28dz1uo.png) ## 挑戰10: Adjust the Size of a Header Versus a Paragraph Tab 由於h1-h6都有自訂字體,可以再css裡面進行修改 ![](https://i.imgur.com/bmy4W1Z.png) ## 挑戰11: Add a box-shadow to a Card-like Element 如何增加陰影: ![](https://i.imgur.com/qFDj5vQ.png) The box-shadow property takes values for `offset-x` (how far to push the shadow horizontally from the element), `offset-y` (how far to push the shadow vertically from the element), `blur-radius`(Optional) `spread-radius`(Optional) `color` ``` box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); ``` ## 挑戰12: Decrease the Opacity of an Element The opacity property in CSS is used to adjust the opacity, or conversely, the transparency for an item. 1. A value of 1 is opaque, which isn't transparent at all. 2. A value of 0.5 is half see-through. 3. A value of 0 is completely transparent. ![](https://i.imgur.com/HbXDpdH.png) ## 挑戰13: Use the text-transform Property to Make Text Uppercase ![](https://i.imgur.com/NLks4Kf.png) ![](https://i.imgur.com/Rgeq8ZG.png) ## 挑戰14: Set the font-size for Multiple Heading Elements ![](https://i.imgur.com/uOZfYg6.png) ## 挑戰15: Set the font-weight for Multiple Heading Elements ![](https://i.imgur.com/VIQwIN7.png) ## 挑戰16: Set the font-size of Paragraph Text ![](https://i.imgur.com/Bjz1ToV.png) ## 挑戰17: Set the line-height of Paragraphs ![](https://i.imgur.com/W71x2Lw.png) ## 挑戰18: Adjust the Hover State of an Anchor Tag 使用Hover可以讓游標指向的地方立刻變換狀態 ![](https://i.imgur.com/Aklfe0M.png) ## 挑戰19: Change an Element's Relative Position The following example moves the paragraph 10 pixels away from the bottom: ``` p { position: relative; bottom: 10px; } ``` ![](https://i.imgur.com/sSgDoBX.png) ## 挑戰20: Move a Relatively Positioned Element with CSS Offsets ![](https://i.imgur.com/JDg8IiS.png) ## 挑戰21: Lock an Element to its Parent with Absolute Positioning ![](https://i.imgur.com/lvSGtKh.png) ## 挑戰22: Lock an Element to the Browser Window with Fixed Positioning fixed position: which is a type of absolute positioning that locks an element relative to the browser window. 凍結窗格的概念啦!! One key difference between the fixed and absolute positions is that an element with a fixed position won't move when the user scrolls. ![](https://i.imgur.com/43WbkZY.png) ## 挑戰23: Push Elements Left or Right with the float Property Floating elements are removed from the normal flow of a document and pushed to either the left or right of their containing parent element. It's commonly used with the width property to specify how much horizontal space the floated element requires. 透過float可以讓該物件自動靠上、右、下、左 ![](https://i.imgur.com/bO6TJ1j.png) ## 挑戰24: Change the Position of Overlapping Elements with the z-index Property z-index越大,代表塗層越前面 ![](https://i.imgur.com/6CJ1kzj.png) ## 挑戰25: Center an Element Horizontally Using the margin Property ![](https://i.imgur.com/wBg2HIy.png) ## 挑戰26: Learn about Complementary Colors ![](https://i.imgur.com/BEsZGcY.png) ## 挑戰27: Applied Visual Design: Learn about Tertiary Colors Tertiary colors: the result of combining a primary color with one of its secondary color neighbors. ![](https://i.imgur.com/PI7nBdi.png) ![](https://i.imgur.com/uvv4fEu.png) ## 挑戰28: Adjust the Color of Various Elements to Complementary Colors ![](https://i.imgur.com/NNGAIMT.png) ![](https://i.imgur.com/NvUAEhB.png) ## 挑戰29: Adjust the Hue of a Color ![](https://i.imgur.com/G1Z4deb.png) `Hue` people generally think of as 'color'. If you picture a spectrum of colors starting with red on the left, moving through green in the middle, and blue on right, the hue is where a color fits along this line. In hsl(), hue uses a color wheel concept instead of the spectrum, where the angle of the color on the circle is given as a value between 0 and 360. `aturation` the amount of gray in a color. A fully saturated color has no gray in it, and a minimally saturated color is almost completely gray. This is given as a percentage with 100% being fully saturated. `Lightness` the amount of white or black in a color. A percentage is given ranging from 0% (black) to 100% (white), where 50% is the normal color. ![](https://i.imgur.com/lu2dRKh.png) ![](https://i.imgur.com/InlySqn.png) ## 挑戰30: Adjust the Tone of a Color ![](https://i.imgur.com/VooqlDb.png) ## 挑戰31: Create a Gradual CSS Linear Gradient CSS provides the ability to use color transitions, otherwise known as gradients, on elements. This is accessed through the background property's linear-gradient() function. Here is the general syntax: ``` background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...); ``` ![](https://i.imgur.com/ttiK9Lq.png) ## 挑戰32: Use a CSS Linear Gradient to Create a Striped Element repeating-linear-gradient() function is very similar to linear-gradient() the major difference that it repeats the specified gradient pattern. ![](https://i.imgur.com/y2fHTKa.png) ![](https://i.imgur.com/md53efy.png) ## 挑戰33: Create Texture by Adding a Subtle Pattern as a Background Image 透過網址套用材質色當背景 ![](https://i.imgur.com/HApkMtB.png) ## 挑戰34: Use the CSS Transform scale Property to Change the Size of an Element doubles the size of all the paragraph elements on the page: ``` p { transform: scale(2); } ``` ![](https://i.imgur.com/osnYN2z.png) ## 挑戰35: Use the CSS Transform scale Property to Scale an Element on Hover Here's an example to scale the paragraph elements to 2.1 times their original size when a user hovers over them: ``` p:hover { transform: scale(2.1); } ``` ![](https://i.imgur.com/IuqxTEu.png) ## 挑戰36: Use the CSS Transform Property skewX to Skew an Element Along the X-Axis ![](https://i.imgur.com/INm26bX.png) ## 挑戰37: Use the CSS Transform Property skewY to Skew an Element Along the Y-Axis ![](https://i.imgur.com/lq4hzkd.png) ## 挑戰38: Create a Graphic Using CSS ![](https://i.imgur.com/gXU8DSA.png) ![](https://i.imgur.com/Mko017j.png) ## 挑戰39: Create a More Complex Shape Using CSS and HTML ![](https://i.imgur.com/jFvwjkE.png) 1. pseudo-elements `::before` and `::after` ``` These pseudo-elements are used to add something before or after a selected element. ``` In the following example, a **::before pseudo-element** is used to **add a rectangle to an element with the class heart.** ``` .heart::before { content: ""; background-color: yellow; border-radius: 25%; position: absolute; height: 50px; width: 70px; top: -50px; left: 5px; } ``` For the ::before and ::after pseudo-elements to function properly, they must have a defined `content` property. This property is usually used to add things like a **photo** or **text** to the selected element. When the ::before and ::after pseudo-elements are used to make **shapes**, the content property is still required, but it's set to an **empty string**. In the above example, the element with the class of heart has a ::before pseudo-element that produces a **yellow rectangle** with height and width of 50px and 70px, respectively. This rectangle has round corners due to its 25% border radius and is positioned absolutely at 5px from the left and 50px above the top of the element. ![](https://i.imgur.com/kbAgGBi.png) ![](https://i.imgur.com/bU9avnD.png) ## 挑戰40: Learn How the CSS @keyframes and animation Properties Work Function: To animate an element. 8 animation properties in total. `animation-name` : sets the name of the animation, which is later used by `@keyframes` to tell CSS which rules go with which animations. `animation-duration` sets the length of time for the animation. `@keyframes` is how to specify exactly what happens within the animation over the duration. This is done by giving CSS properties for specific "frames" during the animation, with percentages ranging from 0% to 100%. example: If you compare this to a movie: 1. the CSS properties for 0% is how the element displays in the opening scene. 2. The CSS properties for 100% is how the element appears at the end, right before the credits roll. Then CSS applies the magic to transition the element over the given duration to act out the scene. The usage of `@keyframes` : ``` #anim { animation-name: colorful; animation-duration: 3s; } @keyframes colorful { 0% { background-color: blue; } 100% { background-color: yellow; } } ``` For the element with the anim id: `animation-name` to colorful and sets the animation-duration to 3 seconds. `@keyframes` rule links to the animation properties with the name colorful. It sets the color to blue at the beginning of the animation (0%) which will transition to yellow by the end of the animation (100%). You aren't limited to only beginning-end transitions, you can set properties for the element for any percentage between 0% and 100%. ![](https://i.imgur.com/sIBspBh.png) ## 挑戰41: Use CSS Animation to Change the Hover State of a Button ![](https://i.imgur.com/NBwEYES.png) You can use CSS @keyframes to change the color of a button in its hover state. Here's an example of changing the width of an image on hover: ``` <style> img:hover { animation-name: width; animation-duration: 500ms; } @keyframes width { 100% { width: 40px; } } </style> <img src="https://bit.ly/smallgooglelogo" alt="Google's Logo" /> Note that ms stands for milliseconds, where 1000ms is equal to 1s. ``` ![](https://i.imgur.com/jf5v6gj.png) ## 挑戰42: Modify Fill Mode of an Animation Notice how the animation resets after 500ms has passed, causing the button to revert back to the original color. You want the button to **stay highlighted**. This can be done by setting the `animation-fill-mode` property to forwards. ![](https://i.imgur.com/Me5w8fo.png) ## 挑戰43: Create Movement Using CSS Animation When elements have a specified position, such as fixed or relative, the CSS offset properties right, left, top, and bottom can be used in animation rules to create movement. ``` @keyframes rainbow { 0% { background-color: blue; top: 0px; } 50% { background-color: green; top: 50px; } 100% { background-color: yellow; top: 0px; } } ``` Add a horizontal motion to the `div` animation. Using the left offset property, add to the @keyframes rule so rainbow starts at 0 pixels at 0%, moves to 25 pixels at 50%, and ends at -25 pixels at 100%. Don't replace the top property in the editor - the animation should have both **vertical** and **horizontal** motion. ![](https://i.imgur.com/Vd8oGnP.png) ## 挑戰44 Create Visual Direction by Fading an Element from Left to Right 會動的圓球~ 如何讓它漸層不見 ![](https://i.imgur.com/EFzJIbU.png) ## 挑戰45 Animate Elements Continually Using an Infinite Animation Count 如何讓圖片無限跳動? 透過這個selector,可以調整次序 `animation-iteration-count: ininite;` ![](https://i.imgur.com/QgUvfih.png) ## 挑戰46 Make a CSS Heartbeat using an Infinite Animation Count 創造無限的心跳 ``` <style> .back { position: fixed; padding: 0; margin: 0; top: 0; left: 0; width: 100%; height: 100%; background: white; animation-name: backdiv; animation-duration: 1s; animation-iteration-count: infinite; } .heart { position: absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; background-color: pink; height: 50px; width: 50px; transform: rotate(-45deg); animation-name: beat; animation-duration: 1s; animation-iteration-count: infinite; } .heart:after { background-color: pink; content: ""; border-radius: 50%; position: absolute; width: 50px; height: 50px; top: 0px; left: 25px; } .heart:before { background-color: pink; content: ""; border-radius: 50%; position: absolute; width: 50px; height: 50px; top: -25px; left: 0px; } @keyframes backdiv { 50% { background: #ffe6f2; } } @keyframes beat { 0% { transform: scale(1) rotate(-45deg); } 50% { transform: scale(0.6) rotate(-45deg); } } </style> <div class="back"></div> <div class="heart"></div> ``` ## 挑戰46 Animate Elements at Variable Rates 透過修改keyframe rules的比率,可以使得速度也有所調整 ![](https://i.imgur.com/UjKTvaJ.png) ## 挑戰47 Animate Multiple Elements at Variable Rates 調整Animation Duration也是可以的喔 ![](https://i.imgur.com/WRVX2yr.png) ## 挑戰48 Change Animation Timing with Keywords 透過 `animation-timing-function`來調整落下速度 `ease` default,一開始很快,然後中間加速,後來又減速 `ease-out` 先加速後減速 `ease-in` 慢速然後加速 `linear` 始終維持原有速度 ![](https://i.imgur.com/eD1kZgv.png) ## 挑戰49 Learn How Bezier Curves Work animation-timing-function property from `linear` to its equivalent `cubic-bezier` function value. ![](https://i.imgur.com/8N45j4w.png) ## 挑戰50 Use a Bezier Curve to Move a Graphic 如果需要移動,也可以用Bezier來調整 ![](https://i.imgur.com/sMrMi7n.png) ## 挑戰51 Make Motion More Natural Using a Bezier Curve 調整球體速度 ![](https://i.imgur.com/K8hVzdm.png)

    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