Starting from this lesson and for most of this module, we will be continuously building the static Homepage of our site.
Creating a static homepage is just like creating any other page.
So first, let’s create a page by going to “Pages” and then clicking “Add New”.
This will bring up the page editor screen.
Enter the title as “Home”.
Next, we need to start building the Homepage’s content using the Block Editor.
If you look at the design, the first piece of content on the Homepage is the hero section:
Before we start building it, I want you to take some time and analyze what blocks you could use for building the hero section.
…
…
Ey… No cheating!
…
…
Did you give it a thought?
Yes! There are five elements in the hero section and I think I know what blocks to use. Also, because the section has a background image, we should the “Cover” block as the parent block.
Great! Spot on!
I am proud of you π
We must understand what kind of blocks we can use because it speeds up the building process.
From the looks of it, let’s use the following blocks:
Also, if you notice, the hero section has the following background image spanning the entire section.
Woah! Woah! This looks complicated π
Haha, don’t worry!
It’s easier than you think.
Not just a hero section. Whenever we are building any section, it requires adding multiple blocks.
And we should use a parent block to hold those multiple blocks together.
We should use a parent block for three reasons:
And currently, there are only two types of parent blocks:
The “Group” block allows us to add a background color to the entire section. But it doesn’t let you:
On the other hand, The “Cover” Block allows us to add both a background image and a plain background color.
On top of that, it also lets us specify a fixed height for the section and allows you to align the content at the center.
Remember, the hero section we are trying to build has a background image.
So, we must use the “Cover” Block.
Come on, let’s start building the Hero section piece by piece.
This is your best chance to learn how to build high-quality landing pages using the block editor.
By the end of this module, you’ll be surprised how good the block editor is.
Anyway…
Type “/Cover” inside the block editor and click on the “Cover” block.
The “Cover” block immediately asks you to choose a background for the section.
We want a background image, right?
So, click on the “Upload” button and upload the following image:
And as soon as you upload a background image:
Please remember that the “Cover” block is a parent block. So, it can contain all other types of blocks inside it.
Anyway, before we build this section any further, we need to fix two things:
You already know how to remove a block, right?
This would result in:
If you notice, there is a “Plus” button inside the “Cover” block.
This means you can add any block inside the “Cover” block as a child block.
But before we add content to this cover block…
As you have already seen, by default, the “Cover” block adds a dark overlay on top of the uploaded image.
This is why the background image appears darker.
This dark overlay is helpful for sections with a certain design.
For example, for building the above hero section, I used the “Cover” block, which has three elements:
The key takeaway is that the dark overlay in the above design is necessary to make the text content readable.
Without it, the background image and the text content will overlap in a bad way, and the text becomes unreadable.
Did you see that?
Can you read the paragraph text? No, right?
So, the dark blue overlay is necessary for the above design.
But the overlay must be removed for the hero section we are building currently.
This is because the background image is not at all disturbing the readability of the text content above it:
It was an intentional design.
So, let’s remove the background overlay.
To achieve this, select the “Cover” block if it is not already selected.
This will bring up the “Cover” block-specific set
tings on the right sidebar.
Next, switch to the “Styles” tab inside the settings:
Finally, set the “Overlay Opacity” option to Zero.
This would result in:
Looking nice, isn’t it?
That’s all.
We can now add some child blocks inside the “Cover” block.
And we will do that in the next lesson.