Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Forms Form Basics Overview of Forms

Amanda Cox
Amanda Cox
3,213 Points

Styling an HTML form

So I have made my own HTML form.

I am trying to apply some flexbox styles to position the elements on separate lines and center everything.

However, it only works when I use a universal selector. It doesn't work when I use body or form, or create a class.


Amanda it would help to see the code that you are using. It is impossible for anyone to help you without it.

1 Answer

Maybe because 1st in your HTML Text Document You have way to many of the tags you wanna style for example: There's 5 h1 tags And you want to one of the main selectors like h1{}, etc. So in short. Give it classes or ID'S

In case you don't know that

         <h1 class="Header">The New York Times Magazine</h1> //Class 
          <h1 id="Header">The New York Times Magazine</h1>   // ID

Use whatever you like id's or classes It's up to you Amanda. Good luck in your coding journey!