< BACK TO COMPONENTS

Responsive Real Estate Website using HTML, CSS, and JavaScript (Source Code)

Faraz

By Faraz -

Create a stunning real estate landing page with HTML, CSS, & JavaScript. Buy, sell, & explore properties easily. Source code included for easy implementation.


Responsive Real Estate Landing Page using html css and javascript.webp

Your real estate journey begins here. Welcome to the world of responsive design, where buying and selling properties is made effortless. In this guide, we'll delve into the art of crafting a captivating landing page for your real estate website. From the foundational languages of HTML, CSS, and JavaScript to the intricate details of user experience optimization, we'll equip you with the knowledge to create a digital showcase that leaves a lasting impression. Whether you're a seasoned developer or just starting out, this guide will provide invaluable insights to elevate your real estate website to new heights of success. Let's embark on this journey together and transform your vision into a stunning reality.

Source Code

Step 1 (HTML Code):

The first thing we need to do is create our HTML File for the real estate landing page. We'll start with well-organized markup. After creating the files just paste the following codes into your file. Remember that you must save a file with the .html extension.


Let's break down the key components:


1. Document Type Declaration: <!DOCTYPE html> declares the document type and version of HTML being used.


2. HTML Structure:


  • <html lang="en">: Defines the document as HTML and specifies the language as English.
  • <head>: Contains meta-information about the document, such as character encoding, viewport settings, and links to external resources like stylesheets and scripts.
  • <body>: Contains the content of the webpage visible to users.

3. Meta Tags:


  • <meta charset="UTF-8">: Specifies the character encoding for the document.
  • <meta name="viewport" content="width=device-width, initial-scale=1.0">: Sets the viewport properties for responsive design.
  • <meta http-equiv="X-UA-Compatible" content="ie=edge">: Specifies the version of Internet Explorer to use.
  • Title: <title> tag sets the title of the webpage displayed in the browser's title bar or tab.

4. External Resources:


  • Stylesheets: Linked using <link> tags. One stylesheet is loaded from an external CDN (slick-carousel) and another from a local file (styles.css).
  • Scripts: Linked using <script> tags. jQuery library, Font Awesome icons, and Slick carousel script are included.

5. Header Section:


  • Contains the website logo and navigation menu with links to various sections of the website.
  • Hamburger menu icon for mobile navigation.

6. Sections:


  • Each section represents a different part of the webpage, such as the hero section, how-it-works section, properties section, agents section, etc.
  • Each section contains relevant content along with images and text.

7. Footer Section:


  • Contains information about the website, quick links, subscription form, and social media links.
  • Also includes copyright information and credits to the template provider.

8. Script Inclusion:


  • <script src="script.js"></script>: Includes a JavaScript file named script.js, which contains client-side scripting logic for interactivity.

Step 2 (CSS Code):

Next, we need to style our real estate landing page by adding our CSS. This will give our real estate landing page an upgraded presentation. Create a CSS file with the name of styles.css and paste the given codes into your CSS file. Remember that you must create a file with the .css extension.


Let's break it down section by section:


1. @import: This rule imports external stylesheets. In this case, it imports the Google Fonts "Playfair Display" and "Roboto" to be used in the document.


2. Global Styles:


  • body: Sets default styles for the entire body of the webpage such as font, margin, padding, etc.
  • *: Applies styles to all elements, removing outlines by default.
  • .container and .flex: Defines styles for containers and flex containers respectively.
  • Headings (h1-h5): Sets styles for different heading levels.
  • Paragraphs (p): Sets styles for paragraphs.
  • Button (button.rounded): Styles for a specific button class.
  • Large Paragraph (p.large-paragraph): Styles for paragraphs with a specific class.

3. Header Styles:


  • #header-hero-container: Styles for the header container.
  • header: Styles for the header element which includes navigation.
  • #logo and .hamburger-menu: Styles for the logo and hamburger menu.
  • header ul: Styles for the unordered list within the header.
  • #close-flyout: Styles for a close button within the header.
  • Various styles for links within the header.

