探花精选

The 探花精选 Website Blog

How to Create a Landing Page in HTML & CSS [+ 15 Templates]

Written by Allie Decker | Apr 16, 2024 5:44:00 PM

Your landing page matters. Get it right, and you can capture visitor information, deliver great content, and get them on the path to conversion. Get it wrong, and your site may still get seen 鈥 but it won鈥檛 drive sales.

As a result, it鈥檚 worth knowing what makes a great landing page, what you should avoid as you develop your website, and what options are available if you take on this task yourself.

I鈥檝e got you covered. Here鈥檚 a quick look at how to create a landing page in HTML and CSS that visitors actually want to land on.

Why Build an HTML Landing Page?

The goal of any landing page is to drive visitor action. Visitors enter your website and see this page first to get more information about the product or service you鈥檙e offering. Your landing page then asks visitors to provide details, including their name, email address, or phone number, in exchange for some type of offer.

What you offer is up to you 鈥 whitepapers, ebooks, and newsletters are common. But, whatever it is, you need to make it valuable enough that visitors are willing to share their contact information for it and move to the next phase of your sales process.

The offer itself is the most important aspect of your landing page, but it鈥檚 not the only important part: The design of your landing page should be based on driving conversions, too. To achieve a landing page that looks exactly how you want, it may be worth learning a bit of code.

If you鈥檙e a tech-savvy marketer, you鈥檝e heard of HTML, short for Hypertext Markup Language. It鈥檚 the coding language that makes up web pages. With HTML and its sibling style language, CSS, you can build a landing page completely from scratch. Or, if using a website builder or CMS, you can extend your designs beyond what鈥檚 possible with drag-and-drop editing.

The idea of learning to code in order to build a simple landing page may seem intimidating but don鈥檛 be discouraged. HTML is relatively simple to learn, and with some practice, you鈥檒l be able to craft an effective landing page yourself.

HTML Landing Page Best Practices

Landing pages are designed to capture specific streams of traffic 鈥 a subset of your website visitors targeted by your marketing campaign. For example, if I鈥檝e created a full-featured mobile fitness application that includes a monthly fee, my landing page might offer a free trial period for interested users.

With the right search engine optimization (SEO), my website can bring in fitness-focused visitors. Then, my landing page captures potential customers by offering a free trial code when they share their contact information.

While your specific landing page layout will vary, here are a few high-level recommendations to improve your impact:

  • Make it clear, not complicated. Your unique selling position (USP) and call-to-action (CTA) should be front and center. Don鈥檛 go into depth or detail. Make it clear what you鈥檙e offering and what visitors need to provide in return.
  • Make it clean, not cluttered. White space is your friend. Keep your landing page simple and clean with limited text and curated images for maximum impact.
  • Test, don鈥檛 guess. As noted by , testing is critical to ensure your landing page captures leads. Design it, make it live, and then record the results. If it鈥檚 not working, make changes.

HTML Basics

You鈥檝e got a solid USP, a design vision, and a great CTA. Now, it鈥檚 time to build your landing page. Below, I鈥檒l leverage HTML to make the page display the exact text, images, and links I want, how I want them.

First, it鈥檚 important to note that HTML isn鈥檛 technically a programming language. It鈥檚 really a markup language that gives you control over the text, images, and links that appear on your webpage.

Every HTML element is represented by tags, which are identified by angle brackets (<>). Some elements only need one tag, while others consist of two tags, an opening and a closing tag. The closing tag contains a forward slash (/).

Let鈥檚 see an example. Say I want to create a line of text that stands by itself as a paragraph on my landing page. Here鈥檚 the line:

鈥淭his is my landing page鈥

Here鈥檚 what it looks like in HTML:

<p>This is my landing page</p>

I鈥檝e used the 鈥<p>鈥 (paragraph) tag to create a paragraph element 鈥 the text between the opening and closing tags is paragraph text.

Other popular HTML tags include:

  • <h1> 鈥 Makes the text a heading element. Sizes range from h1 to h6.
  • <a> 鈥 Creates a new link within your text.
  • <strong> 鈥 Makes text bold.
  • <em> 鈥 Applies italics to text.
  • <ul> 鈥 Creates an unordered (i.e., bulleted) list.
  • <ol> 鈥 Creates an ordered (i.e., numbered) list.
  • <br /> 鈥 Inserts a line break, one of the few tags that don鈥檛 need both an opening and a closing tag.

HTML works in conjunction with CSS (Cascading Style Sheets) to change the style of the elements on your landing page. With CSS, you can change specific things like background color, text color, and font type. These changes then 鈥渃ascade鈥 across all elements, allowing you to make changes that apply to your entire landing page at once.

