Are You Making These CSS Height Mistakes?

Are You Making These CSS Height Mistakes?

Web Dev Simplified

1 год назад

120,415 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@decepi
@decepi - 16.11.2023 05:56

This randomly popped into my feed, and answered every issue I ran into with a very cursed project a while ago. I just wish I watched this sooner, I’d have more hair left 🥲

Ответить
@louaykhammar7268
@louaykhammar7268 - 10.11.2023 20:21

Thanks

Ответить
@BohemianOnTheRoad
@BohemianOnTheRoad - 24.10.2023 15:26

ধন্যবাদ

Ответить
@LorenzoJimenez
@LorenzoJimenez - 27.09.2023 21:58

Works good if you dont want the .card to be the height of the screen. For that, I use min-height: calc(100dhv - 10rem); The rem is the height of the header and footer.

Ответить
@luis96xd
@luis96xd - 06.09.2023 06:37

Great video! I didn't know that dvh existed! :0

Ответить
@TheBenTonks
@TheBenTonks - 02.09.2023 12:37

are you saying "AIDS and CSS are incredibly painful" at the start, because cc thinks you are and now I do

Ответить
@ofskittlez
@ofskittlez - 28.08.2023 13:20

My body certainly takes up too much space. But I've been trying to lose weight!

Ответить
@azewasted5177
@azewasted5177 - 26.08.2023 13:38

Thank you,finaly found

Ответить
@Samed017
@Samed017 - 05.08.2023 16:36

But 100 vh will work

Ответить
@insigniamalignia
@insigniamalignia - 13.07.2023 07:13

shouldn't flex-grow be inside of a child of display:flex? for example, <div style="display:'flex'"><div style="'flexGrow:'1'}></div></div> ? but in the video, it seems flex-grow is in the body tag and therefore is not a child of display:flex.

Ответить
@24fad5ac
@24fad5ac - 13.07.2023 01:14

Turn on subtitles from the start

Ответить
@kira-t
@kira-t - 04.07.2023 00:25

I like your videos, but one thing i get confused about is, your mimic always has this glow in your eyes and this slightly smile on your face that kinda tells : HEY THE WORLD IS AWESOME AND EVERYTHING IS EXCITING. But your voice is monotone perfect to sleep along with and tells something like : lets calmly talk about an interesting topic that i just found in a newspaper.

This contrast is wired, but unique what is good ~

Ответить
@ravimakwana1641
@ravimakwana1641 - 21.06.2023 16:39

Can you make a video about to test responsive using mobile as you shown in this video in detail? thanks.

Ответить
@mateusbraga1960
@mateusbraga1960 - 19.06.2023 16:44

tu é um anjo na terra valeu!!!

Ответить
@appwala3728
@appwala3728 - 28.05.2023 08:56

Thank you i solve a problem of vh height with this video ❤️❤️

Ответить
@keaton718
@keaton718 - 21.05.2023 16:11

I like height vh, it's very adaptable for some things. It needs a max height to stop it from being too big, and it causes weirdness if you adjust window height back and forth but the only people who do the are web designers.

Ответить
@WyzrdCat
@WyzrdCat - 21.05.2023 09:52

LMFAOOOOOOO the auto caption interpreted your first line as "AIDS and CSS are incredibly painful to deal with"

Ответить
@k4qdex
@k4qdex - 20.05.2023 04:15

height needs to be removed from css lol

Ответить
@imadev4861
@imadev4861 - 21.04.2023 14:02

I think vh and vw work

Ответить
@aram5642
@aram5642 - 09.04.2023 14:18

Off topic: Web stores differ in how the behave upon navigation back (like: from a product view back to the gallery view which you have scrolled down a lot). Some do restore original scroll position, some don't, some frameworks provide settings on the router to control that, but what are the browser defaults, what can a dev do to effect this behavior? I'd be curious to hear you talk about it.

Ответить
@akeemaweda1716
@akeemaweda1716 - 05.04.2023 10:12

This solves my lingering problem. Thanks Kyle

Ответить
@OneAndOnlyMe
@OneAndOnlyMe - 29.03.2023 00:50

Those CSS cheat sheets are really useful, thanks!

