Тёмный

Easy sticky footer - stop a footer from floating up a short page! 

Kevin Powell
Подписаться 943 тыс.
Просмотров 183 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 297   
@Omar_Thinks
@Omar_Thinks 3 года назад
I have wasted one day of life trying to do this on my own, and I wasn't successful at it. You did it in 5 minutes. Thank you bro. Great video
@waasnoode986
@waasnoode986 5 лет назад
Lol I needed this literally yesterday 😂 Edit : I still watched and thank you lol
@KevinPowell
@KevinPowell 5 лет назад
Haha, sorry that it was one day late, lol.
@deannagilmore8822
@deannagilmore8822 4 года назад
If you ONLY KNEW how many friggin' hours I've spent searching for help on this exact same thing.... Dear God. My eye holes hurt!!! I told my husband I was ready to throw myself off a bridge!! Thank you SO much. I'm keeping up with you.
@KevinPowell
@KevinPowell 4 года назад
Glad I could help before you made it to the bridge :D
@deannagilmore8822
@deannagilmore8822 4 года назад
@@KevinPowell well, I fixed one thing, and it jacked up another. I'm so confused :( I wish I were more fluent. I quit my job to go back to school and I'll be 50 in December. I feel like my patience is diminishing. I thought I fixed the footer. It left a space in my header 😫 can you see this? www.sitesbydesign.altervista.com/cleo
@deannagilmore8822
@deannagilmore8822 4 года назад
The bridge is down the street... 🤣😫🤪 I know it's something dumb.
@deannagilmore8822
@deannagilmore8822 4 года назад
And I took all the stuff out to get the space out, but I'm left with the original problem.
@robby_rice
@robby_rice 3 года назад
It was really that simple, huh... I seriously spent DAYS trying to figure out some complicated solution LOL thank you so much! I'm new to the web dev world and am taking a crack at making my own blog
@kiliusz
@kiliusz 5 лет назад
Good video. I wish saw it before my struggling :P
@SYPCWAK
@SYPCWAK 4 года назад
I know exactly how you feel!!
@codingworld348
@codingworld348 4 года назад
Very true this guy solves all my CSS and HTML problems
@ajtube6716
@ajtube6716 2 года назад
same here😑
@codingcrush
@codingcrush Год назад
Same here
@goodshiro10
@goodshiro10 Год назад
RU-vid recommends after we face that problem
@lisarogers5873
@lisarogers5873 Год назад
OMG finally. I could not figure out why I would copy and paste the code from my other pages that had the background color go all the way to the bottom but that one shorter page had a white banner on the bottom no matter what I did. I was going out of my mind. Thank you for this fix!
@ReinaldoTrindade
@ReinaldoTrindade 5 лет назад
This channel is a gem!
@felipezampa6537
@felipezampa6537 Год назад
I've spent hours trying to fix it using every method possible and none of the worked, but you manage to make my problem solved with basically 4 lines of CSS, thank you very much!!
@379rale
@379rale 2 года назад
When working with WordPress, there will be some invisible elements in the tag. A grid would give each element a row, but flexbox will not. So, it's better to use display: flex
@jon2394
@jon2394 2 года назад
I spent way too much time trying to figure this out. Gave up on the last project trying to achieve this, there are so many "solutions" out there and none of them work. But this one worked flawlessly. Thanks!
@navirosas5968
@navirosas5968 5 лет назад
Thank you for taking your time to teaching us Kevin 🙇🏻‍♂️
@andyboltondigital
@andyboltondigital 5 лет назад
Great video Kevin, keep up the great work. My method is to: 1. set body min-height to 100vh 2. set footer wrapper to position sticky and top to 100% I will need to test this more on mobile to see if the issue you mentioned exists and tweak it accordingly.
@KevinPowell
@KevinPowell 5 лет назад
In that case, wouldn't the footer be slightly off the page on a short page?
@andyboltondigital
@andyboltondigital 5 лет назад
@@KevinPowell it seems to be working ok for me :) just mocked up a quick demo for you jsfiddle.net/rezurrection/kse6d3um/9/
@TheDesignCreative
@TheDesignCreative 5 лет назад
This works well on desktop but not so much on mobile.
@iceeblister
@iceeblister 4 года назад
Really like your example. mind if I use it too?
@fnamelname3209
@fnamelname3209 2 года назад
If you're using bootstrap this doesn't work currently, but you can do it with bs classes: ..
@simonnganga1740
@simonnganga1740 7 месяцев назад
Bro you are god sent ,spent whole day trying to figure out 😢😢....but finally you came through 😢😂😂
@stiguybob793
@stiguybob793 2 года назад
Thank you so much Kevin, you are the man!!!! I am currently doing your Responsive Website Layout on Scrimba and couldn't figure out how to get the footer to stick to the bottom. Tried for about half and hour just to get that thing down there. There were so many complicated "fixes" to this I tried but none really worked. But your solution worked like a charm!!!! You are very inspiring and I hope to be half as good as you one day.
@gabiold
@gabiold 4 года назад
Instead of margin: auto (maybe you want specific margin-top on the footer in case of longer pages), you could use justify-self: flex-end on the footer, and flex-grow: 1 on the main content (above the footer, to fill up the space, otherwise flex-end won't work). And probably justify-items: flex-start on the body so the content will not be centered vertically, if it is short.
@SeviersKain
@SeviersKain Год назад
or you can do this too: body { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; } But overall, the Grid-methodology is still the best, because the footer is one hell of a very large sections of a page, it's the best to use Grid to put it in its region where it was supposed to be, the Grid is like having all its component situated already in their own region by using the grid lines. That's what I've tested...
@OrincyWhyteDesigns
@OrincyWhyteDesigns 2 года назад
You truly are THE CSS MESSIAH. The flex was such a incredible solution, why did I not think of it ?!?
@jani_KA
@jani_KA 2 года назад
OMG Thanks so much! I searched for like 2 hours till I found this awesome video. This is the only Video I found that really functions. ❤️
@Brendan2Alexander
@Brendan2Alexander 4 года назад
Excellent video. FYI - if you are using Angular, you apply everything explained here, not to the body, but rather to app-root (or whatever your root component is)
@raba650
@raba650 Месяц назад
Or if you use Next.js, its the nested div insitde body with "#__next". Or create a layout wrapper for the header, main, & footer & wrap that whole thing in a div & style that div in you don't want to style the "#__next" div.
@EverettCDavis
@EverettCDavis Год назад
I remember struggling to get sticky footers to work back in 2012-ish, and it's really amazing how much easier it is now! Even four years ago when this video came out!
@i_am_hugeng4120
@i_am_hugeng4120 3 года назад
Thx, your short tutorial had saved my life, it was killing me always, when faced short content web pages... 🙏
@chuksjr.1440
@chuksjr.1440 5 лет назад
Your expression of a stubborn footer at the beginning of the video is so accurate...
@MrGhostSniper95
@MrGhostSniper95 2 года назад
Many thanks!!! You save me, is very simple but, I was suffering for 3 days trying to fix this.
@traustitj
@traustitj 2 года назад
at 2:19 you solved my issue. Thank you so much. The rest of the video is also awesome
@TheDesignCreative
@TheDesignCreative 5 лет назад
Every video is like a gift that keeps on giving . I learn something new.... Love your channel.
@TinyMaths
@TinyMaths Год назад
I'm just building my first 'local' website to feature all the apps I've been working on, and ALL of my pages have this issue. Thanks for the fix.
@envadd.6556
@envadd.6556 Год назад
The King of CSS! Thank you Kevin!
@DamienPeden
@DamienPeden 5 лет назад
Some really good notes here! One thing I'd suggest which is what I do with mine (assuming header/main/footer, but can be adjusted) is on the body tag I simply put body{display: grid; min-height: 100vh; grid-template-rows: auto 1fr auto;} and that does the trick just fine with only 3 lines of code. 😀
@KevinPowell
@KevinPowell 5 лет назад
That would work, as long as you go "nav, content, footer" and stick with it :)
@KevinPowell
@KevinPowell 5 лет назад
That would work, as long as you go "nav, content, footer" and stick with it :)
@DamienPeden
@DamienPeden 5 лет назад
You can change the layout simply by updating the grid-template-rows value or using grid-template-areas as well. I always design with header main footer anyway and any content can be placed in the main tags
@coronateststation241
@coronateststation241 Год назад
you saved my life with this
@RodrigoDAgostino
@RodrigoDAgostino 5 лет назад
This showed up right when I needed it! :D Thanks a lot, Kevin! Love your humble and friendly style, mate
@saitejavemula1570
@saitejavemula1570 5 лет назад
The best thumbnail ever 😂. Love your videos. They are very beginner friendly and informative.
@TraceyReynolds-he5tt
@TraceyReynolds-he5tt 10 месяцев назад
Thank you so much! Spent hours trying to figure out why my footer was stuck in the middle of my short page.
@ChristSadi
@ChristSadi 2 года назад
You are my hero!! It took me hours and hours to try to sort this out! thank you
@alvinyanson
@alvinyanson 2 года назад
your thumbnail is very relatable 😂. Thank you so much for this.
@igorr4682
@igorr4682 5 лет назад
As always, clear helpful and well explained video.
@mohaumaboe781
@mohaumaboe781 Год назад
You're the best, Kevin.
@Kam1kaze3
@Kam1kaze3 3 года назад
Than you so much sir, i really needed that 7 min video straight to the point !!!!
@djredtail
@djredtail 2 года назад
wow I was searching for this fix so long. You finally helped solve it. Main thing I learned here is the body needs to have a min 100vh. Thanks!!
@ylanasari3323
@ylanasari3323 10 дней назад
Inilah definisi jenius sesungguhnya!!!! Aku udah buang² waktu berhari-hari dan jawabannya ada di sini cuma 5 menit:)
@bloopspak
@bloopspak 4 года назад
You don't know for how long I've been looking for this
@southgecko3653
@southgecko3653 5 лет назад
Loving all of your videos and energy. Thank you for being a fantastic teacher
@fxchaudhry
@fxchaudhry 4 года назад
Thank you! came here after 2 hours try and your way solved it. Thank you
@tevinmorake8924
@tevinmorake8924 2 года назад
Ok that was too cool Kevin, Thanks for the flexbox idea.
@schneidersitz
@schneidersitz 2 года назад
Simple solution indeed! The thumbnail to this gives me so much laughter; Thank You
@axelschutze4103
@axelschutze4103 Год назад
Thank you so much!!! This was the exact information I needed right now. Did really stuck for quite some time. Cheers
@digigoliath
@digigoliath 4 года назад
This is very useful. It is also a solution that I was looking for. Thanks Kevin!
@silvrsurfer
@silvrsurfer 11 месяцев назад
I love the creative thumbnail, great video! :)
@AyushKumar-yk9fw
@AyushKumar-yk9fw 4 года назад
I DON'T UNDERSTAND WHY IS CSS SUCH AN HEADACHE FOR ME!! 0H GOD!!
@AyushKumar-yk9fw
@AyushKumar-yk9fw 4 года назад
This video helped me a lot!
@ashutosh0299
@ashutosh0299 4 года назад
I struggled tooooo much......but after your solution.....i am feeling so good... Thanks alot Sir...
@KevinPowell
@KevinPowell 4 года назад
Glad to hear that!
@Samarth-ye7bw
@Samarth-ye7bw 3 года назад
Thanks a lot sir , It solved my problem with no issues. I went through a bunch of sites but none of them were helpful , If It wasn't for you , my footer would've been a mess 😅😅😅 Thanks again 👍👍👍...
@azizrahaman1605
@azizrahaman1605 2 года назад
Thanks for sharing amazing thing! keep up the good work
@suzu6165
@suzu6165 3 года назад
my first time watching a css video and finished at by first watching loool ty so much!
@nurhamsah_tech
@nurhamsah_tech Год назад
to be honest, I really hate CSS 😒, I'd rather do javascript than CSS. but after I saw this video, I am no longer afraid of CSS 😂😂 your explanation is very easy for me to understand. great vide sir 👍 thanks 😊
@ThriftWarz
@ThriftWarz Год назад
thank YOU! was struggling with this
@Hasan-ed1fz
@Hasan-ed1fz 3 года назад
Very helpful video came across by chance. I just created footer in React and was having this problem. It really helpmed to solve this :)). Thank you!
@omgharajuku
@omgharajuku 2 года назад
I just wanna say I appreciate you :)
@RaddyDev
@RaddyDev 5 лет назад
Haha the thumbnail is awesome
@KevinPowell
@KevinPowell 5 лет назад
Thanks :)
@ozalisk
@ozalisk 4 года назад
Dear Kevin, thank You so much! Brilliant explanation!
@fabr0
@fabr0 Год назад
great video kev! i was struggling a lot to do this, mostly because my searches lead to users posting about fixing the footer, which is not easy on the eye. only problem i had was when content or cards had to load, it ends up as in 0:56
@Peter-ur8nv
@Peter-ur8nv 5 лет назад
Kevin your videos are great and very helpful. Thank you for these kind of content. Keep it up !
@Bhoi_17
@Bhoi_17 3 года назад
Thank you for saving my life 🥰
@mainamwangi4558
@mainamwangi4558 Год назад
Thank you. It was really helpful.
@kalyansantra3891
@kalyansantra3891 5 лет назад
very helpful video and New things I learn that's helpful for me
@inzi27
@inzi27 3 года назад
bumped into this issue today and tadaa here's the solution
@shayama
@shayama 4 года назад
Omg finally good vid about that! So good that you explained about height 100% extra. Thank you.
@bibhkoutsopoulou879
@bibhkoutsopoulou879 4 года назад
Very good video with a good explanation!! I wish i had found your video sooner!! Thank you!! You realy saved me!!!
@hangtran4863
@hangtran4863 4 года назад
the p*10>lorem snippet is cool haha thanks
@josephgarza5973
@josephgarza5973 2 года назад
Nicely done, Kevin! Thanks for your continued effort. We should hang out in your discord server sometime....
@paraklesis2253
@paraklesis2253 2 года назад
Excellent tutorial, as always!!
@ijohntogun
@ijohntogun 2 года назад
Thank you so much this was so helpful
@xga3
@xga3 5 лет назад
Just what I was looking for! Thank you for sharing.
@ederlima8823
@ederlima8823 9 месяцев назад
Wow thanks a lot!! i have this issue on mobile screen and you save me, thank U!!
@NJAMIBHAVANA
@NJAMIBHAVANA 4 года назад
Thank you so mucuh !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! LOve from India !
@ramonplaza21
@ramonplaza21 5 лет назад
Awesome video! Thank you! I think this will work too, You can set the body min-height to 100vh then subtract the height of the footer body { min-height: calc (100vh - 80px);} 80px is the height of the footer
@KevinPowell
@KevinPowell 5 лет назад
That would work too! but I don't like setting heights on things though. What if you need to change the height of the footer later (extra line of content maybe)? Then you also need to go and change the height in your calc().
@rj.4840
@rj.4840 3 года назад
exactly what i was looking for, thank you!!
@miracleugwu5603
@miracleugwu5603 3 года назад
Very helpful video and thank you so much.
@tbm5k
@tbm5k 5 лет назад
Just what i was looking for 😁
@rafa6536
@rafa6536 Год назад
with grid it is one line of code + on body 100dvh not 100vh, and grid: 1fr auto / auto = 1fr for body container row and auto for footer row / auto column width
@tahsinalmahi8769
@tahsinalmahi8769 5 лет назад
Your tutorials are awesome!
@fli3ker
@fli3ker 2 года назад
thumbnail is awesome🤣🤣🤣
@codefoxx
@codefoxx 2 года назад
SUUUPERB! (Mortal Kombat voice)
@Eww...NotTheHumansAgain
@Eww...NotTheHumansAgain 3 года назад
Thank you very much!
@AmodeusR
@AmodeusR 3 года назад
Other two methods I just figured out trying was a not so good method I would say, through giving position absolute to the footer and "bottom: 0;". Another way is giving the body the 100vh height or the alternatives the video gave and justify-content: space-between.
@TorIvanBoine
@TorIvanBoine 4 года назад
nope. this solution doesn't work either :( I think my css is sick. Nothing I do will get the footer to stick :(
@mamory3791
@mamory3791 4 года назад
Me too!
@kuldeepadhikari3849
@kuldeepadhikari3849 3 года назад
This destroyed my many hours but now is ee your video so thanks for it
@Jarlovinss
@Jarlovinss 3 года назад
i think i worked OMFG i love you so much man
@silassena9306
@silassena9306 Год назад
Thank you!
@AlThePal78
@AlThePal78 Год назад
I am going to make a video and use this thank you so much : )
@nylivehc9008
@nylivehc9008 5 лет назад
A big big thanks. but... I'm taking your first solution and it's not working in ie 11. How can I make this work in ie 11?
@nylivehc9008
@nylivehc9008 5 лет назад
ok. ok. no need i found answer. I set html { display: flex; } too.
@dembashow
@dembashow 2 года назад
great work
@devsuper5972
@devsuper5972 4 года назад
Nicely done !
@keshan-spec
@keshan-spec 5 лет назад
love your vids sir and great explanations.
@Anteater23
@Anteater23 5 месяцев назад
Thanks this helped my problem :)
@hg_ofthecity_old_thi
@hg_ofthecity_old_thi 3 года назад
Wow thanks Kevin! I thought there is no other solution beside putting more content to fill the space
@tonimaunde
@tonimaunde 3 года назад
For JS framework devs: remember to add set these attributes to the #app element...
@rika7098
@rika7098 5 лет назад
THANKS KEVIN .
@CheckTesting1
@CheckTesting1 2 года назад
🤔 “…interesting.” 😉 👍🏾 not an individual with many words. Nice vid. 😄
@SYPCWAK
@SYPCWAK 4 года назад
Thanks for the video!!
@turtlestrength3229
@turtlestrength3229 4 месяца назад
Wait, why does margin-top: auto work in the flex example? I don't get it.
@SmileyJack.
@SmileyJack. 3 месяца назад
05:50 "if you know another way" An obvious 200 IQ way Or you can let your cat to sit on a keyboard. Then change the masterpiece text' color to background color.
@dawnagudo1589
@dawnagudo1589 9 дней назад
hello sir can you do a content separate the footer to body because the width of body follows the footer
Далее
5 simple tips to making responsive layouts the easy way
15:54
Sticky Footer in React (Best Solution)
7:16
Просмотров 20 тыс.
min(), max(), and clamp() are CSS magic!
18:12
Просмотров 297 тыс.
5 CSS mistakes that I see way too often
19:03
Просмотров 360 тыс.
Sticky Footer in CSS (Best Solution)
8:08
Просмотров 6 тыс.
Are you writing responsive CSS the wrong way?
14:15
Просмотров 416 тыс.
Are you using the right CSS units?
6:30
Просмотров 456 тыс.
How to make shapes with CSS
18:35
Просмотров 350 тыс.
No, Flexbox isn't "good enough"
9:18
Просмотров 41 тыс.