The first thing you need to create a landing page in HTML is a text editor, as both HTML and CSS are written in plain text. If you don鈥檛 have one yet, check out our HTML and CSS editor recommendations before moving on.

If you鈥檙e using WordPress, you can also click on a specific block in the editor and click on the three dots. Then, select Edit as HTML. If you want complete control over your HTML elements, start by editing a page or post, then click on the three dots in the top-right corner of the editor and select Code Editor.

Below, I鈥檒l go through the process of creating a landing page in HTML.

1. Create the basic structure.

To build an HTML landing page from the ground up, your best bet is to use a simple HTML framework like (MDB), available in both free and professional versions.

A framework is essentially a collection of pre-written code that makes it easier to create in HTML. Rather than creating all elements from scratch, I can leverage a framework鈥檚 built-in elements to whip up landing pages more quickly.

Once I鈥檝e downloaded and unzipped the MBD package, I鈥檓 ready to get started on my first landing page. Here, I need five key things: A basic structure, a navigation bar, a navbar class, a full-page background, and CSS styling. Additionally, I need to include some basic page elements:

  • A heading using the <h1> tag at the top of my page.
  • Some text using the <p> to define paragraphs and CSS styles for color and font.
  • The <input> tag to create form fields where visitors can enter their name and contact information.
  • Links using the <a> tag that lets visitors download or access content once they鈥檝e provided their contact details.

I start by opening the index.html file (the HTML file for my homepage) in my project folder. This is typically where I鈥檝e unzipped the MDB or other HTML editor package. I can then paste this code underneath the opening <body> and closing </body> tags:

<header> </header> <main> </main> <footer> </footer>

This HTML provides the structure for your landing page. In it, I have:

  • A <header> element for my page header and primary navigation.
  • A <main> element to indicate the most important part of the page that contains its unique content (i.e., things that aren鈥檛 repeated across pages, like the header and footer).
  • A <footer> element for my page footer.

These are all placed inside the <body> tags. <body> contains all things on my page that are directly visible to visitors.

2. Create a navigation bar.

Next, I paste the following code between the opening <header> tags:

<nav class="navbar navbar-expand-lg navbar-dark primary-color"> <div class="container"> <a class="navbar-brand" rel="noopener" target="_blank" href="#">Navbar</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#basicExampleNav" aria-controls="basicExampleNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="basicExampleNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link" rel="noopener" target="_blank" href="#">Home <span class="sr-only">(current)</span> </a> </li> <li class="nav-item"> <a class="nav-link" rel="noopener" target="_blank" href="#">Features</a> </li> <li class="nav-item"> <a class="nav-link" rel="noopener" target="_blank" href="#">Pricing</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown/ <a> <div class="dropdown-menu dropdown-primary" aria-labelledby="navbarDropdownMenuLink"> <a class="dropdown-item" rel="noopener" target="_blank" href="#">Action</a> <a class="dropdown-item" rel="noopener" target="_blank" href="#">Another action</a> <a class="dropdown-item" rel="noopener" target="_blank" href="#">Something else here</a> </div> </li> </ul> <form class="form-inline"> <div class="md-form my-0"> <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search"> </div> </form> </div> </div> </nav>

There鈥檚 a lot more code here, so let鈥檚 break down what this all means. Everything is contained by the <nav> (navigation) element, indicating that the contents inside these tags serve to guide the user through the website.

First, in the navbar, I have a place for the brand text, followed by a button to collapse the navbar from view. Inside this collapsible section of the navbar, I have a list of navigation links to Home, Features, and Pricing pages, then a template for a dropdown menu.

Lastly, this code places a search bar in my navigation, allowing users to enter queries and quickly find their desired page.

3. Stick the navbar to the top of the screen.

A sticky navbar stays visible to the user even when they scroll down the page. To make my navbar sticky, I replace the first <nav> tag (directly under 鈥<!--Navbar-->鈥) with the following code:

<nav class="navbar navbar-expand-lg navbar-dark primary-color fixed-top">

4. Create a great background.

After my content is set, a great background will help my landing page stand out. I put this code underneath the navbar, just before the closing </header> tag:

<div id="intro" class="view"> <div class="mask"> </div> </div>

This code adds a mask over my background, which partially obscures the background image so content in the forefront is more visible.

5. Add some style.

Finally, it鈥檚 time to spruce up your page with styling. To do that, I鈥檒l make use of the language CSS. Like HTML, CSS isn鈥檛 a programming language, and it鈥檚 also not too difficult to wrap your head around.

How exactly you style your landing pages is, of course, up to you. In the next section, we鈥檒l provide some basic CSS code to get you started.

CSS Landing Page

