Building A Responsive Coming Soon Page In Less Than 10 Minutesš±š
Building a coming soon page is one of the simplest projects you can do in other to test your html and CSS skills.
For beginners, it might be a little bit complicated but by the time weāre back from this journey Iāll be taking us through, you should have been able to create your first responsive coming soon page with just HTML and CSS. Interesting right? So pick up your materials and letās ride together.š“š
First things first:
So to create any website what do we needš¤?
We need 3 things:
ā¢ Logo
ā¢ Content
ā¢ Colors
In most cases the colors can always be gotten from the logo and the content are provided by the site owners.
STEP 1:
CREATING THE FOLDER
So to get started I will just create a folder on my desktop. Iāll name mine: Coming soon page.
You can give yours any name of your choice.
So next weāll open our text editor.
There are a lot of text editors you can use;
ā¢ Sublime text
ā¢ Visual studio code
ā¢ Atom and many more..
Iām currently using Visual studio code because its makes works faster for me. You can decide to use any text editor of your choice.
Next youāll need to ask yourself;
What resources or assests will I be using for this website?š¤.
If your answer was
ā¢ logo
ā¢ Background Image and
ā¢ Icon
then you are rightš¾!.
We also have to note that all these assets will be in the coming soon page folder.
So you can decide to create a different folder inside the coming soon page folder where you can put these assets.
But I wonāt be doing that, so Iāll just add my logo, icon and background image to my Coming soon page folder.
Letās move onš.
For the logo you should have gotten your companyās logo already.
To get a background image you can visit pexels, unsplash or pixabay. These websites provide you with free images without copyrights. You are free to download and use.
Next thing Iāll need is Font Awesome (Icons).
"Font Awesome is designed to be used with inline elements. The <i> and <span> elements are widely used for icons."
To start using font awesome icons youāll have to visit Font Awesome and download the latest versions.
'It comes in form of a folder so youāll have to register with your email to get your link and then download the font awesome folder." I donāt want to go much into talking about it so letās move on..š¤ø.
After downloading the font awesome you should then copy it into your folder where you have your background image and logo.
So if you followed the steps above you should have something like this in your text editor.šš»
STEP 2:
Create Your HTML and CSS Extensions
Next Iāll have to Create aĀ .html extension. Iāll name it Index.html.
āindex is used as the first file because when we host our website to a host server, the server searches for our homepage first which is a file named index. If your browser canāt find the index the next action is to list our files on that server so that the user can choose or it throws a 404 error".
Okay, so since itās a single page weāre creating you can decide to use an internal CSS instead but Iāll just do otherwise.
Iāll create my CSS folder in my coming soon page folder and Iāll name it style.css.
STEP 3:
Start Writing Your Codesš
Now itās time to start writing your codes:
In your html, weāll create the html structures.
Here is how it is..
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FemCode Africa</title>
</head>
<body>
Donāt forget to add your meta tagš:
"<meta name="viewport" content="width=device-width, initial-scale=1.0">"
"A <meta> viewport element gives the browser instructions on how to control the pageās dimensions and scaling.The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).
The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser."
So basically, what the tag does is that it helps us detect when we are on a small screen or on a desktop screen.
So next iāll link my font awesome
So the font awesome is an external CSS file. I donāt really need to link all. i just need the all.css file.
so to link we use our link tag as usual:
" <link rel="stylesheet" href="assets/css/fontawesome/css/all.css">"
So its an external css that will be linked right.
The link just means attaching a file to become the content of another file.
So we are bringing in the content of the css file to our html file, it can be any name. We can use any name we want as long as we link it properlyš.
So i will just use style.css as my css file. I need to link it using the link tagĀ .
You can place the link anywhere in the html page, but I prefer to place it in the head section so that it loads faster before the other page contents. but basically you can even put it in the body It still works.
Here is my code so farš
STEP 4:
CREATE PAGE STRUCTURE
Next thing i want to do in my html is create the structure of the page.
I will add a section to hold the contents, I will give it an id called landing. you can use any name its just an id.
So this section will hold all my contents.
Then, Iāll add myĀ LOGO, after the logo comes the COMING SOON text, after that, A Brief Description about the company.
Finally, a call to action button. So;
ā¢ LOGOā©
ā¢ COMING SOONā©
ā¢ ABOUTā©
ā¢ BUTTONā¹ļø
Lets get startedš¤ø
First, Letās add a div inside the landing section and give it a class of landing-content.
Next iāll create a div to hold my logo. Iāll call that logo-div and its inside the landing div.
Next i add my png logo
The logo is an image so just call it up remember to use the name of your own image.
Just make sure you add the logo correctly.
So next i want to add my coming soon text;
I will just use a h1 tag and it will be directly inside the landing-content
Next is the description:
" In the fight to bridge the gap on gender inequality in the tech Eco system, FemCode Africa is here to equip ladies with on demand digital/tech skills".
I will just add that description and place it in a paragraph under the coming soon h1.
Next, iāll create a div to place my button and Iāll give it a class of button-div.
Iām gonna be using an anchor link for our button and Iāll give it a class of btn.
Next, iāll create a div to place our social icons.
Remember they are just font awesome icons.
Iāll be adding Facebook, twitter and Instagram. Since itās a static web-page Iāll set my href to #.
If done properly this is what you should see in your text editor š
STEP 5:
STYLING WITH CSSā¤ļø
So html is done successfully, CSS is next.
First, Iāll use a universal selector (*) and set the box sizing property to border box.
*{
box-sizing: border-box
}
Then Iāll set my body margin and padding to 0px each.
Then Iāll style my section:
" section#landing{
}"
So this šreferences my landing section.
I will then add a background image. But i also need to be able to control the opacity, so i will just use a linear gradient.
Section#landingĀ {
background: linear-gradient(rgba(0,0,0,0.5), rgba(0, 0, 0,0.5)),url("../images/bg.jpg");"
}
Still on the section#landing, Iāll set the background repeat property to no-repeat, the background size to cover, color to #fff(white), min-height to 100vh and the padding to 100px.
If done properly this is what you should see in your text editorš.
Moving Forwardš, iāll then style theĀ div landing content.
"section#landing > div.landing-content{
}"
this šshould reference the div.
Next, iāll just add some box shadow to that landing-content div. Iāll also add a transparent bg also, some padding and align the text to center.
If done properly this is what youāll see.šš».
Next Iāll reduce the image size.
section#landing > div.landing-content>div.logo-div{
}
This makes a reference to the logo div
section#landing > div.landing-content>div.logo-div img{
}
This references the image itself. so I will use just width
You need to be careful not to shrink the image.
For the h1 I will just increase the font.
.landing-content h1{
font-size: 50px;
}
So next, iāll style the button and the icons.
you can decide to style your buttons anyhow its suits you.š.
Here is what I did:
So next, Iāll create a hover for our buttons. So once we hover on it, it can change color.
Iāll also add a transition so that the effect will be seen properly.
Then Iāll style the icon by increasing the size. Iāll use the margin property for that.
Here is what I did š
So we are done for desktop view!š¤š
Quite simple right!š¤ø. But not too fastš.
Weāll have to make sure that the page is responsive. In other to do that, weāll have to add media queries to the page to make it responsive for mobile devices of different sizes .
Here are some media query break points we can use:
"/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {...}/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {...}/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {...}/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}
"
@media only screen and (max-width: 768px) {
}
but i prefer this šbecause it handles more screens better for me.
So adding my media query, Iāll change the logoās width, the font size of h1 the font size of .landing-content, the padding of the section#landing and the font size and line height of my button.
Here it is....
So Iāll test for mobile view to make sure itās actually responsive..
Hooray!!!! it is Responsivešš.
If you followed all the steps properly, you should have a coming soon page as beautiful as thisšš
Finally, we have come to the end of this wonderful journey ššš. Hope you enjoyed it, cause I didšÆš¤.
And I guess by now you should have been able to create your first Responsive Coming Soon Pageš.
Feel free to share yours with me, ilāld really love to see themšÆš.
Remember: Failure is not a defeat but a part way to success. Donāt Give Up!!šš
Happy coding!!šš