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 Online Registration Form

Aligning the select tag.

Hello, I am having trouble getting the select tag to align to its corresponding label. Any help will be appreciated :) here is a link to my code on git hub:

https://github.com/TaranAlbury242/project/blob/master/index.html

1 Answer

Mike Hickman
Mike Hickman
19,817 Points

Hi Taran,

Since the selection options are in a div, that div is automatically going to want it's own line. Just add a css property to the <div class="selection"> element in your .css file.

.selection {
  display: inline-block;
}

In case you don't have a css file yet, you can do the quick-and-dirty way (not best practice, but it works) and add your style directly into your html page.

<div class="selection" style="display: inline-block;"

Have fun!

Mike

Thank you for the help Mike.