CSS can either be written in the HTML file it applies to or in a separate file called an external stylesheet. For this tutorial, I鈥檒l use the latter method. Create an empty text file called 鈥渟tyle.css鈥 in the same folder as index.html, and then paste the following HTML code in between the <head> tags inside index.html:

<link rel="stylesheet" rel="noopener" target="_blank" href="style.css">

This HTML instructs the document to reference your style.css file for styling instructions.

Next, I open style.css, paste in this CSS code, and save the file:

html, body, header, #intro { height: 100%; } #intro { background: url("https://mdbootstrap.com/img/Photos/Horizontal/Nature/full%20page/img%20%283%29.jpg")no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }

This will provide a placeholder background image for my landing page. Setting the height at 100% ensures that background elements cover the entire screen.

Even after this CSS, my landing page will still look pretty generic. At this point, it鈥檚 up to me to decide how to populate the page with my content and style it to match my business鈥 branding.

Then, I can leverage CSS to change the look of your page. Here are the key styles I focus on when adding CSS:

  • Colors. With CSS, I can change the colors of my text, as well as the background colors of block elements and my entire page. See our guide to CSS colors to learn how it works.
  • Fonts. Fonts are another crucial detail of a landing page. A font can make my text both professional-looking and more readable. I can choose a font family according to my branding guidelines and adjust the font size to establish hierarchy.
  • Margins and padding. CSS provides ways to space out my elements with margins and padding. As mentioned, white space is my friend 鈥 it makes my pages appear clean and digestible, both essential when optimizing any landing page.

You might be surprised at how far you can get with just these alone. But, if you need some help with your design vision, we have some landing page examples you can use for inspiration.

New to this process? To get started with CSS, check out our Ultimate CSS Tutorial for Beginners.

CSS & HTML Landing Page Templates

Coding from scratch offers you the most flexibility when building a landing page. However, starting completely from square one can be time-intensive. These landing page templates have code you can customize, all while saving the time it takes to build a page.

1.

|

At a Glance

  • Free options are available
  • Prices go up to $49
  • Uses the latest version of Bootstrap
  • SEO optimized

The OnePage landing page template is perfect for businesses of any kind, featuring a versatile design with a neutral color scheme and well-structured sections. I love the responsiveness of this template across both desktop and mobile devices. This ensures seamless viewing experiences.

Additionally, OnePage is built with user-friendliness in mind. There are easy-to-follow comments in the code. You can easily find which parts of the code can be customized, making it beginner-friendly. For businesses wanting to build a landing page fast, this template is a must.

2.

At a Glance

  • Includes a photo, customizable text, and a short form
  • Below the fold, you can also add more information about your offering

Bloated landing pages can distract from your goal, pulling attention away from forms and CTAs for your offer. I like the simplicity of this design. You can avoid clutter and minimize the number of distractions on your page.

You can customize and add other elements to your page, including icons below the form. This template is a great option if you want to build a simple landing page fast.

3.

|

At a Glance

  • Built with Tailwind CSS
  • One time $49 payment
  • Compatible with desktop, tablets, and mobile devices
  • Available in HTML, VUE, Figma, Next.js, Sketch

With Open Pro, SAAS companies can quickly build landing pages that showcase their offerings. Plus, there are multiple ways you can edit this template. You can make changes in Figma, Vue, and HTML, making customization a breeze. You can also add a banner and MP4-compatible background.

I love this template's testimonial feature. You can showcase real customers who have benefited from your offering, making your audience more likely to engage. This template serves as a great starting point, streamlining the process of building a landing page.

4.

At a Glance

  • Free with 探花精选
  • Bright colors that are sure to catch attention
  • Simple, easy-to-customize design

If you鈥檙e looking for a modern, vibrant design for your pages, Focus is the way to go. This page has a simple layout that鈥檚 quick to customize. You just need to decide your form fields, your headline, the text for your offer, and a photo. You can easily upload your assets 鈥 a task made even simpler if you鈥檙e already using 探花精选.

5.

At a Glance

  • Free with 探花精选
  • Prominent CTAs for conversion
  • Easy to customize

Your landing pages don鈥檛 need to be filled with graphics to be well-designed. Sometimes, you just want a prominent headline, basic information, and a CTA for people to click on. If your style is more minimalist, Sprocket may be the best choice for you.

This is one of my favorite options for a straightforward offer strategy. Your newsletter, ebook, or gated content can shine.

6.

|

At a Glance

  • Free options are available
  • Prices go up to $29
  • Fully Responsive across all browsers and devices
  • Built with Bootstrap 5 and HTML5

This responsive template is perfect if you鈥檙e offering special coupons or deals. Businesses can offer free delivery or free add-ons in exchange for leads. I love the fun design of this page. Subtle yet impactful animations capture my attention effectively.

