The CSS language is filled with small gaps which might be irritating to navigate. Between CSS homes to cover a container and its contents, there may be nonetheless room for growth. visibility: hidden
assists in keeping top and width integrity whilst show: none
on a container hides the whole thing. You’ll use .container > *
to cover all contents of a container, however what if there used to be a greater means?
There’s a higher solution to conceal the contents of a component whilst respecting the container’s border and dimensions. That higher means is the use of the content-visibility
belongings:
.my-container.contents-loading { content-visibility: hidden; }
A demo of such capability:
See the Pen Untitled by way of David Walsh (@darkwing) on CodePen.
Averting a .container > *
selector by way of the use of content-visibility: hidden
is such a lot nicer from a upkeep point of view!
Create a CSS Dice
CSS cubes in reality show off what CSS has turn into over time, evolving from easy colour and size directives to a language in a position to developing deep, inventive visuals. Upload animation and you have one thing in reality neat. Sadly every CSS dice educational I have learn is a bit of…
Create Keyboard Shortcuts with Mousetrap
One of the most best portions of internet apps are hidden within the little issues. Those “small main points” can steadily upload as much as large, large features. A type of small features will also be present in keyboard shortcuts. Superior internet apps like Gmail and GitHub use a lot of…
MooTools onLoad SmoothScrolling
SmoothScroll is an implausible MooTools plugin however easy scrolling most effective happens when the anchor is at the similar web page. Making SmoothScroll paintings throughout pages is as simple as a couple of additional line of MooTools and a querystring variable. The MooTools / PHP In fact, this can be a…
[ad_2]