Making a website with HTML and CSS step-by-step

Canan Korkut
3 min readSep 18, 2022

--

In this article, I will try to make a web site using HTML and CSS languages. Our website’s topic will be yoga. We will create a website for a yoga course. Our website’s end situation will be like below.

In the HTML part,

I’ve added a navbar to my site. I added the headers that will switch to the other sections and the logo.

I added the text inside the button and the text that will welcome you to the site.

I put all the content on the main page of my site into the hero class in the section tag.

I added the parts other than the navbar to the hero-area class in the div tag.

I took the button part of the hero-area class into the button class to edit it in CSS.

HTML document,

<!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>Yoga Website</title><link rel="stylesheet" href="style.css"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Edu+VIC+WA+NT+Beginner&family=Kaushan+Script&family=Montserrat:wght@300&family=Orbitron&family=PT+Serif:ital,wght@0,400;0,700;1,400&family=Poppins:wght@200;300;400;600&family=Quicksand:wght@300&display=swap" rel="stylesheet"></head><body><section class="hero"><nav><div class="logo"><img id="logo" src="image/logo.png" alt="logo"><h3>YOGA</h3></div><ul><li><a href="#home">Home</a></li><li><a href="#classes">Classes</a></li><li><a href="#schedule">Schedule</a></li><li><a href="#about">About</a></li><li><a href="#blog">Blog</a></li><li><a href="#contact">Contact</a></li></ul></nav><div class="hero-area"><h1>Welcome to Yoga</h1><div class="button"><a href="#about">For out more</a></div></div></section></body></html>

In the CSS part,

I added the font of my site to the body part. I used google fonts here. I added the margin and set the text color.

I want to put an image in the background on the home page of my site. I used pexels.com for this. I’ve centered the image so that it covers the entire home page. I don’t want to put the exact image here. That’s why I added linear-gradient.

I edited the logo and other titles using the flex feature in the navbar section.

In the navbar, I placed the logo on the left and the titles on the right that will switch to other sections.

I tried to set the headers in the ul section in a measured way. Here I made the text appear larger and changed color to show the difference when hovering over the lists.

I tried to set the hero-area part to be in the middle of the page. I set the properties of the header here. I changed the font properties.

I set the styles of the text inside the button. I set the changes that will occur when the button is hovered.

CSS document,

body {font-family: 'Montserrat', sans-serif;margin: 0;color: #080806ff;}.hero {background-image: linear-gradient(rgba(175, 174, 174, 0.75),rgba(175, 174, 174, 0.75)),url("image/pexels-yan-krukov-8436725.jpg");height: 100vh;background-position: center;background-repeat: no-repeat;background-size: cover;}nav {display: flex;justify-content: space-between;margin-right: 10px;margin-left: 10px;}#logo {padding: 8px;float: left;height: 50px;}.logo h3 {float: left;font-weight: lighter}ul {display: flex;justify-content: space-around;list-style-type: none;}li {float: right;}
li a {display: block;padding: 8px;text-decoration: none;color: inherit;text-align: center;margin-left: 10px;}li a:hover {font-size: larger;color: white;}.hero-area {margin-top: 150px;}.hero-area h1 {text-align: center;font-size: 90px;margin-bottom: 40px;font-weight: lighter;}.button {display: block;margin-left: auto;margin-right: auto;height: 40px;width: 180px;border-radius: 50px;border: 1px solid #080806ff;}.button a {text-decoration: none;color: inherit;font-size: 20px;display: flex;justify-content: center;text-align: center;margin-top: 6px;}.button:hover {color: white;background-color: #080806ff;font-size: large;}

That’s it for my article. I hope it was useful. Thanks for your time.

--

--