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

JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops For Loops

SAHIL SANWAL
SAHIL SANWAL
6,116 Points

circles coming vertical instead of horizontal

so i have entered the code just as shown in video but for some reason my circles are coming in vertical instead of horizontal line

2 Answers

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

Add the following rule to your css

div{
   display: inline-block;
}

because, by default DIV is block element

Robert Szabo
Robert Szabo
7,999 Points

Sahil, I had the same problem. And found the solution too. I forgot to put a closing div in the statement, I had too divs but the second one was not a closing one. So I would suggest you to double check that one. It should look like this:

html += '<div>' + i + '</div>';