4. Hero Section Styles:


  • #hero: Styles for the hero section which typically appears at the top of the webpage.
  • #hero .fade: Styles for a fading effect over the hero image.
  • #hero .hero-text: Styles for the text content within the hero section.

5. How it Works Section Styles:


  • #how-it-works: Styles for a section titled "How it Works".
  • #how-it-works h2: Styles for the heading within this section.
  • #how-it-works .flex > div: Styles for the layout of elements within this section.
  • #how-it-works h4 and #how-it-works span.fas: Additional styles for headings and icon spans within this section.

6. #properties: Styles for a section titled "Properties".


  • Sets margins and positioning.
  • Styles headings, containers, and slider elements for property details.
  • Defines styles for property images, details, and buttons.

7. #agents: Styles for a section titled "Agents".


  • Sets margins, padding, and border.
  • Defines styles for paragraphs, flex containers, and individual agent cards.
  • Specifies styles for agent card images, headings, and paragraphs.

8. #the-best: Styles for a section titled "The Best".


  • Sets margins and widths for images and text.
  • Defines styles for unordered lists.

9. #services: Styles for a section titled "Services".


  • Sets background color, padding, and margins.
  • Defines styles for headings, flex containers, service icons, and links.
  • Specifies hover effects for links.

10. #testimonials: Styles for a section titled "Testimonials".


  • Sets margins.
  • Defines styles for headings, slider elements, blockquotes, testimonial captions, and arrows.

11. #contact: Styles for the contact section.


  • Sets background color, padding, and margins.
  • Styles headings and containers for the form and address.
  • Defines styles for form elements like labels, inputs, and textareas.
  • Specifies styles for the address container and its content.

12. footer: Styles for the footer section.


  • Set background color and padding.
  • Styles headings and containers for different footer elements like about, quick links, and subscribe.
  • Defines styles for text, links, input fields, buttons, and subscription lists within the footer.

13. @media (max-width: 991px):


  • Adjust styles for screens with a maximum width of 991px.
  • Moves the logo slightly.
  • Displays a navigation toggle.
  • Styles the navigation menu to slide in from the right side.
  • Adjust styles for navigation links, making them display vertically.

14. @media (max-width: 767px):


  • Further adjust font sizes for headings and paragraphs.
  • Modifies container widths for better responsiveness.
  • Adjust the layout of certain sections like agents, the best, properties, services, contact, and footer.
  • Changes button widths and arrow sizes.
  • Rearrange elements and their widths to fit smaller screens.

15. @media (max-width: 500px):


  • Further adjust container widths and margins for smaller screens.
  • Modifies button widths and paragraph font sizes.
  • Alters the layout of sections like agents, how it works, properties, services, testimonials, contact, and footer to adapt to narrower screens.

16. @media (max-width: 400px):


  • Makes additional adjustments for screens with a maximum width of 400px.
  • Further limits the width of the hero text and button for better fit.
  • Adjusts the width of the navigation menu.
@import url('https://fonts.googleapis.com/css?family=Playfair+Display|Roboto&display=swap');

body {
    font-family: "Roboto", "Helvetica", "Sans-serif";
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    color: #777;
    line-height: 1.7;
}

* {
    outline: none;
}

*:not(.slick-track):not(.slick-list) {
    transition: 0.4s;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
    justify-content: space-between;
}

h1, h2, h3, h4, h5 {
    margin: 0;
    padding: 0;
}

h1, h2 {
    font-family: "Playfair Display", serif;
    font-weight: 800;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    color: #f69314;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h3 {
    font-size: 1.4rem;
    font-weight: 300;
}

h4 {
    font-size: 1.2rem;
    font-weight: 300;
}

h5 {
    font-size: 1rem;
    font-family: "Playfair Display", serif;
}

p {
    margin: 0 0 1rem;
}

