Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 years ago

Mobile friendly chat-app using flex, grid and positioning

Jonah Unuafe•390
@jonahunuafe
A solution to the Chat app CSS illustration challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What is the best practice as regards proper identation in html?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Eileen dangelo•1,600
    @Eileenpk
    Posted about 2 years ago

    Hi Jonah, your project looks great.

    Proper indentation in HTML is important for the readability and maintainability of code. The most widely accepted convention for indentation in HTML is to use two or four spaces for each level of indentation. If you are using VS Code then I would recommend installing the Prettier extension, it works like a charm!

    Here is what your code should look like properly indented.

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link
          rel="icon"
          type="image/png"
          sizes="32x32"
          href="./images/favicon-32x32.png"
        />
        <link rel="stylesheet" href="style.css" />
        <link
          rel="stylesheet"
          href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
        />
        <title>Frontend Mentor | CHAT-APP-CSS-ILLUSTRATION</title>
      </head>
      <body>
        <main>
          <div class="top-curve"></div>
          <div class="phone-container">
            <div class="ear-piece"></div>
            <div class="samuel-arc">
              <i class="fa fa-angle-left" style="font-size: 20px"></i>
              <img class="avatar" src="images/avatar.jpg" alt="an avatar" />
              <span class="green">Samuel Green</span>
              <span class="walk">Available to Walk</span>
              <i class="fa fa-ellipsis-v"></i>
            </div>
            <div class="phone-enclosure">
              <div class="left-chart-1">
                <p>That sounds great. I'd been happy to discuss more.</p>
              </div>
              <div class="left-chart-2">
                <p>Could you send some pictures of your dog, please?</p>
              </div>
              <div class="animals">
                <img
                  class="dog-1"
                  src="images/dog-image-1.jpg"
                  alt="a dog with mouth open wide"
                />
                <img
                  class="dog-2"
                  src="images/dog-image-2.jpg"
                  alt="a dog lying down"
                />
                <img
                  class="dog-3"
                  src="images/dog-image-3.jpg"
                  alt="a dog with stick in its mouth"
                />
              </div>
              <div class="right-chart-1">
                <p>Here are a few pictures. She's a happy girl!</p>
              </div>
              <div class="right-chart-2">
                <p>Can you make it?</p>
              </div>
              <div class="left-chart-3">
                <p>
                  She looks so happy! The time we discuss works. How long shall I
                  take her out for?
                </p>
              </div>
              <div class="thirty-min">
                <i class="fa fa-circle-thin" style="font-size: 25px"></i>
                <span>30 minute walk</span><span id="twenty-nine">$29</span>
              </div>
              <div class="one-hour">
                <i
                  id="second-circle"
                  class="fa fa-circle-thin"
                  style="font-size: 25px"
                ></i>
                <span id="an-hour-walk">1 hour walk</span
                ><span id="forty-nine">$49</span>
              </div>
              <div class="button">
                <span>Type a message...</span>
                <div class="black-dot">
                  <i
                    id="dot-angle-right"
                    class="fa fa-angle-right"
                    style="font-size: 25px"
                  ></i>
                </div>
              </div>
            </div>
          </div>
          <div class="booking">
            <h1>Simple booking</h1>
            <p>
              Stay in touch with our dog walkers through the chat interface. This
              makes it easy to discuss arrangements and make bookings. Once the walk
              has been completed you can rate your walker and book again all through
              the chat.
            </p>
          </div>
          <div class="bottom-curve"></div>
        </main>
      </body>
    </html>
    
    

    Hope you found this helpful!

    • Let's connect on LinkedIn! - @Eileenpk
    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub