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 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.

Why??

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!