Learn how to create a separate CSS file and link it to your HTML to style your GitHub Pages website.
You should have a working HTML file such as index.html
published on GitHub Pages.
Create a CSS File
style.css
.body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}
h1 {
color: darkblue;
text-align: center;
}
Link the CSS File to Your HTML
index.html
file and click the pencil icon to edit.<head>
section, add this line:<link rel="stylesheet" href="style.css">
style.css
file.Commit Your Changes
Test Your Page
style.css
file and apply custom background colors, fonts, or text alignment.