button.rounded {
    background: #f69314;
    border: none;
    color: #fff;
    font-size: 16px;
    border-radius: 30px;
    padding: 10px 30px;
    line-height: 1.5;
    cursor: pointer;
}

p.large-paragraph {
    font-size: 1.25rem;
    font-weight: 300;
}
/* end: global styles */

/* start: header styles */
#header-hero-container {
    min-height: 600px;
    height: calc(100vh);
    position: relative;
}

header {
    background: transparent;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    width: 100%;
    z-index: 3;
}

#logo {
    font-family: "Roboto", "Helvetica", "Sans-serif";
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    position: relative;
    top: 4px;
}

.hamburger-menu {
    background-color: transparent;
    border: 1px solid #fff;
    padding: 3px 5px;
    width: 30px;
    cursor: pointer;
    margin-top: 10px;
    display: none;
}

.hamburger-menu .strip {
    display: block;
    height: 1px;
    background-color: #fff;
    margin: 4px 0;
}

header ul {
    list-style-type: none;
}

header ul li {
    display: inline-block;
    margin: 0 15px;
}

#close-flyout {
    display: none;
}

header ul li a {
    color: #999;
    font-size: 16px;
    text-decoration: none;
}

header ul.is-sticky li a {
    color: #000;
}

header ul li a:hover,
header ul li a.active {
    color: #fff;
}

header ul.is-sticky li a:hover,
header ul.is-sticky li a.active {
    color: #f69314;
}
/* end: header styles */

/* start: hero section styles */
#hero {
    background: url('https://onclickwebdesign.com/wp-content/uploads/hero_1.jpg') center center no-repeat;
    background-size: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    height: 100%;
    width: 100%;
}

#hero .fade {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(52, 58, 64, 0.9);
    z-index: 1;
}

#hero .hero-text {
    position: absolute;
    top: 50%;
    margin: -75px auto 0;
    left: 0;
    right: 0;
    z-index: 2;
    color: #fff;
    width: 500px;
    text-align: center;
}

#hero .hero-text p {
    line-height: 1.5em;
    font-weight: 300;
    font-size: 1rem;
}
/* end: hero section styles */

/* start: how it works styles */
#how-it-works {
    padding: 3rem 0;
    background: #f8f9fa;
    text-align: center;
}

#how-it-works h2 {
    margin-bottom: 3rem;
}

#how-it-works .flex > div {
    width: 30%;
}

#how-it-works h4 {
    color: #343a40;
    margin-top: 1rem;
}

#how-it-works span.fas {
    color: #f69314;
    font-size: 35px;
}

#properties {
    margin: 4rem 0 8rem;
    position: relative;
}

#properties h2 {
    margin-bottom: 3rem;
}

#properties .container {
    position: relative;
}

#properties .container:before {
    content: "/";
    position: absolute;
    right: 80px;
    top: 18px;
    color: #999;
}

#properties-slider a.slick-arrow {
    color: #000;
    position: absolute;
    top: -78px;
    right: 0;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    text-decoration: none;
}

#properties-slider a.slick-prev {
    right: 80px;
}

#properties-slider .slick-slide {
    padding: 0 15px;
}

#properties-slider img {
    width: 100%;
    display: block;
}

#properties-slider .property-details {
    padding: 1rem;
}

#properties-slider .price {
    font-size: 1.2rem;
    color: #343a40;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
}

#properties-slider .property-details span {
    font-size: 0.8rem;
    padding-right: 15px;
}

#properties-slider .property-details span.baths {
    padding-left: 10px;
}

#properties-slider .property-details span.sqft {
    padding-right: 0;
    padding-left: 10px;
}

#properties-slider .property-details span.beds,
#properties-slider .property-details span.baths {
    border-right: 1px solid #888;
}

#properties-slider .property-details address {
    font-size: 0.8rem;
    font-style: normal;
    margin-top: 0.5rem;
}

