Peiyun Lee
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `前端技能樹` # 用HTML、CSS打造個人網站 (2) > 在上一篇:[用HTML、CSS、JS打造個人網站 (1)](),講解了開發網頁的前置作業,以及 Header 跟 Section-Primary 的區塊,接下來就讓我們來完成剩下的三個區塊 **Works**、**About** 和 **Footer**。 ## Selected-works ![](https://i.imgur.com/l3cON8S.png) ### 建構內容 一樣先拆解架構,**藍區是網頁顯示的內容 / 紅區是包裹的容器**。跟 Section-Primary 一樣,最外層用 ```<section>``` 和 ```wrapper-content``` 包住,內部則會分成 **Title** 和 **WorkList** 兩塊。 index.html ```html= ... <section class="section-selected-works"> <div class="secondary-content wrapper-content"> <h2 class="secondary__title section__title">Selected works</h2> <div class="wrapper-selected-works"> <div class="wrapper-work">...(作品1)</div> <div class="wrapper-work">...(作品2)</div> <div class="wrapper-work">...(作品3)</div> </div> </div> </section> ``` ![](https://i.imgur.com/13YgB3a.png) ```html= ... <div class="wrapper-work"> <img src="assets/images/selected-work-2.png" alt=""> <div class="wrapper-work-text"> <h3 class="work__title">呷蝦咪</h3> <div class="work__position">Front-end Engineer<br>UI Designer</div> <div >外賣點餐平台<br>提供店家外賣以及顧客點餐的服務</div> <a href="" class="work__link-button link-button">View Detail</a> <div>or <a href="" class="work__link link-text">View all works</a></div> </div> </div> ... ``` >三個作品的架構都一樣,只要修改文字內容就可以囉。 ### 設定排版、寬高樣式 觀察一下設計稿,Works 和 About 區塊存在一些相同的樣式,可以抽離這些樣式,一併設定在 ```secondary-content``` 裡。 style.css ```css= ... .secondary-content { padding-top: 80px; padding-bottom: 80px; display: flex; flex-direction: column; align-items: center; } .wrapper-selected-works { width: 95%; display: flex; justify-content: space-between; } ``` ![](https://i.imgur.com/CIUg3tF.png) ### 設定外觀、文字 設定每個作品的內容樣式,Button 直接套上之前設定的 ```link-button```,另外設定 ```work__link-button``` 其他屬性;也抽離可重複使用的 ```secondary__title```。 ```css= ... .secondary__title { font-size: 36px; margin-bottom: 50px; } .work__title { font-size: 24px; margin-top: 20px; margin-bottom: 10px; } .work__position { color: #777; height: 46px; margin-bottom: 10px; } .work__link-button { margin-top: 30px; margin-bottom: 20px; } .work__link { font-weight: bold; text-decoration: underline; } ``` ![](https://i.imgur.com/nc7py9r.png) >完成 Selected-works! ## Section-about ![](https://i.imgur.com/kmpvmc7.png) ### 建構內容 除了最外層用 ```<section>``` 和 ```wrapper-content``` 包住,在上一個區塊已經設定好 ```secondary-content``` 的共同樣式,就可以直接套用。內部會分成 **Title、圖片** 和 **文字介紹**,不過這邊要將圖片和文字介紹包起來,方便之後去作排版設定。 index.html ```html= <main> ... <section class="section-about"> <div class="secondary-content wrapper-content"> <h2 class="secondary__title section__title">About</h2> <div class="wrapper-about"> <img class="about__img" src="assets/images/me-big.png" alt=""> <div class="wrapper-about-text"> ...(右欄文字介紹) </div> </div> </div> </section> </main> ``` ![](https://i.imgur.com/POwnLBi.png) ```html= ... <div class="wrapper-about-text"> <p>我主要的專長是程式開發,曾經嘗試過網頁/APP、遊戲開發。目前我則專注於網頁、APP前端領域,並且持續學習更多有關UI/UX、AI人工智慧的知識。</p> <div class="about__title">Used Technologies</div> <ul class="about__skill-list"> <li class="about__skill-item">Git/Github</li> <li class="about__skill-item">Vue</li> <li class="about__skill-item">C/C++/C#</li> <li class="about__skill-item">JavaScript</li> <li class="about__skill-item">React</li> </ul> <div class="about__title">Learning now</div> <ul class="about__skill-list"> <li class="about__skill-item">Typescript</li> <li class="about__skill-item">Python</li> </ul> <a href="" class="about__link-button link-button">More About Me</a> </div> ... ``` ### 設定排版、寬高樣式 內部的元素都會使用百分比設定寬高,它就會根據父元素去做縮放調整,會有利於之後進行的 RWD 設計。 style.css ```css= ... .wrapper-about { width: 80%; display: flex; align-items: flex-start; justify-content: space-between; } .about__img { margin-top: 40px; } .wrapper-about-text { width: 60%; } ``` ![](https://i.imgur.com/ljhCVrv.png) ### 設定外觀、文字 Button的部分一樣可以直接套用先前的樣式 ```link-button```,再另外設定 ```about__link-button```。 ```css= ... .about__title { font-weight: bold; margin-top: 10px; } .about__skill-list { display: flex; flex-wrap: wrap; padding-left: 20px; margin: 5px 0; } .about__skill-item { margin: 2px 60px 2px 0; } .about__link-button { margin-top: 30px; } ``` ![](https://i.imgur.com/h7O1aCF.png) > About 區塊完成! ## Footer ![](https://i.imgur.com/qjOHbnZ.png) ### 建構內容 終於來到最後一個區塊,想必大家已經很熟悉步驟,這邊就不多說要用 ```footer``` 和 ```wrapper-content``` 了。 index.html ```html= ... <footer> <div class="footer-content wrapper-content"> <div>...(左欄內容)</div> <nav>...(右欄內容)</nav> </div> </footer> ``` ![](https://i.imgur.com/JS3smtO.png) ```html= ... <div> <div class="logo">PEI-YUN</div> <div class="footer__text">© 2021 PEIYUN,LEE</div> </div> ... ``` ![](https://i.imgur.com/b699kW3.png) ```html= ... <nav> <div class="footer-nav-list"> <div class="footer-nav-list__title">NAVIGATION</div> <a href="" class="footer-nav-list__text link-text">HOME</a> <a href="" class="footer-nav-list__text link-text">ABOUT</a> <a href="" class="footer-nav-list__text link-text">WORKS</a> </div> <div class="footer-nav-list"> <div class="footer-nav-list__title">SOCIAL</div> <a href="" class="footer-nav-list__text link-text">Github</a> <a href="" class="footer-nav-list__text link-text">Codepen</a> <a href="" class="footer-nav-list__text link-text">Medium</a> </div> <div class="footer-nav-list"> <div class="footer-nav-list__title">CONTACT</div> <a href="" class="footer-nav-list__text link-text">Facebook</a> <div class="footer-nav-list__text">may1092200258@gmail.com</div> </div> </nav> ... ``` ### 設定排版、寬高樣式 style.css ```css= ... footer { margin-top: 100px; } .footer-content { background-color: #fff5da; padding: 30px; display: flex; justify-content: space-between; } footer nav { width: 600px; display: flex; justify-content: space-between; } .footer-nav-list { color: #000; /*一併設定內元素的文字顏色*/ display: flex; flex-direction: column; } ``` ![](https://i.imgur.com/SggDplH.png) ### 設定外觀、文字 還記得在 Header 設定過的 ```link-text``` 嗎,我們設定了 ```letter-spacing``` 和 Hover 的樣式,所以這邊只要加上 ClassName 就能套用同樣的樣式囉。習慣這樣拆解你的 CSS,去提升重複使用性,就能有效增進開發的效率。 ```css= ... .footer__license { margin-top:10px } .footer-nav-list__title { font-weight: bold; margin-bottom: 15px; letter-spacing: 3px; } .footer-nav-list__text { margin-bottom: 15px; } ``` ![](https://i.imgur.com/icVTwbX.png) > 完成最後的 Footer 區塊! 辛苦了,我們完成所有區塊囉! ![](https://i.imgur.com/wq3j64K.gif) *** ## 小結 今天終於完成了完整的網頁內容,但目前都維持寬度是 1024px,還沒辦法去適應螢幕的寬度,所以你會看到有空白出現。所以在下一章的內容裡,就會開始進行 RWD 的部分,讓網頁可以在電腦、平板、手機上正常顯示喔。 如果文章中有錯誤的地方,要麻煩各位大大不吝賜教;喜歡的話,也要記得幫我按讚訂閱喔❤️

    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