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!

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.

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.

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'.

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:

```html
Welcome to My GitHub Pages Website!
Main Content Here

Add your content, images, and more using HTML and CSS.
```
Styling Your Website with CSS




















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:
- Initialize Git in your local username.github.io folder:
- Open your terminal/command prompt.
- Navigate to your local username.github.io folder.
- Run the command: `git init`
- Run the command: `git add .`
- Enter a commit message when prompted: `git commit -m "Update my GitHub Pages website."`
- Run the command: `git remote add origin https://github.com/username/username.github.io.git`
- Run the command: `git push -u origin main`
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!