The Modern Way To Push That Footer Down - JUST 3 Lines Of CSS

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024
  • НаукаНаука

Комментарии • 173

  • @mikeploythai
    @mikeploythai 4 месяца назад +94

    good fix! i personally use flex flex-col and min-h-screen on the parent, and apply flex-1 to the main child to let it expand. effectively the same thing though lol

    • @dipesh722
      @dipesh722 4 месяца назад +1

      I use justify-between, so it pushes the footer at bottom. is it correct 😅

    • @frontendfyi
      @frontendfyi  4 месяца назад +19

      Yes very similar indeed! Only “downside” is that you need to add styles to children too instead of only the parent. Makes it that this logic is split over multiple elements. But yeah, nothing wrong with it and very similar approach 😁

    • @liu-river
      @liu-river 4 месяца назад

      @@frontendfyi I agree. I have been using flex also before I watched this and I think this is a better solution since the parent controls everything and it is much clearer. Imagine your child component gets imported than the style will have to be in another file.

    • @DavetheRave52
      @DavetheRave52 4 месяца назад +1

      I prefer the grid method because the control is central. For personal projects I always go with it.
      Grid can require more maintenance though. For example a site with third party widgets that you can't control injection points for - the main el might not always be the second row. I've found the flex method to require less maintenance in these cases

    • @devfren
      @devfren 4 месяца назад

      +1 this

  • @hclyrics
    @hclyrics 3 месяца назад +16

    Please write Tailwind in the video title instead of CSS.

    • @kadeempratt4633
      @kadeempratt4633 Месяц назад

      yeah, would be actually helpful kinda misleading to say css, when its tailwind

  • @_whatistruth
    @_whatistruth 4 месяца назад +5

    it can be done with flex, such as using display:flex;flex-direction:column; and then applying flex: 0 0 auto to header and footer. and applying flex:auto; to main.

    • @adeemmmm
      @adeemmmm 3 месяца назад

      I would do flex grow to main

    • @hoxtygen
      @hoxtygen 3 месяца назад

      Worth noting that you still have to set min-height to 100dvh for this to work.

  • @MacGamper
    @MacGamper 4 месяца назад +67

    Why not use plain HTML/CSS to explain HTML /CSS?

    • @frontendfyi
      @frontendfyi  4 месяца назад +16

      It’s a thing I’m constantly struggling with. I see upsides and downsides to both and I haven’t made a final decision yet. Did a poll on the channel recently and the majority voted for tailwind. Love to hear opinions though, so feel free to share more of your thoughts!
      This is also why I tried to show the css equivalent for every step.

    • @robertholtz
      @robertholtz 4 месяца назад +16

      @@frontendfyiIt’s more like 3 lines of Tailwind markup than 3 lines of CSS.

    • @justinmiller3349
      @justinmiller3349 4 месяца назад +10

      ​@frontendfyi I think vanilla css makes it easier to understand the underlying concept. Those that want to use a library will still be able to apply it. As someone who's used bootstrap and tailwind in the past I think vanilla css is getting better and better over time to the point where I'm not sure I'd choose a library for a new project unless I just wanted some decent default styling to start with

    • @MC_DarkMaster
      @MC_DarkMaster 4 месяца назад +10

      If you understand HTML/CSS then you can adopt it to the framework you like. If you explain it in Tailwind I skip that video because I don't use that framework and don't want to find out what the things are actually doing or how it is working.

    • @topnatop
      @topnatop 3 месяца назад

      It’s about the concept that anyone who understands CSS can grasp this clip without needing to know Tailwind at all. However, some viewers start complaining as soon as they see the word "Tailwind." Maybe using pure CSS might be better.

  • @AlexMarcoDAngelo
    @AlexMarcoDAngelo 4 месяца назад +1

    Great fix! I fixed mine by using this code in that wrapper div:
    I am gonna test to see if the two options behave the same way. Oh and of course header is 'fixed' and footer is 'sticky' in my case :)

    • @frontendfyi
      @frontendfyi  4 месяца назад

      The result will be fairly similar! Main benefit to grid as soon as you have more than 2 elements is that you only need to set styles (grid rows) on the parent element rather than multiple elements. But that’s literally the only “benefit” I can think of 😁

  • @blackneocs
    @blackneocs 4 месяца назад +4

    You also can apply flex and flex col to the parent and margin top auto (mt-auto) on the child footer. So it will push it to the bottom.

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      This is true!

    • @danielwilkowski5899
      @danielwilkowski5899 4 месяца назад

      @@frontendfyi So I guess 100vh and grid template columns isn't the ONLY option like the title says. Perhaps you should change the title?

    • @frontendfyi
      @frontendfyi  4 месяца назад

      @danielwilkowski5899 I get what you’re saying. With “only” in this case I mean: the only way I think you should do it. But that would make the title way too long.

    • @danielwilkowski5899
      @danielwilkowski5899 4 месяца назад

      @@frontendfyi current title is clickbait

    • @frontendfyi
      @frontendfyi  4 месяца назад

      @danielwilkowski5899 okay

  • @stahlmandesign
    @stahlmandesign 4 месяца назад

    Very useful, and well explained with the grid fragment expanding. Sticky header with top is a bonus. I put -top-24 to only hide a portion of my header when scrolling

  • @requenz_
    @requenz_ Месяц назад

    Nice video! Exactly what I was looking for.
    What is the name of the VS code theme and the font that you are using?

  • @tejasshekar
    @tejasshekar 4 месяца назад +5

    Me trying to find solution for a similar problem. Opened RUclips first. Got this suggested. Hmm. Not even searched the issue anywhere yet. Looks like phone has moved on from listening to mind reading

    • @frontendfyi
      @frontendfyi  4 месяца назад +2

      Hahaha this is great! Hope the video was indeed useful to you!

    • @mykolatheprogramer
      @mykolatheprogramer 4 месяца назад

      The same situation😅

  • @chrisicotec7652
    @chrisicotec7652 3 месяца назад

    i thought i would get a solution to something that really irritates when creating blank layouts for clients.... but it tailwind so im still gonna have to persevere with what im trying to do... i never use frameworks unless a client specifically wants it, but you got yourself a new follower anyway

    • @frontendfyi
      @frontendfyi  3 месяца назад

      I tried to show the css equivalents too - that wasn’t helpful for you either?
      Since, I’ve switched to make new videos with vanilla css by the way. Thanks for commenting!

  • @fusedqyou
    @fusedqyou 4 месяца назад

    Nice tutorial. I personally prefer having a main contain with `min-h-dvh` and using flex to grow the main content container and take priority in height. This way the footer is aligned to the bottom, and any extra height required by the main content is properly accounted for. Has always worked like a charm.

  • @ste-fa-no
    @ste-fa-no 4 месяца назад +1

    That's my chosen approach 👍 although I try and use body directly. If there's injected code, even if I wrap things, they would break the design, and maybe the footer won't be the last item at the bottom anyway.

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      Yeah nothing wrong with using the body indeed! Just need to be aware that things can be injected in the body indeed.

  • @LePhenixGD
    @LePhenixGD 3 месяца назад

    I prefer this solution conpared to other ones, it's simple and really understandable!

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      Nice, glad you like it!

  • @bobhamilton6760
    @bobhamilton6760 4 месяца назад +1

    Love this... Clean, intuitive, localized. Nice work!

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Thank you! Glad you enjoyed it!

  • @siya.abc123
    @siya.abc123 4 месяца назад

    Thank you so much! You have no idea the messy workaround I used 😅. The frontend will never be my friend but as I look for independence I need to learn catch-up. Tailwind is great help

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Glad it was helpful for you!

  • @Inumaru3
    @Inumaru3 4 месяца назад +2

    A better alternative to what I am used to, using flex instead of grid

  • @alexpanteli3651
    @alexpanteli3651 4 месяца назад +4

    Your videos are best by far. Please post more of a cool CSS, Js stuff. Greetings from Cyprus!

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Thank you so much! Glad you like the videos, an appreciate you commenting ❤️

  • @emreaydn-gc1om
    @emreaydn-gc1om 3 месяца назад

    cool video! can you tell me what font and theme are you using on vscode?

  • @tonydrake462
    @tonydrake462 4 месяца назад

    OK - I'm a 40 year dev, who has finally embraced the front end by building an angular SPA (live with customers for 4 years without me knowing any of the CSS magic that make it look cool other than copy/paste examples) - so now I'm forcing myself to finally embrace CSS - and loving it...(I don't know what I was so frightneded!!) - I worked with WPF like 20 years ago, so many of the same concepts, but your tips just knock me into another zone.. thanks.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      This is so great to hear! Happy that I’m able to help you so much! Thank you so much for sharing this with me.
      Since you’re just starting out with CSS, I’d like to ask you something I’m doubting a bit about for a while now: Do you think it’s confusing that I’m mainly explaining CSS through Tailwind, even though I try to show the css equivalent and what Tailwind rendered in the end? Do you think the videos would be easier to follow or even more useful to you if I wrote plain css?
      Thanks!

  • @djryanashton
    @djryanashton 4 месяца назад

    With open source, as a developer, I can also look into the code and see exactly what is happening, exactly how my personal data is being used. It is being saved to a secure database? Is it being distributed to third party advertisers? I think this is the primary reason people love open source.

  • @treyjapan
    @treyjapan 4 месяца назад +1

    Works like charm. Thank you, Jeroen!

  • @rayhanislam7518
    @rayhanislam7518 4 месяца назад

    another fix is wrapper div "flex flex-col w-full min-h-dvh" and the middle section just add "flex-1 flex-grow"

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Yes this definitely works too! Only reason I prefer grid is so I only have to set styles on a single element rather than on the children too. But yeah, that’s literally the only difference I think 😁

  • @chmod4000
    @chmod4000 4 месяца назад

    have the parent flex and give the footer a margin-top: auto.. Thats all you need. Also, tailwind has min-h-dvh included since a couple of versions now, just so you know!

  • @MohamedRabi
    @MohamedRabi 2 месяца назад

    Great fix! thank you 👍

  • @al3vs
    @al3vs 3 месяца назад

    Nice video!! What is the font you use?

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      Thank you!
      The font is called Recursive Mono Casual Static

    • @al3vs
      @al3vs 3 месяца назад

      @@frontendfyi If it's not too much to ask, what vscode theme do you use? I really like your configuration.

  • @manojpudasaini1565
    @manojpudasaini1565 4 месяца назад

    Absolutely the thing that I have been dealing with why h-full is not working for inner pages inside the layout for my project in Nextjs. Than you 👏🏻🙏🏻
    Also, can you share your vscode theme and font name, it looks awesome and cool 😎🎉

    • @liu-river
      @liu-river 3 месяца назад +1

      Yes, this solved the problem. With flex-1 on the parent, the children does not know what the height is.

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      It's called Arc, from the Bearded Theme collection: github.com/BeardedBear/bearded-theme
      The font is called Recursive Mono Casual Static

  • @sourabhhaldar5091
    @sourabhhaldar5091 4 месяца назад +3

    hey. can you tell what font family are you using in your vscode

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      The font is called Recursive Mono Casual Static

    • @sourabhhaldar5091
      @sourabhhaldar5091 3 месяца назад

      @@frontendfyi thank you

  • @RahulShrivastava31
    @RahulShrivastava31 4 месяца назад

    Can you share your VS Code Settings? Or at least help with the theme and font name? Really liked your setup and thanks for making these videos

  • @didemkucukkaraaslan7373
    @didemkucukkaraaslan7373 2 месяца назад

    Amazing tip as always!

    • @frontendfyi
      @frontendfyi  2 месяца назад +1

      Thank you Didem! Nice to see you in the comments again 😁

    • @didemkucukkaraaslan7373
      @didemkucukkaraaslan7373 2 месяца назад

      @@frontendfyi :D finally I have time for improvement of my skills

  • @thedelanyo
    @thedelanyo 4 месяца назад +9

    I stopped watching the video because "in just 3 lines of CSS" turns to be so many inline of Tailwind

    • @frontendfyi
      @frontendfyi  4 месяца назад +2

      Or you just skip to the summary chapter and see that it's indeed just 3 lines you have to add 😉

    • @MutantNinjaDonut
      @MutantNinjaDonut 3 месяца назад

      🥱

    • @tictac1020
      @tictac1020 3 месяца назад

      I also hate Tailwind but since Tailwind is just a means of applying CSS, you can still grok the actual CSS rules to apply. Also, he mentions what the actual rules are at the end. Display grid, min height 100dvh, grid template rows auto 1fr auto.

  • @DeepTitanic
    @DeepTitanic 4 месяца назад +2

    I nearly subscribed but then I realised you're using TailWind

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Highly debating whether I want to stick with that though. I’m aware that it’s an abstraction layer that some people don’t like, and even to quite some can be confusing. Thanks for your honesty.

  • @풍월상신
    @풍월상신 4 месяца назад

    Thank you. That was my pain in the ass for decade!!

    • @frontendfyi
      @frontendfyi  4 месяца назад

      It is right!! Glad you got the solution now 😁

  • @ajimbong1623
    @ajimbong1623 4 месяца назад

    Thanks for the great great video, I'm looking forward to the tailwind course 🤞

  • @vasyaqwe2087
    @vasyaqwe2087 4 месяца назад

    This is awesome! Will be using that. BTW, latest tailwind has min-h-dvh, svh and lvh classes :)

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      Someone else mentioned it too! Didn’t know that yet. Thanks 😁 Also happy you enjoyed the video!

  • @ilan117
    @ilan117 4 месяца назад

    Very much looking for the framer motion course ❤

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Quite some modules are already released! Did you see that? 😁 www.frontend.fyi/course/framer-motion

  • @biovawan
    @biovawan 4 месяца назад +2

    What about
    #app, script {display: contents}
    ?
    Now the body can be styled as you wish. The less nesting, the less troubles to style

    • @frontendfyi
      @frontendfyi  4 месяца назад

      What would this do to push the footer down? Could you explain it a bit more?

    • @biovawan
      @biovawan 4 месяца назад

      ​@@frontendfyi display contents makes elements themselves disappear while keeping its children in the document flow. This allows the child elements to be displayed as if they were direct children.
      Now you can apply grid rows (auto 1fr auto) to body: nav + main + footer.
      Also maintain the scrollbar of the main and the basic layout is ready

    • @frontendfyi
      @frontendfyi  4 месяца назад

      @biovawan oooh that’s what you mean! Interesting approach yeah. I’m honestly not sure if there would be any downside to it. Plus you gotta make sure you apply it to any element that you want to hide in that case. For example random JavaScript html snippets injected.

    • @RT-.
      @RT-. 3 месяца назад

      display: contents is pretty new and only the latest browser versions have support

  • @balaclava351
    @balaclava351 4 месяца назад +1

    FYI, fr is fraction not fragment

  • @joshua.hintze
    @joshua.hintze 4 месяца назад

    What would you do if your footer needs to always be visible. For example it’s a tab bar at the bottom and the main content needs to scroll?

    • @frontendfyi
      @frontendfyi  4 месяца назад

      If it’s always visible then I think position fixed for the footer makes most sense.

  • @adarshdhital007
    @adarshdhital007 4 месяца назад

    Wow that's so amazing, thankyou sir!

  • @mehmetbagci3447
    @mehmetbagci3447 4 месяца назад

    Finally the guide i need :) thanks

  • @isaidstream4547
    @isaidstream4547 3 месяца назад

    Framework nightmares..

  • @diegognoatto590
    @diegognoatto590 4 месяца назад

    100svh is better in my tests, good grid aproach tho

  • @nan68
    @nan68 4 месяца назад +1

    They have a builtin util for 100dhv already so you can just do min-h-dvh

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Oh!! Didn’t see they added this! Thanks for mentioning 🙏

  • @kamill34
    @kamill34 4 месяца назад +4

    there is a several solution for this, eg flex or calc, but the grid wasn't on my daily solution so is something new - thanks!

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      There’s definitely more solutions to this indeed! Glad you like this one though!

  • @nouridev
    @nouridev 3 месяца назад

    Thank you so much!

    • @frontendfyi
      @frontendfyi  3 месяца назад

      You're welcome! Glad you enjoyed the video!

  • @nazzanuk
    @nazzanuk 4 месяца назад +16

    Just be upfront about Tailwind in the title next time so i can skip the video.

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      I would love to hear though what you don’t like about the few lines of tailwind I add, since I explain every css property you need. I think you will still gain the same knowledge. Would love to hear why you decide to skip. Thanks!

    • @ducanh95
      @ducanh95 3 месяца назад +1

      ​@@frontendfyi i guess because obviously not everyone is using or prefers using tailwind.
      You will reach a far bigger audience when showing and teaching things in plain css

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      I think you’re right. My latest video and the one dropping this week will be fully CSS only. Let me know what you think!

    • @HappyDancerInPink
      @HappyDancerInPink 3 месяца назад +1

      Skill issue - just read the CSS when he hovers on the tailwind

    • @BoogeyMan-fu5yn
      @BoogeyMan-fu5yn 3 месяца назад

      skill issue

  • @KrishT0
    @KrishT0 3 месяца назад +1

    your vs code theme name?

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      It's called Arc, from the Bearded Theme collection: github.com/BeardedBear/bearded-theme
      The font is called Recursive Mono Casual Static

  • @ahmedkhabar
    @ahmedkhabar 4 месяца назад

    I worked with this aproch for a long time, but I face a problem with it, when I have a table and I want to make it overflow-x-scroll in small devices, I got an overflow in X direction for the entire layout, you can try it to understand what I mean.

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      Try adding grid-template-columns: minmax(0, 1fr); too. I think what you’re experiencing is called grid blowout.

    • @ahmedkhabar
      @ahmedkhabar 4 месяца назад

      @@frontendfyi I was so dump, instead of adding a table inside a div with overflow-x-auto, I give overflow-x-auto directly to the table.

    • @liu-river
      @liu-river 3 месяца назад

      @@frontendfyi This is a must if you ever need to do overflow scrolling in any of the children element

  • @FalconiZzare
    @FalconiZzare 3 месяца назад

    This becomes a bit problematic when the header has position: fixed

    • @frontendfyi
      @frontendfyi  3 месяца назад

      This is true! In most cases position sticky will give you the same result though.

    • @FalconiZzare
      @FalconiZzare 3 месяца назад

      @@frontendfyi sticky has some downsides. However, If header is fixed, we can say that it's not really part of the GRID anymore. So [1fr_auto] may help.

  • @lenickramone
    @lenickramone 3 месяца назад

    06:05 does someone know what font is this?

  • @jamesgulland
    @jamesgulland 4 месяца назад

    “mb-auto” is all you need. You’re welcome 😂

    • @frontendfyi
      @frontendfyi  4 месяца назад

      You at least need to add a min-height to your body then. You’re welcome 😉

  • @alexanderkekule7054
    @alexanderkekule7054 23 дня назад

    fyi that's a fraction, not a fragment

  • @lxc3909
    @lxc3909 4 месяца назад +1

    Tailwind is hideous.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      It looks horrible yes, it is so great to work with though. Although I tried 100 times before I finally converted 😂

  • @zeusuofm
    @zeusuofm 4 месяца назад

    What about a header pinned to the top?

    • @frontendfyi
      @frontendfyi  4 месяца назад

      There’s a part at the end where I show exactly this 😁

  • @wolfscoding
    @wolfscoding 3 месяца назад

    Or u could use "mt-auto" so the footer get pushed to the bottom of the page. Would me in 1 line of CSS. But still thanks.

  • @DenizGazitepe
    @DenizGazitepe 4 месяца назад +2

    This video must be a gift of god, because I was trying to find the best way to do this for the last 5 hours! Thank you so much

    • @frontendfyi
      @frontendfyi  4 месяца назад

      I love hearing this! Glad the algorithm decided to show it to you!

  • @jasper2virtual
    @jasper2virtual 4 месяца назад

    Flex col is much simpler and understandable

    • @frontendfyi
      @frontendfyi  3 месяца назад

      Absolutely works too yeah!

  • @rootoxygen5403
    @rootoxygen5403 4 месяца назад

    Good but u made it more complex than dvh 100,,,😂

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      Yes! I didn’t know that it was added, so I learned something new by making this video too. Hahaha

  • @PeterStJ
    @PeterStJ 4 месяца назад

    fr is a 'fraction', not a 'fragment'... 🤦🏻

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Yup.. I misspoke each and every time 😂 my bad.

  • @ahm0xc
    @ahm0xc 4 месяца назад

    what font are you using in vs code ? it looks smooth. I would like to try that too.

    • @frontendfyi
      @frontendfyi  3 месяца назад

      The theme called Arc, from the Bearded Theme collection: github.com/BeardedBear/bearded-theme
      The font is called Recursive Mono Casual Static

  • @Ditellirate
    @Ditellirate 3 месяца назад

    3 lines of code and 7.5 mins video. Gg

    • @frontendfyi
      @frontendfyi  3 месяца назад +1

      Haha. Yeah the difference between wanting the answer and wanting to know the why, right?

  • @chrismcconnell7058
    @chrismcconnell7058 4 месяца назад

    Very good fix 👏🏻 also mind sharing your editor font?

  • @mvargasmoran
    @mvargasmoran 4 месяца назад +2

    Whenever someone pushes the Grid cart, I'm happy to knowing that I'm not alone.

  • @kale_bhai
    @kale_bhai 4 месяца назад +1

    I use Flex and Flex grow because I tend to think that as 1D only, so I don't use Gird System.

    • @NicoHeinrich
      @NicoHeinrich 4 месяца назад

      The main difference is that you can style only the parent with grid. With flex-box you have to style the child as well.

  • @dealerpriest
    @dealerpriest 4 месяца назад +1

    *fraction

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Fraction?

    • @dealerpriest
      @dealerpriest 4 месяца назад +1

      @@frontendfyi the fr css unit is short for fraction. Not fragment. If I'm not mistaken👍

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      @dealerpriest oooh, oops you’re totally right. Haha. Sorry for keep making the same mistake over and over in the video 😂

  • @tommysmith5479
    @tommysmith5479 4 месяца назад

    A big thumbs down from me. People coming to this video didn't expect the added complication of React and Tailwind - there's no mention of those in the title. I'll stick to Kevin Powell - and everyone else should too.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      I love the way people share feedback on the internet 😂 I guess you should try starting your own youtube channel.
      And yes, Kevin makes great content, people should indeed follow him.

    • @tommysmith5479
      @tommysmith5479 4 месяца назад

      @@frontendfyi I don't need to start a YT channel.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      That is correct.

  • @FlaviusCalinTofan
    @FlaviusCalinTofan 4 месяца назад +3

    Misleading TITLE! This IS NOT CSS, it is a framework ( tailwind ) . You don’t mention anywhere you are using tailwind css,
    This is the worst tutorial I ever saw …

    • @frontendfyi
      @frontendfyi  4 месяца назад +1

      Tailwind is CSS my friend. I even show the css properties to make it even clearer. But thanks for your constructive feedback.

  • @WojciechZdziejowski
    @WojciechZdziejowski 4 месяца назад

    Now go to w3c and test this solution. Next look to good practics for SEO.
    Bad advice bro.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Curious to hear how this impacts seo, because I don’t think it does.

  • @cafelutsa_
    @cafelutsa_ 4 месяца назад +1

    bending over backwards just to use grid. horrible approach

    • @frontendfyi
      @frontendfyi  4 месяца назад

      Which solution do you like more - honestly wanna know?
      I really like this the best, didn’t bent over ‘cause that would break my back.

    • @cafelutsa_
      @cafelutsa_ 4 месяца назад

      ​@@frontendfyi displaying the parent of all the content as flex, setting the flex direction to column, and then targeting the footer and setting margin-top to auto. this would scale the best way. changing the layout of the website would be extremely easy this way. think of every time you would want to change something, maybe delete the footer or the header entirely. you would need to change the grid-rows prop (line 5 @5:26) every time the layout changes. this simply does not scale. what if for example the main, for some reason, had some other siblings? you would also need to change the grid-rows prop to match this new markup change. your approach, this approach, is good whenever we're absolutely sure that there are N number of elements inside the root, and that never ever changes. let the layout breathe, display it to flex and let the footer push itself down with margin, just like I said at the beginning. that's the solution I like more.
      no need to be petty and tell me you "didn't bent over because that would break your back". what a stupid joke. "bending over backwards" means to work very hard to accomplish something. I get the video; you showcase one of the many approaches. this one happens to suck.
      I created a pen with the approach I described but I think RUclips deletes comments with links in them ( codepen.io/vladsolomon/pen/ExBjeZy )

    • @frontendfyi
      @frontendfyi  4 месяца назад

      lol. Happy to hear you’re a big fan of your own approach though. Was genuinely interested in your solution and happy to have a discussion about it. Making a stupid joke was just to hopefully make stuff a bit less serious and have that healthy discussion. Apparently that didn’t work. No reason for me then to tell you why my solution definitely has my preference here (there is almost never a “best” in web dev).
      Hoping you have a great weekend and think about how you can have a healthy discussion instead of telling people their approach sucks in the future. Saying stuff like that is too easy on the internet (especially anonymously). It brings you nothing.

    • @cafelutsa_
      @cafelutsa_ 4 месяца назад

      @@frontendfyi I agree that there is no best solution. i agree that even my solution is not for all cases. but yours, using grid, work in only one scenario: when the markup does not change. not even one bit. one change in the markup and you have to rewrite the css rule. that, for me, is stupid. no need to go all teary eyed; you asked, I answered, your joke was not good. timing is extremely important. I think the only one that turns this in an unhealthy discussion is you.
      Hoping you have a great weekend and think about how you can receive actual feedback.
      Also, the bit about anonimity is borderline stupid. Look at the link I sent. It has both my first and last name. You want me to tell you that this approach sucks nominally? ok, no problem, I, Vlad Solomon, think this approach works in only one case. the benefits are marginal, near zero even, because if the markup changes, the css has to change also, just another exercise in reinviting the wheel.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      @cafelutsa_ 👍

  • @davea136
    @davea136 4 месяца назад

    Thank you for your video. Yet more proof that CSS is unforgivable, unworkable garbage. Go read a real GUI API like Quickdraw from 1984. seriusly, the craft was farther advanced in 1984 than anything you can find in a web browser. Frightening.

    • @frontendfyi
      @frontendfyi  4 месяца назад

      It almost sounds like you’ve been bitten once too often with CSS, haha. I can fully imagine that CSS can absolutely feel as that unforgiving language when you try to style something. CSS is definitely not an easy language to learn.
      Your reference to QuickDraw seems to be more in line with for example the Canvas web api. They serve a completely different purpose than what CSS is trying to achieve.