top of page

How to host static webpages using GitHub using free without using custom domain

Archisman Karmakar

Updated: Jan 16, 2022




Code for index.html:

<!DOCTYPE html>
<html lang="en">
<head>
     <meta charset="UTF-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Test Document</title>
     <link rel="stylesheet" href="style.css">
</head>
<script src="script.js"></script>
<body onload="load();">
     <div class="conainer" id="test">Hello world</div>

     <div class="container" id="id1">1</div>
     <div class="container" id="id2">2</div>
     <div class="container" id="id3">3</div>
     <div class="container" id="id4">4</div>
     <div class="container" id="id5">5</div>
</body>
</html>

Code for style.css:

html{
     margin: 0;
     border: 0;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     font-size: 1.5rem;
     height: 1.2vh;
}

Code for script.js:


function load() {
document.getElementById("test").innerHTML="This is test doc by AK";
}

Note:
You need to save the home page or the starting page as index.html for github to recognize.

GITHUB DOCUMENTATION:


Commentaires


©2022 by Archisman Karmakar. Created with MERN Stack except the blog functionality.

Made on Earth by a Human named Archisman Karmakar. Anyone not from Earth, finding this, please contact me.

  • Youtube
  • YouTube
bottom of page