#properties button.rounded {
    display: block;
    margin: 2rem auto 0;
    width: 350px;
}

#agents {
    margin: 4rem 0 6rem;
    padding: 0 0 6rem;
    border-bottom: 1px solid #ccc;
}

#agents p.large-paragraph {
    width: 50%;
    margin-bottom: 4rem;
}

#agents .flex {
    flex-wrap: wrap;
    padding: 0;
}

#agents .card {
    width: 32%;
    background: #f0f0f0;
    margin-bottom: 2rem;
}

#agents .card img {
    width: 100%;
}

#agents .card h3 {
    font-family: "Playfair Display", serif;
    color: #000;
}

#agents .card h3,
#agents .card p {
    padding-left: 1rem;
}

#the-best {
    margin: 2rem 0;
}

#the-best .flex > img {
    width: 47%;
}

#the-best .flex > div {
    width: 40%;
}

#the-best ul {
    padding-left: 20px;
    margin-bottom: 4rem;
}

#the-best ul li {
    margin: 10px 0;
}

#services {
    background: #f8f9fa;
    padding: 6rem 0;
    margin: 8rem 0;
    border-bottom: 1px solid #dee2e6;
}

#services h2 {
    text-align: center;
    margin-bottom: 3rem;
}

#services .flex {
    flex-wrap: wrap;
}

#services .flex > div {
    width: 30%;
    margin-bottom: 2rem;
}

#services .flex > div .fas {
    color: #f69314;
    font-size: 40px;
    float: left;
    margin-top: 15px;
    width: 20%;
    text-align: center;
}

#services .flex > div .services-card-right {
    float: right;
    width: 75%;
}

#services .flex > div a {
    color: #f69314;
    text-decoration: none;
}

#services .flex > div a:hover {
    text-decoration: underline;
}

#testimonials {
    margin-bottom: 8rem;
}

#testimonials h2 {
    text-align: center;
}

#testimonials-slider .slick-slide {
    text-align: center;
}

#testimonials-slider blockquote {
    font-size: 1.5rem;
    font-style: italic;
    margin: 1rem auto 3rem;
    max-width: 740px;
}

#testimonials-slider .testimonials-caption {
    width: 200px;
    margin: 0 auto;
}

#testimonials-slider .testimonials-caption img {
    float: left;
    border-radius: 30px;
    width: 60px;
}

.testimonials-caption p {
    position: relative;
    top: 13px;
    font-size: 1.2rem;
}

#testimonials-slider .slick-arrow {
    text-decoration: none;
    position: absolute;
    font-size: 40px;
    color: #222;
    top: 50%;
    margin-top: -35px;
    z-index: 1;
}
#testimonials-slider .slick-next {
    right: 0;
}
/* end: testimonials styles */

/* start: contact us styles */
#contact {
    background: #f8f9fa;
    padding: 4rem 0 8rem;
}

#contact h2 {
    text-align: center;
    margin-bottom: 4rem;
}

#form-container {
    width: 58%;
    background: #fff;
    padding: 3rem;
    box-sizing: border-box;
    height: 0%;
}

#form-container h3 {
    color: #000;
    font-family: "Playfair Display", serif;
    margin-bottom: 2rem;
}

#form-container label {
    display: block;
    color: #000;
    margin-top: 1rem;
}

#form-container input,
#form-container textarea {
    display: block;
    border-radius: 20px;
    padding: 10px;
    border: 1px solid #ced4da;
    width: 100%;
    box-sizing: border-box;
    height: 43px;
    font-family: "Roboto", "Helvetica", "Sans-serif";
    font-size: 1rem;
    color: #495057;
}

#form-container textarea {
    height: 170px;
    margin-bottom: 2rem;
    resize: none;
}

#address-container {
    width: 38%;
    background: #fff;
    padding: 1.5rem;
    box-sizing: border-box;
    height: 0%;
}

#address-container label {
    font-weight: 700;
    display: block;
    margin-top: 2rem;
}

