pantong simon
    • 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
    BUILDING YOUR FIRST WEB PAGE WITH HTML AND GIT. This article guides you through creating your first web page using HTML and introduces you to the basics of Git for version control. Even if you're a complete beginner, you'll be able to follow along and create a simple webpage by the end of this tutorial. Introduction Let's start by understanding what HTML and Git are. HTML (HyperText Markup Language) is the standard markup language for creating web pages. Think of it as the skeleton and building blocks of a website. It uses tags to define different elements like headings, paragraphs, images, and links. Browsers interpret these tags to display the content on the screen. Git is a distributed version control system that tracks changes to your files. It's like having a history log of every modification you make to your project. This is incredibly useful because it allows you to revert to previous versions, collaborate with others on projects, and easily manage changes. Why is Version Control (Git) Important? Imagine working on a project and accidentally deleting a crucial file. Without version control, recovering that file could be a nightmare. Git solves this problem. It keeps track of every change, allowing you to easily revert to previous versions. It's also essential for teamwork, as it helps manage contributions from multiple developers. Setting Up the Project Let's get started by setting up our project: * Create a Project Folder: Choose a location on your computer and create a new folder for your project. Let's call it "my-first-webpage". * Initialize a Git Repository: Open your terminal or command prompt and navigate to your project folder using the cd command (e.g., cd my-first-webpage). Once inside the folder, initialize a Git repository by running the following command: git init This command creates a hidden .git folder in your project, which is where Git stores all the version control information. * Create the first index.html file: Create a new file named index.html inside your project folder. This will be the main file for your web page. You can create this file using a text editor like VS Code, Sublime Text, or even Notepad. Writing the HTML Code Now, let's write the HTML code for our web page. Open the index.html file in your text editor and add the following code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My First Web Page</title> </head> <body> <h1>Welcome to My Website!</h1> <p>This is my first web page. I'm learning HTML and Git!</p> <a href="https://www.example.com">Click here to visit an example website</a> </body> </html> Let's break down this code: * <!DOCTYPE html>: This declaration tells the browser that this is an HTML5 document. * <html lang="en">: This is the root element of the HTML document. The lang attribute specifies the language of the content (English in this case). * <head>: This section contains meta-information about the HTML document, such as character set, viewport settings, and the title of the page. * <title>My First Web Page</title>: This sets the title that appears in the browser tab. * <body>: This section contains the visible content of the web page. * <h1>Welcome to My Website!</h1>: This creates a level 1 heading. * <p>This is my first web page. I'm learning HTML and Git!</p>: This creates a paragraph of text. * <a href="https://www.example.com">Click here to visit an example website</a>: This creates a link to an external website. Save the index.html file. You can now open this file in your web browser to see your first web page! Using Git for Version Control Now, let's use Git to track our changes. * Staging Changes: In your terminal, navigate to your project folder and run the following command to stage the changes you've made to the index.html file: git add index.html This command tells Git that you want to include this file in the next commit. * Committing Changes: Now, commit the staged changes with a descriptive message: git commit -m "Initial commit: Created index.html with basic content" The -m flag allows you to add a commit message directly in the command. Meaningful commit messages are crucial for understanding the history of your project. Pushing Code to GitHub (Optional for Advanced Students) If you want to share your code online and collaborate with others, you can push your local Git repository to a remote repository on GitHub. * Create a GitHub Repository: Go to GitHub.com and create a new repository. Give it a name (e.g., "my-first-webpage"). * Connect the Local Repository to GitHub: In your terminal, add the remote repository URL to your local Git repository: git remote add origin <your_github_repository_url> Replace <your_github_repository_url> with the URL of the repository you created on GitHub. * Push Changes to GitHub: Push your local commits to the remote repository: git push -u origin main This will upload your code to GitHub. Conclusion Congratulations! You've successfully created your first web page using HTML and learned the basics of Git for version control. You've learned how to create a project folder, initialize a Git repository, write HTML code, stage and commit changes, and optionally push your code to GitHub. This is just the beginning of your web development journey. There's a lot more to learn about HTML, CSS (for styling), and JavaScript (for interactivity). Keep practicing and exploring, and you'll be building amazing web pages in no time! Don't be afraid to experiment and look up resources online. The web development community is vast and supportive, and there are countless tutorials and documentation available to help you along the way.

    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