Ответить
@dopetag
@dopetag - 28.03.2023 00:50

This was definitely Web Dev Overcomplicated this time.
html and body to height: 100%; and you are good to go 😉

Ответить
@carit.psicologo
@carit.psicologo - 20.03.2023 13:41

Height: 100vh

Ответить
@mrt5136
@mrt5136 - 20.03.2023 11:13

Hello thx for your awesome work! What about svh & lvh? Currently poorly supported but maybe in the future :D

Ответить
@MB-zj3er
@MB-zj3er - 17.03.2023 20:46

dvh was new to me. Thank you very much for this video! You saved me some JS on page sizing!

Ответить
@ganymede242
@ganymede242 - 16.03.2023 20:03

What height setting did you use for your hair? Looks amazing LOL.

Ответить
@nomad100hd
@nomad100hd - 16.03.2023 04:48

I have nicer guitars. 😝

Ответить
@user-os2sg1nn6e
@user-os2sg1nn6e - 16.03.2023 00:25

👍👍👍

Ответить
@michalnowak2181
@michalnowak2181 - 15.03.2023 13:10

thx

Ответить
@kanakaraju7655
@kanakaraju7655 - 14.03.2023 19:23

Love it 💕

Ответить
@Tin9102
@Tin9102 - 14.03.2023 15:47

I read this cool hack on css tricks where u can use { position: sticky; top: 100vh; } on the footer and it sends the footer to the end always. I think its cool addition to this video.

Ответить
@Drgigolo2022
@Drgigolo2022 - 14.03.2023 04:48

Glad I kept watching I knew and use everything he talked about except dvh, will have to take a look at beacuse RWD can be a pain in the ass with heights and widths sometimes.

Ответить
@orpheusohms
@orpheusohms - 14.03.2023 01:31

Just put height 100% on the <html> and <body> tags... Great tut though...

Ответить
@AviationFreaks
@AviationFreaks - 13.03.2023 13:15

Thank you so much for clarifying these concepts. This really helps!

Ответить
@DamonMedekMusic
@DamonMedekMusic - 13.03.2023 09:41

I wish tailwind offered better height options. I have constant height issues especially with scroll bar chopping the end of my divs off.

Ответить
@rnater7145
@rnater7145 - 13.03.2023 04:17

"Hovering over the top of my body" - I thought you died for a second there :D

Ответить
@idrisAkbarAdyusman
@idrisAkbarAdyusman - 12.03.2023 21:12

Hi Nice video!,
i've been using the flex-grow, but I have a problem, how can we make the body of the card to have a scrollbar when the content exceeds the min-height?
as you showed in the video it will expand the card and in my use case I don't want that. I want it to fill the remaining height but when the content gets higher than the min-height I want it to have a scrollbar. I've tried to set the scroll-y to scroll but it doesn't work.
Thanks

Ответить
@arieljosephrivera1098
@arieljosephrivera1098 - 12.03.2023 10:29

do you have a tutorial on how to center an element on screen may be vertical or horizonal?

Ответить
@devinturkey
@devinturkey - 11.03.2023 23:44

on the first example just use hieght: 100vh ! important;!!!!!

Ответить
@WinchesterD
@WinchesterD - 11.03.2023 20:46

Thanks, very userfull hints.

Ответить
@cenkakay3506
@cenkakay3506 - 11.03.2023 15:49

Just don't forget to declare height on parent elements. And don't use "vh".

Ответить
@kprod.agency
@kprod.agency - 11.03.2023 14:26

const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
$(window).on('resize', function () {
var vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
});

.inner {
height: calc(var(--vh, 1vh) * 100);
}

Ответить
@alexeleave4551
@alexeleave4551 - 11.03.2023 13:00

Huh, "dvh" was blown my brain 🤯 cool!

Ответить
@thieno22
@thieno22 - 11.03.2023 07:14

thank you kyle, very useful

Ответить
@GaneshSingh1
@GaneshSingh1 - 11.03.2023 04:19

Thanks 😊 bro 🙏, I learned something new today

Ответить
@Monika-tb1xg
@Monika-tb1xg - 10.03.2023 20:51

That is exactly what I needed to know! Thank you so much:)

Ответить