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!

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

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
227,140 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
227,140 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.