How to vertically align to the middle in CSS

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024
  • Documentation:
    phrogz.net/CSS/...
    howtocenterincs...
    stackoverflow....
    Source code can be found here:
    code-vault.net...
    ===== Support us through our store =====
    code-vault.net...
    ===== Check out our website =====
    code-vault.net
    ===== Check out our Discord server =====
    discord.code-v...

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

  • @fluffyweird
    @fluffyweird Год назад +1

    bruh you really are something else ... thank You G

  • @ianthehunter3532
    @ianthehunter3532 Год назад +2

    But `margin: auto` also vertically aligns like you showed in the very beginning, it even centers horizontally too. The only thing you need to keep inside .container is the `display: flex`.

    • @CodeVault
      @CodeVault  Год назад +3

      Interesting. That's a great find! I didn't know margin: auto had a different behavior in flexboxes. Horizontally, I would still prefer setting its flex attribute and just using text-align: center for inline element alignment.

    • @ianthehunter3532
      @ianthehunter3532 Год назад +1

      ​@@CodeVault Agreed. I didn't know about that either, I actually thought it would work with just `margin: auto`, but that probably only applies for the parent element.

    • @CodeVault
      @CodeVault  Год назад +1

      Yeah, margin: auto usually just sets top and bottom margins to 0. It didn't even cross my mind since it's known for not aligning elements vertically (just horizontally)

  • @justfun8143
    @justfun8143 Год назад

    Topics to cover: text styling and the tags and implementation of javascript in the html (for example: mouse hover on a text)

    • @CodeVault
      @CodeVault  Год назад

      Thanks for the ideas! I will look into them

  • @HasinthaWeragala
    @HasinthaWeragala Год назад

    flexbox is a lifesaver i tell you

  • @swajju
    @swajju Год назад

    Thanks a lot 👍👍 you are great

  • @pradnyeshmate1317
    @pradnyeshmate1317 Год назад

    I want to learn c not this you're a god at C why are you starting this . Anyways thank you soo much for the effort you're putting in

    • @CodeVault
      @CodeVault  Год назад +1

      I'll upload more C related videos soon

    • @pradnyeshmate1317
      @pradnyeshmate1317 Год назад

      @@CodeVault thank you soo much you have helped me out in C and i would love to watch your videos

    • @Quasarsoft
      @Quasarsoft Год назад

      @@CodeVault C with GTK

    • @noweare1
      @noweare1 10 месяцев назад

      Because at some point you will need to know some web technologies. I remember feeling exactly like you now I want to be able to control my esp32 over the internet. Esp32 programmed in c but connectivity means having to learn Html, css and javascript.

  • @Yavuzsultanselim1071
    @Yavuzsultanselim1071 Год назад

    hello dude you do well and you look like macron