How To Design a Web Page Using Simple HTML and CSS

Table of Contents

Often when making a website, it can be overwhelming. I’ll show you how to approach creating a website from scratch in this article…
Just a note
This article is more about guiding you through the though-process of creating a website, rather than the technical side of things. If you’re coming here because you want to learn how to code websites, check out How to learn web development, or my series on learning HTML.
we go through the tutorial.

1. Plan your layout

The first step of any website is always to know what you want on it and (vaguely) how you want it to look. So, the first step is to do a rough sketch – either on paper or on the computer, depending on which you find easier.
Remember, it doesn’t have to look good. Here’s mine:
As you can see, it’s very rough. The lines aren’t straight and nothing is even but I can still see how the site is going to look and what sections I need to have.
In this layout, I have a header (navigation bar), three sections and a footer.

2. Get the ‘boilerplate code’ set up

Now, it’s time to get the basic code that you have at the start of any website (this is commonly called the boilerplate).
Do this by:
  1. Creating a new folder on your computer for the website
  2. Create new empty index.html and style.css files inside
Finally, open up your index.html in a web browser to check everything’s working:
This article will be more about explaining the process of creating a website, so I won’t be explaining the actual code in detail – but you can still follow along if you want.
If so, follow the steps above to get started!

3. Create the elements in your layout

Now it’s time to create the layout/section elements that you planned in step 1!
The best way to do this is by using semantic elements: <header>,<main>,<section>, and <footer>.
Note that we are giving the <section>s ids, so we can refer to them later.
If you reload the page, you will see there is nothing there – this is because we are just creating the sections of the page, not the actual stuff in them.

4. Fill in the HTML content

Once you have the sections of the page, it’s time to fill them up! If you know what content you are going to be using, put that in. If not, put in some dummy text and replace it with the actual content later.

5. Add some basic layout CSS

Once we’re done with our HTML, it’s time to move on to CSS! The first and most important part to focus on first is to get it looking like our layout – then we can focus on the details.
This means that we need to focus on properties like width, height, margin, padding, position, and display. Also, we need to make sure the images are the right size so that they don’t obliterate the page.
Here, we are only adding styles to make our overall layout look similar – not the individual content. We make sure that the sections are set to 100% viewport height, make the header have a fixed position, position the items in the header, and more. We also use flexboxes to center the content in our sections.

6. Add more specific styles

Once the basic framework of the site is done, we can add more specific styles.
Now we can make our website look good!
As you can see, we’ve made the title bigger, rounded our image (using border-radius), and changed the font. We’ve also removed some default styling from the header links.

7. Add colors and backgrounds

Yay, we’re on the home stretch now! It’s time to add the finishing touches to our website – colors and backgrounds!
This is what will make our site look really awesome.
As you can see, we’ve added some general background styles to the section elements, as well as adding a background-image to each section individually.
The reason for the linear-gradient(rgba(255,255,255,0.75),rgba(255,255,255,0.75)), before the url('image.jpg') is because otherwise the text is hard to read – so we add a semi-transparent white overlay on top. I wrote a bit more about that in my article on how to create a full-page hero image

Conclusion

So, I hope you enjoyed this article and hopefully you learned something along the way!
I did something a little different from usual today, so tell me your thoughts. Remember, this article is less about me showing you the actual technical parts of creating a website, but more about guiding you through the thought-process of creating a website.
Command PATH Security in Go

Command PATH Security in Go

In the realm of software development, security is paramount. Whether you’re building a small utility or a large-scale application, ensuring that your code is robust

Read More »
Undefined vs Null in JavaScript

Undefined vs Null in JavaScript

JavaScript, as a dynamically-typed language, provides two distinct primitive values to represent the absence of a meaningful value: undefined and null. Although they might seem

Read More »