Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

jason limmm
jason limmm
8,009 Points

no idea how to make progress bar

<!DOCTYPE html>

<html>
    <head>
        <title>Form</title>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div class="flex form" id="name">
            <div id="contents">
                <h1>Tell us a little about yourself.</h1>
            </div>
        </div>
    </body>
</html>
body{
    background-color:#DEF3F1;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
}
.flex{
    display:flex;
}
#form{
    border-radius: 5px;
    background-color:#FFF;
    min-width: 100px;
    max-width:800px;
    margin:0 auto;
    flex-direction: column;
}
#contents{
    margin: 0 auto;
}

i am trying to figure how to make a progress bar for a code adventure i started but i don't how to start and how to make it progress as the form progresses

2 Answers

Steven Parker
Steven Parker
231,236 Points

HTML includes a <progress> element. See this MDN page for details and a usage example.

Also, this segment of Episode 129 of "The Treehouse Show" has an example of creating progress bars using a Google code library.

Updating progress will require some kind of asynchronous code, possibly using a ProgressEvent handler.

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi jason limmm 👋

There's a special tag for progress bars you could use for this purpose 🙂 From there you most likely want have add some JavaScript to your project to make the value dynamic.

Hope this helps!