Wednesday, June 24, 2026

step-by-step guide to creating and hosting HTML, CSS, and JavaScript pages on GitHub.

 Here is a practical step-by-step guide to creating and hosting HTML, CSS, and JavaScript pages on GitHub.

Step 1: Create a GitHub Account

  1. Visit GitHub Sign Up

  2. Create an account.

  3. Verify your email address.

Step 2: Create a New Repository

  1. Log in to GitHub.

  2. Click the + icon at the top-right.

  3. Select New Repository.

  4. Enter a repository name (e.g., my-website).

  5. Choose Public.

  6. Check Add a README file.

  7. Click Create Repository.

Step 3: Create Your HTML Page

  1. Open your repository.

  2. Click Add FileCreate New File.

  3. Name the file:

index.html
  1. Add the following code:

<!DOCTYPE html>
<html>
<head>
    <title>My First GitHub Website</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>

    <h1>Welcome to My Website</h1>
    <p>This website is hosted on GitHub.</p>

    <button onclick="showMessage()">Click Me</button>

    <script src="script.js"></script>

</body>
</html>
  1. Click Commit Changes.


Step 4: Create Your CSS File

  1. Click Add FileCreate New File.

  2. Name it:

style.css
  1. Add:

body{
    font-family: Arial, sans-serif;
    text-align:center;
    background:#f4f4f4;
    padding:50px;
}

h1{
    color:#0077cc;
}

button{
    background:#0077cc;
    color:white;
    border:none;
    padding:10px 20px;
    cursor:pointer;
}
  1. Commit the file.


Step 5: Create Your JavaScript File

  1. Click Add FileCreate New File.

  2. Name it:

script.js
  1. Add:

function showMessage(){
    alert("Welcome to JavaScript on GitHub!");
}
  1. Commit the file.


Step 6: Enable GitHub Pages

  1. Open your repository.

  2. Click Settings.

  3. Select Pages from the left menu.

  4. Under Build and Deployment:

    • Source = Deploy from Branch

    • Branch = Main

    • Folder = /root

  5. Click Save.

GitHub will generate a URL like:

https://yourusername.github.io/my-website/

After a few minutes, your website will be live.


Step 7: Update Your Website

Whenever you want to change your website:

  1. Open the file.

  2. Click the pencil icon.

  3. Make your changes.

  4. Commit Changes.

GitHub Pages automatically republishes your site.


Step 8: Recommended Folder Structure

For larger projects:

my-website/
│
├── index.html
├── about.html
├── contact.html
│
├── css/
│   └── style.css
│
├── js/
│   └── script.js
│
└── images/
    └── logo.png

Update your links:

<link rel="stylesheet" href="css/style.css">
<script src="js/script.js"></script>

Step 9: Using Visual Studio Code (Recommended)

Install:

Clone your repository:

git clone https://github.com/yourusername/my-website.git

Open the project in VS Code, edit files, then push changes:

git add .
git commit -m "Updated website"
git push origin main

Step 10: Create a Professional Portfolio Site

For your work with CCYI Global Enterprise, you can create:

Home
About Us
Services
Portfolio
Training Academy
Blog
Contact
Payment Page
Student Portal

and host it free on GitHub Pages before later connecting a custom domain such as:

www.ccyiglobalenterprise.com.ng

This is an excellent way to showcase your website design, LMS development, digital training, and consulting services to potential clients.

No comments:

Post a Comment

step-by-step guide to creating and hosting HTML, CSS, and JavaScript pages on GitHub.

 Here is a practical step-by-step guide to creating and hosting HTML, CSS, and JavaScript pages on GitHub . Step 1: Create a GitHub Account ...