Beyond that, the template's minimalist approach ensures that only relevant information is shared, avoiding overwhelming customers.

7.

|

At a Glance

  • Free options are available
  • Prices go up to $14
  • Fast Loading Times
  • Built with the latest Bootstrap 5 version

This trendy template is an excellent choice for new businesses looking to establish a modern digital presentation. Applayer鈥檚 landing page has attention-catching CTAs with plenty of text modules where you can describe your offerings.

I also love the explore and FAQ sections. You can easily address common questions without the need for direct contact.

8.

|

At a Glance

  • Free for personal and commercial use
  • Designed with Tailwind CSS
  • Customizable components

Treact is a great choice for marketers who want enhanced customization options. This template鈥檚 collection features prebuilt landing pages with an extensive library of customizable UI components. If you find a near-perfect template with one module you want to fine-tune, you can easily shift these UI components.

9.

|

At a Glance

  • Supports most free Wordpress Plugins
  • Free Wordpress Template
  • Includes Documentation

Activello is a free Wordpress landing page. Plus, it鈥檚 built on Bootstrap, making it fully responsive across multiple devices. Beyond that, SEO is essential, allowing customers to find their web page. Luckily, this template prides itself on being Google-friendly. No matter the type of content or business, this highly versatile template can suit your needs.

10.

At a Glance

  • Free with 探花精选
  • Includes modules for hero images and text

贬耻产厂辫辞迟鈥檚 landing page template offers a great way to capture blog subscribers. You can add your own hero image. Then, you can add any context visitors may need before downloading your offer. This template can also be edited with 贬耻产厂辫辞迟鈥檚 drag-and-drop interface for a no-fuss experience.

11.

|

At a Glance:

  • Prices go up to $39
  • Built with Bootstrap 5
  • Multipurpose Design

The EventGrids template boasts an eye-catching design that鈥榮 hard to miss. With its vibrant colors and tastefully integrated animations, it鈥檚 sure to captivate your visitors and draw them into your content.

Purposefully crafted for event pages, the color palette is well-suited to the theme, enticing your audience to join in on the excitement. Simply incorporate your unique content, and you'll be on your way to generating ticket sales and bookings in no time.

12.

At a Glance

  • Available with Wix
  • Customizable
  • CSS Animation on scroll

If you work in consulting, this landing page template makes promoting your services easy. All you need to do is fill out a chart that describes your services and share your store. I love how this template has a smooth scrolling animation, making your site feel extra professional.

13.

|

At a Glance

  • Free options are available
  • Prices go up to $190
  • Multiple variances available
  • SEO optimized

What I like the most about the Boutique template is its neutral design. As an ecommerce business, you need a distinct brand identity, comprising logos, colors, and fonts. Boutique landing pages allow you to quickly showcase your products on the web without confusing your customers with designs outside your brand vision.

With seven color variances, over 70 icons, and SEO Friendiness, the Boutique template is the perfect start.

14.

At a Glance

  • Available with Wix
  • Buttons to download for iOS and Android

If you鈥檙e promoting an app, simple is better. You want to describe how your app benefits users, showcase images of the app interface, and include buttons so visitors can download your offer. This template from Wix has everything you need, so you can create your page quickly.

15.

At a Glance

  • Free with 探花精选
  • Responsive design

Video can be an effective way to capture customers. You can describe your offer in your own words and even show a video demo. If you want to showcase video on your page, this 探花精选 template makes it easy. You can include your video, images, and a description of how users will benefit.

HTML Landing Page Tools

Need some help with your landing page? Here are my favorite options that make building web pages a breeze.

  • 鈥 探花精选 offers a free landing page builder that can help you create and test beautiful landing pages that look great on any device.
  • 鈥 If you鈥檙e working with WordPress, Elementor allows you to choose from 300+ professional-grade page options, rather than create one from scratch. Pricing starts at $49 for one site for one year.
  • 鈥 Ucraft offers a host of free landing page options to help drive lead generation on your site and streamline visitor data collection.
  • 鈥 You can leverage Leadpages as a WordPress plugin to manage site landing pages or upload an HTML page directly to your server. You can then decide exactly how much HTML work you鈥檙e comfortable with and how much you want to offload.
  • 鈥 Startup lets you create a website without code with pre-designed blocks. This Bootstrap-based tool includes a visual editor (no coding required) that will help you build a responsive website design quickly.

Build Your Perfect HTML Landing Page

Converting visitors into valued customers starts with clear, clean, content-rich landing pages. Leverage HTML and CSS basics to design and deploy the best-fit page for your business, and take full control over its functionality and visuals.

Editor's note: This post was originally published in February 2020 and has been updated for comprehensiveness.