positioning a form - html/css only
Hey guys , im trying to position a form like in this picture
this is my code so far :
https://codepen.io/MightyFriesByte/pen/KwdoLOj
PLEASE! don't give me a solution
just try to help me to get into the solution :)(

20 Replies
You want to place the form and the paragraph side by side horizontally so you need to do something so they aren't rendering on new lines
Look into flex
And how you can position two elements horizontally with it
i thought maybe i can do that with POSITION but im trying to come up with FLEX , what i have in mind is to put the email input in seperate div and also the P
How does a flex container layout it's children normally?
It's horizontal right
So you need to make the form and paragraph children somehow
First thing look at the flex direction you've set on form group
Second actually use a form element please
Also form group has multiple direct children instead of just the form and the paragraph
You need to have a flex container with only the form content and paragraph as children
it doesnt make sense and i tell you why
the order is like that
h1
inputs
buton
p
What doesn't make sense
that one
Ok but what does changing order do
the browser reads top to bottom
You need to layout the form content on top of each other.
The input should be above button and the whole form containing the input and button should be on the left of para
Why does this matter
It doesn't matter for layout
You gotta create containers for layout. Layout is css thing and while html order can affect the possible ways to stack stuff this isn't relevant in what I'm telling you to do
ok
so should i stack the form and button in child div of the form-group ?
Something like this
The form and paragraph container should be flex container
Also what exactly are you doing here. Where is this exercise from
can i ask u something bro ?
You can but i might not answer
this form also has h1 in top , should i not put a container of the h1 and the form and then the p in seperate element ?
If you keep the h1 inside the form and paragraph container what do you think will happen
Do you want the h1 horizontally stacked? Or do you want it on top of form and paragraph
Think about it
Or maybe just try it out and see the result
i see that it goes when ever the form goes so its not efficient it all
i think i should put the email input in seperate div cause first name and last name should be above and the email in bottom
Try it out
ok
OMG
it doesn't go down 🙁
finished