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.

JavaScript

on a form I want to display the input fields inline, with their labels left-justified with the the field and above it.

On a form I want to display the input fields inline, with their labels left-justified with the the field and above it. I have the inline portion but cannot seems to find instruction on how to place the labels above the input fields.

Steven Parker
Steven Parker
215,939 Points

Do you need to do this in JavaScript? It sounds like a job for CSS (and maybe HTML).

But in any case, you'll need to show your code.

2 Answers

Steven: Yep, I mis-clicked. It isn't javascript at all. It is just part of an overall node/express project. The files are actually pug files. How's that for being really misleading? I decided to do it in CSS Grid. Thought about that about 2 minutes after I posted the question. But it is still an interesting challenge. I have done navigation brilliantly with CSS Grid. But, it isn't going as smoothly with these form components. Seems like I ought to be able to do it though, using grid-template-areas to place the component pieces.

Steven Parker
Steven Parker
215,939 Points

Remember to show the code if you'd like someone to take a look at it.

Yeah I will. But I think I'll wrestle with it since I thought of the CSS Grid approach, first.