#address-container label:first-child {
    margin-top: 0;
}

#address-container address {
    margin-bottom: 1.5rem;
    font-style: normal;
}

#address-container a {
    text-decoration: none;
    color: #f69314;
}

#address-container a:hover {
    text-decoration: underline;
}
/* end: contact us styles */

/* start: footer styles */
footer {
    background: #333;
    padding: 8rem 0;
}

footer .flex {
    padding-bottom: 6rem;
    border-bottom: 1px solid #777;
}

footer h5 {
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 300;
}

footer h5.follow-us {
    margin-top: 1rem;
}

footer .footer-about {
    width: 47%;
}

footer .footer-about p {
    width: 65%;
}

footer .footer-quick-links {
    width: 16%;
}

footer .footer-quick-links ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

footer .footer-quick-links ul li {
    margin: 10px 0;
}

footer .footer-quick-links ul li a {
    color: #777;
    text-decoration: none;
}

footer .footer-quick-links ul li a:hover {
    color: #fff;
}

footer .footer-subscribe {
    width: 35%;
}

#subscribe-container {
    position: relative;
}

footer .footer-subscribe input {
    border-radius: 30px;
    height: 43px;
    font-family: "Roboto", "Helvetica", "Sans-serif";
    border: 1px solid #6c757d;
    background-color: transparent;
    font-size: 1rem;
    padding: 10px;
    color: #fff;
    box-sizing: border-box;
    width: 80%;
}

footer button.right-rounded {
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    background: #f69314;
    font-size: 16px;
    color: #000;
    padding: 10px 30px 9px;
    line-height: 1.5;
    cursor: pointer;
    border: none;
    position: absolute;
    right: 0;
}

footer button.right-rounded:hover {
    background: #fff;
}

footer .footer-subscribe ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

footer .footer-subscribe ul li {
    display: inline-block;
    margin: 0 16px;
}

footer .footer-subscribe ul li:first-child {
    margin-left: 0;
}

footer .footer-subscribe ul li a {
    text-decoration: none;
    color: #777;
}

footer .footer-subscribe ul li a:hover {
    color: #fff;
}

footer small {
    margin-top: 3rem;
    font-size: 1rem;
    display: block;
    text-align: center;
}

footer small a {
    color: #777;
    text-decoration: none;
}

footer small a:hover {
    color: #fff;
}
/* end: footer styles */

/* start: media queries */
@media (max-width: 991px) {
    #logo {
        top: 1px;
    }

    #nav-toggle {
        display: block;
    }

    nav ul {
        position: fixed;
        background: #fff;
        right: -100%;
        top: 0;
        margin: 0;
        padding: 2rem;
        height: 100%;
        width: 300px;
        box-sizing: border-box;
        box-shadow: 5px 0 10px 3px #999;
    }

    #close-flyout {
        position: absolute;
        right: 2rem;
        top: 1.5rem;
        font-size: 30px;
        color: #777;
        cursor: pointer;
        display: block;
        line-height: 1;
        margin: 0;
    }

    nav ul li {
        display: block;
        margin: 20px 0;
    }

    nav ul li:first-child {
        margin-top: 50px;
    }
    nav ul li a {
        font-size: 20px;
        color: #212529;
    }

    nav ul li a.active,
    nav ul li a:hover {
        color: #f69314;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .large-paragraph {
        font-size: 1rem;
    }

    p {
        font-size: 0.8rem;
    }

    .container {
        max-width: 540px;
    }

    #hero .hero-text {
        width: 400px;
    }

    #agents .card {
        width: 49%;
    }

    #the-best .flex > img {
        display: none;
    }

    #the-best .flex > div {
        width: 100%;
    }

    #testimonials-slider p {
        font-size: 1.2rem;
    }

    #properties .container:before {
        top: 2px;
        font-size: 0.85rem;
    }

    #properties-slider a.slick-arrow {
        font-size: 0.85rem;
    }

    #properties button.rounded {
        width: 300px;
    }

    #services .flex > div {
        width: 48%;
    }

    #contact .flex {
        flex-wrap: wrap;
    }

    #form-container {
        width: 100%;
        padding: 2rem;
    }

    #address-container {
        width: 100%;
        margin-top: 2rem;
    }

    footer {
        padding: 6rem 0;
    }

    footer .flex {
        flex-wrap: wrap;
    }

    footer .flex > div {
        width: 100%;
        margin-top: 1rem;
    }

    footer .flex > div:first-child {
        margin-top: 0;
    }

    footer .footer-about p {
        font-size: 1rem;
        width: 100%;
    }

    footer .footer-subscribe input {
        width: 90%;
    }

    footer h5.follow-us {
        margin-top: 2rem;
    }
}

