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

CSS

I am having issues evenly placing label to the left, and input fields to the right (Online Registration Form, Project 3)

When creating a form using the @media screen and (min-width 768px), I am having issues evenly aligning the form, so that the labels are to the left (Name, Email Address, Phone Number, etc), and the input field is to the right.

https://w.trhou.se/sr9vqe5z47

2 Answers

Steven Parker
Steven Parker
241,434 Points

Since these are already flex items, you can just add a couple of parameters to the labels to align them:

/* inside the media query */
  label {
    flex-basis: 80px;
    align-self: center;
  }

Wow that worked. I could not figure it out for the life of me. Thank you so much!