The CSS language is filled with small gaps that are irritating to navigate. Between CSS properties to cover a container and its contents, there’s nonetheless room for enchancment. visibility: hidden
retains top and width integrity whereas show: none
on a container hides all the things. You should utilize .container > *
to cover all contents of a container, however what if there was a greater method?
There’s a higher strategy to cover the contents of a component whereas respecting the container’s border and dimensions. That higher method is utilizing the content-visibility
property:
.my-container.contents-loading { content-visibility: hidden; }
A demo of such performance:
See the Pen Untitled by David Walsh (@darkwing) on CodePen.
Avoiding a .container > *
selector by utilizing content-visibility: hidden
is a lot nicer from a upkeep perspective!
5 HTML5 APIs You Didn’t Know Existed
If you say or learn “HTML5”, you half anticipate unique dancers and unicorns to stroll into the room to the tune of “I am Horny and I Know It.” Are you able to blame us although? We watched the basic APIs stagnate for thus lengthy {that a} fundamental characteristic…
TextboxList for MooTools and jQuery by Guillermo Rauch
I will be trustworthy with you: I nonetheless have not found out if I like my MooTools teammate Guillermo Rauch. He is bought lots stacked up towards him. He is from Argentina so I get IM’ed about 10 instances a day about how nice Lionel…