@media (max-width: 500px) {
    #hero .hero-text {
        width: 330px;
    }

    #agents {
        margin: 4rem 0 3rem;
        padding: 0 0 3rem;
    }

    #agents .card {
        width: 100%;
    }

    #agents p.large-paragraph {
        width: 100%;
    }

    #how-it-works .flex {
        display: block;
    }

    #how-it-works .flex > div {
        width: 100%;
        margin-top: 2rem;
    }

    #properties button.rounded {
        width: 250px;
    }

    #services {
        padding: 4rem 0 3rem;
        margin: 4rem 0;
    }

    #services .flex > div {
        width: 100%;
    }

    #testimonials {
        margin-bottom: 4rem;
    }

    #testimonials-slider p {
        font-size: 1rem;
    }

    #testimonials-slider .slick-arrow {
        display: none !important;
    }

    #contact {
        padding: 4rem 0;
    }

    #contact h2 {
        margin-bottom: 2rem;
    }

    #form-container {
        padding: 1.5rem;
    }

    footer {
        padding: 4rem 0;
    }
}

@media (max-width: 400px) {
  #hero .hero-text {
     max-width: 275px;
     width: 100%;
  }
  
  #properties button.rounded {
     max-width: 250px;
     width: 100%;
  }
  
  nav ul {
    width: 200px;
  }
} 

Step 3 (JavaScript Code):

Finally, we need to create a function in JavaScript. Here's a breakdown of what each part does:


1. Document Ready Function: $(function () {...});


  • This function runs when the document (HTML) has been loaded and parsed by the browser. It ensures that the code inside it will execute only when the document is fully loaded.

2. Selecting DOM Elements:


  • let headerElem = $('header');, let logo = $('#logo');, let navMenu = $('#nav-menu');, let navToggle = $('#nav-toggle');
  • These lines select specific elements from the HTML using jQuery selectors. For example, $('header') selects the <header> element, $('#logo') selects an element with the ID "logo", and so on.

3. Initializing Slick Slider for Properties:


  • $('#properties-slider').slick({...});
  • This code initializes a slick slider for a set of properties. It defines various settings for the slider, such as the number of slides to show, navigation arrows, and responsive behavior for different screen sizes.

4. Initializing Slick Slider for Testimonials:


  • $('#testimonials-slider').slick({...});
  • Similar to the properties slider, this code initializes a slick slider for testimonials. It sets options for infinite scrolling and navigation arrows.

5. Handling Navigation Toggle:


  • navToggle.on('click', () => {...});, $('#close-flyout').on('click', () => {...});, $(document).on('click', (e) => {...});
  • These lines handle the opening and closing of a navigation menu when a toggle button is clicked or when a click event occurs outside the menu. They adjust the CSS properties of the navigation menu to control its visibility.

6. Handling Scroll Events:


  • $(document).scroll(() => {...});
  • This code detects when the user scrolls the document and adjusts certain CSS properties of the header and navigation elements based on the scroll position. For example, it changes the background color, adds a shadow effect, and adjusts the logo color.

