10 Replies
I have the text-wrap: balance and box-sizing: border-box in my reset. I like to use svh vs dvh if Iโm needing to declare a min-height in the body. I do wonder โwhy the position: relative?โ On the *selector. The only think that comes to mind is to be able to use z-index on an element without giving them a position themselves. If thatโs the reason I think itโs a bit overkill. Curious what the actual reason is. ๐ค
This code doesn't reset margins and padding. Also, dvh should be used in combination with vh, because it is still too new to use alone. The 100vh should come before 100dvh. This allows the 100vh to be overridden by the 100dvh in browsers that understand it. This also allows the 100vh to be used on browsers that don't understand dvh. They will just ignore the dvh. Without the 100vh, browsers that don't understand dvh will not have the height set at all.
I forgot to also add that the universal selector does not select pseudo elements.
That's the annotations that the creator add fr ๐
@hartโค๐ฅ have a look a the comments of the creator๐
I disagree with this. It is not common enough that you would need to anticipate the use of top, left, right, and bottom. When you want to use them, add the postion: relative. You don't need it on all elements.
@ChooKing yep absolutely true Kevin said that before the vh comes first than the dvh cause like you said its totally new but i think we can include both of them at the same time than the browser chose the dvh if supported if not its gonna go with vh only ๐
@ChooKing me too absolutely cause position relative could be problematic if you want to position a nested child ๐ฏ
if you put the dvh below the vh, yes
why would you want to make every element relative? It looks like it will mess up when you trying to use absolute
I would not use the position relative.
this can lead to creating stacking contexts too easily by mistake which causes lots of problems
Echoing to def not include the position relative, itโs unnecessary and could (and prob will) lead to issues.