Help with height responsiveness!
Project link: https://benevolent-seahorse-6c9816.netlify.app/
I drawing a blank in figuring out how to make my mid section follow changes in height.
So if you go into responsive mode, and start stretching screen vertically or diagonally it should do the same, instead of being glued to the top. š¦
Halp!
80 Replies
From what I understand you want, putting a
min-height: 100vh;
on your .container
(and then position the elements inside accordingly) could help you achieve it.
Hope that helps.@daswolle Tried all that already but just can't get it right.
On body, container, main, form, fieldset, I tried doing something with every block but just could get it right.
What's your problem exactly? What's the intended result?
@stefanh So as I said, I want my header and footer to stay still, or slightly adjust, while mi mid section is the one that is doing the stretching and adapting to the device screen resolution, both vertically and horizontally.
It should not be hard thing to do, I just am not being able to do it for some reason. xD
You want your Next Step button to be at the bottom of the page?
Kevin Powell
YouTube
Simplify your CSS with these 3 grid layout solutions
Grid is often seen as useful for really large layouts that have a lot of different pieces, but there are other simple things that it can be super handy for as well!
š Links
ā
How to pick between Flexbox and Grid: https://youtu.be/3elGSZSWTbM
ā
Getting started with CSS Grid: https://youtube.com/playlist?list=PL4-IK0AVhVjM41-Ezm5tmESVchNEi7aZU
...
I prefer the Grid method just went over this with https://discord.com/channels/436251713830125568/1073641982318084337 this morning
You could do this exact pattern by pulling your footer into .container and zoom zoom
That is if we are understanding correctly
@stefanh Yeah I already tried that but did not work. xD
@b1mind Looks promising! Will try it out when I'm home! š
@b1mind Nope. Does not work...
Share what does not work or I can't help
I linked project above, so you can see what I'm talking about, but I guess it's just way too spahetti or something since I have container, main, form, fieldset, section
I did share it, I really do not know how to explain it differently
Ok its updated?
you can see it for yoruself as well, footer does not get stuck to the bottom of page when being resized, and mid does nto adapt
Looks the same though I don't see any grid or changes
I changed it on my end, it does nothing
so I did not update
Push the changes that don't work for you or I can't help with what didn't work
So key points from this SS is html,body {height: 100%;} then pull the footer out into the .container
Did not want since I wrote more code, but here now i pushed it
wait
Is the above your desired outcome?
Sort of, I would like for form to adjust as well. And for footer, it has form confirm button on it, will it work if I pull it out of form?
ahhh good point
Give me a sec I'm still sipping coffee
we will have to do the same but expand the main/form
Wait
Not sure if you want a <footer> element in a <form> element either š¤ not sure on that one
on my part it still goes below screen size when you lower it...So you need to scroll down to find footer...It's just a convoluted mess. xD
what size screen height?
Yeah I didn't know what to do...I just made a mess
wait let me screenshot it
So, you see footer? I want that to follow the screen resizing, to be stuck to the bottom of the screen
it is in that screen
xD
so if I look on phone, its on the bottom if not a really small screen where it just needs to be scrolled down. IF I look on the tablet, it's still on the bottom of the screen, not in the middle
Same with desktop
ok it can't shrink cause content sizes inside
This is how it looks with the fix
You see, I needto scroll to find it
Same device screen size
Ok but it can't shrink past its children
that is why we use min-height we don't want it too.
So yeah, I made my content for minimal size of for example w:375px and dunno, h:600px. What I want for it to auto resize and follow screen while having the same form
You have kinda a visual miss nomer going on cause you translate the div up
Yeah it does not need to, it need to expands
don't set strict heights !!!!
I did not set height at all. xD
that is what is bothering me
ok ok read what I said though does that make sense?
I have not a single height set xDF
You have kinda a visual miss nomer going on cause you translate the div up
this one?
right but your content is full
Yeah ok
I understant that
so that blank space there... is not blank you translated the div up
it still lives there physically
Yeah yeah I do understand that, but footer does not follow. xD
I'm not bothered by form staying up ther
I'm bothered by footer staying either in the middle
of the screen
or going to the bottom and having scroll bar apear
missing the point
That is the space .first step takes up
Wait so translate is doing it?
kinda yes and no
I'm trying to show you visually that element looks higher up cause you translated it. It DOES NOT LIVE THERE
translated elements keep their original place in the dom
that screenshot shows its real space
It f-in is doing it. xD
I removed it now and it works
Yup so maybe you just remove it for mobile š¤·āāļø
if it suites the design
How do I move the div up there then?
you translate it
That is how the project looks
and keep the responsivness
CSS amr?
But it will not stay responsive right?
What that? xD
I always thought it just moves the div above that amount of pixels. And it will follow every resize.
Like position absolute or something
You will need to probably pull that field set or the footer from the flow and absolute/fix it.
š¦
All this because of that fancy look
Gotta dive into my own issues this morning. If I think of how I would do this I'll let ya konw
It's ok! Thanks for the help!
I'm glad we narrowed it down.
Also though if it looks good on 360/740 (which this does) I would not sweat it to hard
But I thought every app needs to look good from min-max sizes
I do normally go down to 320/620 or what ever iPhone SE size is but I don't really care that much
360/740 is the most popular small screen size
Yeah, yeah. Project says 375px so I will not go below
na screw FEM and their 375... make sure it fits 360/740 at least
But it falls apart on higher sizes if I do not pull footer out. and remove translate. xD will tweek it out and see what I can do
it should always stick to bottom if you did what I showed
This is why codpens are best I could just save my work and share it with you
It does! but then footer is out of form. xD And now I need to redesign it all .xD
cause I got it working with footer/buttons in the form rather easy too you just grid main/form and brrrr
GRID ALL THE THINGS š (gotta runn bbl
Roger!
Do your own thing, I'm just glad I made it to work somehow. I'll try fixing it after I'm done with the whole project. Can't waste time and get frustarted with something like that. xD
@b1mind Quickie, If I set display none to one of form pages, all the data that was entered will be lost? Or no?
I want to display:none; when clicking the next button, but don't know if it will work.
display: none; would remove it from the dom, I would "assume" that you would lose formData values from the form this way? honestly though I have no clue TRY! lol
If you want to keep something in the dom,
visibility or opacity
is what you need. but not sure which would be best in your case. Maybe none if it works.I think that as well. Will try it. With visibility:hidden; i need to somehow stack them one on other or something like that to not take space, and it requires brain power, I'm just being lazy here with easiest solution. xD
Actually.... wouldn't that solve your other issue too
cause you now need to stack all those either pulling from the flow with something like absolute. xD (I really need a minimal example to play with, if you can put this in a codepen)
@b1mind I actually don't know. xD My smol brain has short 100% capacity, so it gets overheated quickly and I have no clue right now how to change code so it fixes both things. xD I will push just to finish project to get that dopamine rush, then I will patch the holes later. xD
Also, @b1mind
I wrote this simple code to scroll through pages, but when I click next step it jitters for a briefe second, showing second step, then returns to the first. Is it something to do with the form, or something else?
It like refreshes the page
Ohhh type button does it
I'm getting too comfortable here, asking questions instead of googling them. xD
All good
yea if you don't have a button type it will default as a submit inside <form>
if it does not have one specified too? also I'm smol brain so feelsRealMan hah