GitHub Pages Tutorial HTML: Build Your First Website Step by Step

Logan Jul 13, 2026

Empower your online presence with a professional and static website using GitHub Pages and HTML. This tutorial will guide you through creating, configuring, and maintaining your own GitHub Pages site, making web development accessible and user-friendly, even for beginners. Let's get started!

Host Websites Free with GitHub Pages ๐Ÿš€๐Ÿ’ป
Host Websites Free with GitHub Pages ๐Ÿš€๐Ÿ’ป

Before we dive in, ensure you have the following prerequisites: a GitHub account, basic understanding of HTML, and access to a text editor or an Integrated Development Environment (IDE) like Visual Studio Code or Atom. By the end of this tutorial, you'll have a live, personalized website hosted on GitHub Pages.

How to display an HTML page on GitHub
How to display an HTML page on GitHub

Setting Up GitHub Pages

To begin, we'll set up GitHub Pages for your user profile or a specific repository. This will enable you to host your HTML website on GitHub's reliable and fast servers at no extra cost.

Top GitHub Open Source Projects for Web Development ๐ŸŒโœจ
Top GitHub Open Source Projects for Web Development ๐ŸŒโœจ

Follow these steps to create a GitHub Pages repository for your user profile:

  • Log in to your GitHub account.
  • Click on the '+' icon in the top-right corner and select 'New repository'.
  • Name your repository 'username.github.io' (replace 'username' with your GitHub username).
  • Click 'Create repository'.
Beginnerโ€™s Guide to Getting Started with GitHub in 2025 โ€“ Easy Step-by-Step Tutorial
Beginnerโ€™s Guide to Getting Started with GitHub in 2025 โ€“ Easy Step-by-Step Tutorial

Creating Your HTML Documents

Next, let's create your website's HTML files. For simplicity, we'll create an index.html and styles.css file.

Within your username.github.io repository, create a new file called 'index.html'. Add the following code to create a basic HTML5 document with a header, navigation, main content, and footer:

GitHub Basics Tutorial - How to Use GitHub
GitHub Basics Tutorial - How to Use GitHub

```html Your GitHub Pages Website

Welcome to My GitHub Pages Website!

Main Content Here

Engage with GitHub: Fueling Your Open Source Journey Forward ๐ŸŒŸ
Engage with GitHub: Fueling Your Open Source Journey Forward ๐ŸŒŸ

Add your content, images, and more using HTML and CSS.

```

Styling Your Website with CSS

HTML input types
HTML input types
โœจ Create an Animated HTML & CSS! ๐Ÿš€ #Coding #CSSAnimation #Shorts
โœจ Create an Animated HTML & CSS! ๐Ÿš€ #Coding #CSSAnimation #Shorts
the github chat sheet is displayed in this screenshote screen graber
the github chat sheet is displayed in this screenshote screen graber
Github Cheatsheet
Github Cheatsheet
an info sheet with different types of logos and symbols on it, including the words'python project ideas '
an info sheet with different types of logos and symbols on it, including the words'python project ideas '
Level Up Your Portfolio with These Beginner-Friendly GitHub Projects
Level Up Your Portfolio with These Beginner-Friendly GitHub Projects
HTML Cheat Sheet ๐Ÿ“„โœจ Quick Guide for Beginners
HTML Cheat Sheet ๐Ÿ“„โœจ Quick Guide for Beginners
Git & GitHub Roadmap for Beginners
Git & GitHub Roadmap for Beginners
Discover Tech Innovation: GitHub's Open Source Hub ๐Ÿ’ป
Discover Tech Innovation: GitHub's Open Source Hub ๐Ÿ’ป
Git & GitHub Explained for Beginners (2026)
Git & GitHub Explained for Beginners (2026)
Git & GitHub Cheat Sheet ๐Ÿ”ฅ | Commands, Workflow, Branching & Version Control (Beginner to Pro)
Git & GitHub Cheat Sheet ๐Ÿ”ฅ | Commands, Workflow, Branching & Version Control (Beginner to Pro)
An Apple-style layout focuses on clarity, spacing, and logical hierarchy, making your content
An Apple-style layout focuses on clarity, spacing, and logical hierarchy, making your content
login form html css
login form html css
GitHub Readme Idea - Minimalism Black & White
GitHub Readme Idea - Minimalism Black & White
an image of some type of webpage with dark colors and blue text on it
an image of some type of webpage with dark colors and blue text on it
Create a Delicious Cupcake Design Using HTML & CSS! ๐Ÿฐ
Create a Delicious Cupcake Design Using HTML & CSS! ๐Ÿฐ
How to have a Free Website on GitHub | ู…ูˆู‚ุน ุงู„ุฅู„ูƒุชุฑูˆู†ูŠ ู…ุฌุงู†ูŠ
How to have a Free Website on GitHub | ู…ูˆู‚ุน ุงู„ุฅู„ูƒุชุฑูˆู†ูŠ ู…ุฌุงู†ูŠ
Top 5 HTML CSS Projects for Beginners
Top 5 HTML CSS Projects for Beginners
Basics of HTML
Basics of HTML
GITHUB CHEATSHEET
GITHUB CHEATSHEET

To improve your website's appearance, create a new CSS file named 'styles.css' within your username.github.io repository.

Add the following CSS code to your styles.css file to make your website responsive and visually appealing:

```css /* Global */ * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; } .container { max-width: 960px; margin: auto; padding: 20px; } /* Header, Navigation, Main, and Footer */ header, nav, main, footer { padding: 20px; background-color: #f8f9fa; margin-bottom: 20px; } nav ul { list-style-type: none; } nav ul li { display: inline-block; margin-right: 10px; } /* Responsive design */ @media screen and (max-width: 768px) { .container { padding: 10px; } } ```

Configuring GitHub Pages for Your Repository

Now that your HTML and CSS files are ready, let's configure GitHub Pages to display your website.

1. In your username.github.io repository, click on 'Settings' at the top.

2. Scroll down to the 'Pages' section.

3. Ensure the 'Source' dropdown is set to 'main' branch.

4. Click 'Save'.

After a few moments, your GitHub Pages website will be live at 'https://username.github.io'.

Updating Your Website

To update your website, simply commit changes to your HTML and CSS files and push them to the 'main' branch.

Here's how to do it using Git and the command line:

  1. Initialize Git in your local username.github.io folder:

  • Add, commit, and push your changes:
  • Your updated website should appear live on GitHub Pages within a few moments.

    Congratulations! You've successfully created and deployed your personalized website using GitHub Pages and HTML. Explore and expand your website further with additional HTML tags, CSS styles, and JavaScript functionality. Happy coding!