7. Triggering Initial Scroll Event:


  • $(document).trigger('scroll');
  • This line triggers a scroll event when the document is initially loaded, ensuring that the header and navigation elements are styled appropriately based on the initial scroll position.

Create a JavaScript file with the name script.js and paste the given codes into your JavaScript file and make sure it's linked properly to your HTML document so that the scripts are executed on the page. Remember, you’ve to create a file with .js extension.

$(function () {
  let headerElem = $('header');
  let logo = $('#logo');
  let navMenu = $('#nav-menu');
  let navToggle = $('#nav-toggle');

 $('#properties-slider').slick({
      slidesToShow: 4,
      slidesToScroll: 1,
      prevArrow: '<a href="#" class="slick-arrow slick-prev">previous</a>',
      nextArrow: '<a href="#" class="slick-arrow slick-next">next</a>',
      responsive: [
          {
              breakpoint: 1100,
              settings: {
                  slidesToShow: 3,
                  slidesToScroll: 1,
                  infinite: true,
              }
          },
          {
              breakpoint: 767,
              settings: {
                  slidesToShow: 2,
                  slidesToScroll: 1,
                  infinite: true,
              }
          },
          {
              breakpoint: 530,
              settings: {
                  slidesToShow: 1,
                  slidesToScroll: 1,
                  infinite: true,
              }
          }
      ]
 });

 $('#testimonials-slider').slick({
      infinite: true,
      slidesToShow: 1,
      slidesToScroll: 1,
      prevArrow: '<a href="#" class="slick-arrow slick-prev"><</a>',
      nextArrow: '<a href="#" class="slick-arrow slick-next">></a>'
 });

 navToggle.on('click', () => {
     navMenu.css('right', '0');
 });

 $('#close-flyout').on('click', () => {
      navMenu.css('right', '-100%');
 });

 $(document).on('click', (e) => {
     let target = $(e.target);
     if (!(target.closest('#nav-toggle').length > 0 || target.closest('#nav-menu').length > 0)) {
         navMenu.css('right', '-100%');
     }
 });

 $(document).scroll(() => {
     let scrollTop = $(document).scrollTop();

     if (scrollTop > 0) {
         navMenu.addClass('is-sticky');
         logo.css('color', '#000');
         headerElem.css('background', '#fff');
         navToggle.css('border-color', '#000');
         navToggle.find('.strip').css('background-color', '#000');
     } else {
         navMenu.removeClass('is-sticky');
         logo.css('color', '#fff');
         headerElem.css('background', 'transparent');
         navToggle.css('bordre-color', '#fff');
         navToggle.find('.strip').css('background-color', '#fff');
     }

     headerElem.css(scrollTop >= 200 ? {'padding': '0.5rem', 'box-shadow': '0 -4px 10px 1px #999'} : {'padding': '1rem 0', 'box-shadow': 'none' });
 });

 $(document).trigger('scroll');
});

Final Output:

Responsive Real Estate Landing Page using html css and javascript.gif

Conclusion:

In the ever-evolving landscape of real estate, a responsive website landing page is not just an option—it's a necessity. As we conclude our journey through the intricacies of design, development, and optimization, it's clear that the key to success lies in attention to detail and a commitment to excellence. By harnessing the power of HTML, CSS, and JavaScript, coupled with thoughtful design elements and user-centric features, you have the tools to create a digital space that captivates and converts. So, whether you're showcasing luxury estates or cozy starter homes, remember that every pixel counts and every interaction matters. With the insights gained from this guide, go forth and build with confidence, knowing that your real estate website landing page is primed for success in a competitive market. Happy Coding!

That’s a wrap!

I hope you enjoyed this post. Now, with these examples, you can create your own amazing page.

Did you like it? Let me know in the comments below 🔥 and you can support me by buying me a coffee.

And don’t forget to sign up to our email newsletter so you can get useful content like this sent right to your inbox!

Thanks!
Faraz 😊

End of the article

Subscribe to my Newsletter

Get the latest posts delivered right to your inbox


Latest Post