Build a Landing Page

In this tutorial, you will build a simple landing page that introduces a product or service.

You will start with a small amount of HTML, add a design with CSS, create a Features section, and make the page work well on mobile screens.

The page you build will include:

  • A hero section that introduces a product or service
  • A button that encourages visitors to take action
  • A section that highlights key features
  • A mobile-friendly responsive design
  • A published page available on the internet

Full Code

When you finish this tutorial, you will have a page like the one below.

Before you begin, take a quick look at the completed page and the full source code. You do not need to understand all of the code yet. As you write and modify the code step by step, you will learn what each part does.

Before You Start

Log in to Essepage and create a new project using the Blank template.

The project will contain the following homepage file:

/public
└── +page.essepage

The +page.essepage file inside /public is the default homepage of your website.

On the project dashboard, select Code Editor and open /public/+page.essepage.

1. Create the Hero Section

Delete the existing code and paste the following code:

<div id="_main">
    <h1>Turn Your Ideas Into Reality</h1>

    <p>
        We provide simple and efficient solutions
        to help you build better services.
    </p>

    <a href="#">Learn More</a>
</div>

Save the file.

  • Windows or Linux: Ctrl + S
  • macOS: Cmd + S

The heading, description, and link will appear in the Preview panel on the right.

Use Live Preview

The first line uses an id that begins with an underscore (_).

<div id="_main">

In Essepage, an element whose id begins with an underscore (_) is connected to Live Preview.

From now on, the Preview panel updates immediately as you type, without requiring you to save the file each time.

Try changing the text inside h1 and watch the result update in Preview.

2. Add a Design with CSS

The page currently contains only the content and has no styling.

Add the following code below the HTML you just wrote:

<style id="_css">
    body {
        font-family: system-ui;
        padding: 20px;
    }

    h1 {
        font-size: 64px;
        margin-bottom: 20px;
    }

    p {
        line-height: 1.7;
    }

    a {
        display: inline-block;
        margin-top: 32px;
        padding: 14px 28px;
        color: white;
        background: #111;
        border-radius: 999px;
        text-decoration: none;
    }
</style>

The heading becomes larger, and the Learn More link changes into a rounded black button.

The <style> element also has an id that begins with an underscore.

<style id="_css">

This means changes to CSS properties such as colors and sizes also appear immediately in Live Preview.

For example, try changing the button’s background color:

background: royalblue;

In Essepage, you can write <style> inside a page file. When the page is assembled, the style code is automatically placed in the <head> section.

3. Center the Content

The content currently appears in the upper-left corner of the screen.

Find the existing body rule in the CSS and replace it with the following code:

body {
    box-sizing: border-box;
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    align-items: center;
    justify-content: center;
    font-family: system-ui;
    text-align: center;
}

The content is now centered horizontally and vertically on the screen.

4. Add a Features Section

Most landing pages include a section that explains the benefits of the product or service.

Add the following code below the Learn More button:

<section>
    <h2>Our Strengths</h2>

    <ul>
        <li>Fast and intuitive experience</li>
        <li>Fully responsive on all devices</li>
        <li>Reliable customer support</li>
    </ul>
</section>

The complete HTML structure should now look like this:

<div id="_main">
    <h1>Turn Your Ideas Into Reality</h1>

    <p>
        We provide simple and efficient solutions
        to help you build better services.
    </p>

    <a href="#">Learn More</a>

    <section>
        <h2>Our Strengths</h2>

        <ul>
            <li>Fast and intuitive experience</li>
            <li>Fully responsive on all devices</li>
            <li>Reliable customer support</li>
        </ul>
    </section>
</div>

A new section highlighting three benefits will appear in Preview.

5. Adjust the Spacing

The feature list is currently a little cramped, so add some spacing with CSS.

Add the following code below the existing rules inside <style id="_css">:

section {
    margin-top: 80px;
}

ul {
    padding: 0;
    list-style: none;
}

li {
    margin: 16px 0;
}

6. Support Mobile Screens

The large heading works well on a desktop screen, but it may look too large on a mobile device.

Add the following code at the bottom of <style id="_css">:

@media (max-width: 640px) {
    h1 {
        font-size: 42px;
    }
}

Reduce the width of the Preview panel and check whether the heading becomes smaller.

A design that changes according to the screen size is called Responsive Design.

7. Apply the Changes to the Live Site

When the page is complete, save the file.

  • Windows or Linux: Ctrl + S
  • macOS: Cmd + S

Check the final result in Preview, and then apply the changes to the live site.

The homepage is already published, so use Apply Changes.

  1. In the File Explorer, right-click /public/+page.essepage.
  2. Select Apply Changes.
  3. After the changes have been applied, right-click the file again.
  4. Select Open Page.

The completed landing page will open in a new browser tab.

After applying the changes, it may take up to one minute for the cache to update. If the published page still shows the previous content, wait a moment and then refresh it.

Your Website Is Ready

You have now:

  • Created a heading, description, and button with HTML
  • Designed the text and button with CSS
  • Centered the content on the screen
  • Added a section introducing the product or service
  • Adjusted the spacing between elements
  • Changed the heading size for mobile screens
  • Applied the changes to the live site

Starting with a small amount of code, you added content step by step and completed a responsive landing page.

Now change the heading, description, button color, and feature list to match the product or service you want to introduce.

Next Steps

After completing the landing page, continue with one of the following guides:

  • To build a website with multiple pages: Build a Personal Website
  • To learn more about HTML elements and page structure: Page Structure
  • To understand how files determine URLs: Pages and URLs
  • To reuse navigation and footers across multiple pages: Layouts and Components
Last updated: