CSS content-visibility

CSS content-visibility
[ad_1]

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 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]
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back To Top
0
Would love your thoughts, please comment.x
()
x