by Jake Welch
index.html
. In HTML, the "index" file is always the home page. Now create
another file called style.css
. HTML files determine the structure and content of your
webpage, while CSS files control the layout and appearance. You should now have two files in your
folder
that look like this:
style.css
file to your
index.html
file by adding <link rel="stylesheet" href="style.css">
to the end of your <head>
section. By now, you should already notice some clues of how HTML
code
is written.
Content is divided up into tags. Headers use <h1>, <h2>, <h3>
, etc.
Paragraphs use
<p>
. Links use <a href="URL">Link Text</a>
.
Images
use <img src="image.jpg"
alt="description">
. All tags are closed with </>
(with a few expections,
like img tags). Explore some of the
resources
included at the beginning to learn
what
else you can do! style.css
file. CSS uses a different
format
than HTML. Let's start with the background color. To change the properties of our different HTML
tags,
we will call them out like this:
html { background-color: seagreen; }
. CSS is very flexible and allows you to type in a
color
name, use
hexcodes, and many other color formats. Do the same for the header text.
h1 { color: white; }
. Fonts are customizable with font-family
. VS Code
will
suggest some built-in web-friendly options as you type it out, or you can learn how to load your own
using @font-face
. It's important to note that CSS stands for Cascading Style
Sheets. This means that you should structure your CSS file in descending order from the most
general styles to the most specific. Explore the CSS resources above to learn all the different ways
to
style
your site! It can be as simple or as complex as you want, but I recommend starting off making
something
great with only a few customizations. Go have fun!
assets
. Inside the assets
folder,
create another folder called images
. These names
aren't too important, but it's important that you stay organized so your website can scale as you
continue
to
build it out. Inside of the images
folder, drag in whatever images you'd like to use on
your site. I'm going to use one of my favorite Van Gogh paintings, Undergrowth. In your
HTML,
use the <img>
tag. Unlike our other tags, you won't need to close it with a
separate tag. It will look
like this:
<img src="assets/images/undergrowth.jpg" alt="Van Gogh's Undergrowth">
. The
src
attribute
tells the browser where to find the image in your directory, and the alt
attribute
provides
a description of
the image for accessibility purposes. Now, if you go back to your browser, you should see the image
displayed on your site!
www.domain-name.com
) and click "Save". This will connect your
domain name to your GitHub Pages site.
jake-welch-design.github.io
). This process varies depending on your registrar, so refer to
their documentation for specific instructions. This is what mine looks like on GoDaddy:
Thank you for following along with this tutorial, I hope you feel excited and empowered to make a cool
website. Please reach out
to me if you have any feedback or questions, I'm always happy to help!
Back to tutorials.jakewel.ch