skeleton loader css
CSS
<button>Add content</button>
<div class="demo"></div>
<style>
/*
Animated skeleton screen using CSS.
Create shapes using gradients that simulate solids.
Use `:empty` pseduo-class to show skeleton screen background only while container has no content (ex: for the "loading" state). When content is added to the container element, the pseudo-class selector won't match anymore and the skeleton screen will be removed automatically; no need to toggle a separate class on the container.
See: https://developer.mozilla.org/en-US/docs/Web/CSS/:empty
Animating one layer of the background which is a tilted linear gradient with white in the middle to achieve shine effect.
*/
.demo:empty {
margin: auto;
width: 500px;
height: 600px; /* change height to see repeat-y behavior */
background-image:
radial-gradient( circle 50px at 50px 50px, lightgray 99%, transparent 0 ),
linear-gradient( 100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 80% ),
linear-gradient( lightgray 20px, transparent 0 ),
linear-gradient( lightgray 20px, transparent 0 ),
linear-gradient( lightgray 20px, transparent 0 ),
linear-gradient( lightgray 20px, transparent 0 );
background-repeat: repeat-y;
background-size:
100px 200px, /* circle */
50px 200px, /* highlight */
150px 200px,
350px 200px,
300px 200px,
250px 200px;
background-position:
0 0, /* circle */
0 0, /* highlight */
120px 0,
120px 40px,
120px 80px,
120px 120px;
animation: shine 1s infinite;
}
@keyframes shine {
to {
background-position:
0 0,
100% 0, /* move highlight to right */
120px 0,
120px 40px,
120px 80px,
120px 120px;
}
}
</style>
<script>
// As soon as content is added to the skeleton screen container, the `:empty` pseudo-class won't match anymore and the background will be automatically removed.
document.querySelector('button').addEventListener('click', function() {
document.querySelector('.demo').innerHTML = '<h1>Injected content.</h1>';
})
</script>
Also in CSS:
- Title
- how to link your css file to html
- Category
- CSS
- Title
- how to center a div vertically and horizontally
- Category
- CSS
- Title
- link fontawesome
- Category
- CSS
- Title
- animation css
- Category
- CSS
- Title
- css image fit in div with aspect ratio
- Category
- CSS
- Title
- css background image fit
- Category
- CSS
- Title
- css triangle
- Category
- CSS
- Title
- change select arrow css
- Category
- CSS
- Title
- get element with href css
- Category
- CSS
- Title
- how to use a blank space with grid template areas css
- Category
- CSS
- Title
- align-self
- Category
- CSS
- Title
- how to change the bullet points in css
- Category
- CSS
- Title
- html center video
- Category
- CSS
- Title
- css change text color
- Category
- CSS
- Title
- css thinner hr
- Category
- CSS
- Title
- what is rem in css
- Category
- CSS
- Title
- sass mixin breakpoint
- Category
- CSS
- Title
- css subclass
- Category
- CSS
- Title
- how rotate infinity css
- Category
- CSS
- Title
- css keyframes
- Category
- CSS
- Title
- link css with html
- Category
- CSS
- Title
- css bold text
- Category
- CSS
- Title
- flip image css
- Category
- CSS
- Title
- sass mixin
- Category
- CSS
- Title
- display table css
- Category
- CSS
- Title
- scss mixin skip argument use default
- Category
- CSS
- Title
- custom scroll bar
- Category
- CSS
- Title
- hover transition css
- Category
- CSS
- Title
- how to make gradient backgroud cover whole page in html
- Category
- CSS
- Title
- media query
- Category
- CSS
- Title
- vuetify background color
- Category
- CSS
- Title
- css reset margin padding
- Category
- CSS
- Title
- css flex content right
- Category
- CSS
- Title
- css background color
- Category
- CSS
- Title
- how to link fonts css
- Category
- CSS
- Title
- css change background color of page
- Category
- CSS
- Title
- css max height
- Category
- CSS
- Title
- how to make borders rounded in css
- Category
- CSS
- Title
- bootstrap 4 material icon vertical align
- Category
- CSS
- Title
- html css how to arrange images of different sizes
- Category
- CSS
- Title
- media query change button text
- Category
- CSS
- Title
- css animation examples
- Category
- CSS
- Title
- remove bulltes css
- Category
- CSS
- Title
- :root css
- Category
- CSS
- Title
- because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
- Category
- CSS
- Title
- two classes css modules
- Category
- CSS
- Title
- external css
- Category
- CSS
- Title
- rotate background image css
- Category
- CSS
- Title
- css last child
- Category
- CSS
- Title
- fill and no repeat background image css
- Category
- CSS
- Title
- rotate 3d
- Category
- CSS
- Title
- font family css
- Category
- CSS
- Title
- css child multiple of 3
- Category
- CSS
- Title
- css display property
- Category
- CSS
- Title
- como configurar los estilos para utilizar angular material
- Category
- CSS
- Title
- install webpack encore
- Category
- CSS
- Title
- css add dots if text too long
- Category
- CSS
- Title
- css transform property
- Category
- CSS
- Title
- how to write css for input type text
- Category
- CSS
- Title
- add own image in cursor using css
- Category
- CSS
- Title
- free css templates
- Category
- CSS
- Title
- remove default input style css
- Category
- CSS
- Title
- css selenium
- Category
- CSS
- Title
- how to chane text color when hover in css
- Category
- CSS
- Title
- image size css
- Category
- CSS
- Title
- css transparent background color
- Category
- CSS
- Title
- access lamp folder using terminal mac
- Category
- CSS
- Title
- enter in css
- Category
- CSS
- Title
- center div vertically html css
- Category
- CSS
- Title
- Wrap the last word of a paragraph in span tags using jQuery
- Category
- CSS
- Title
- how to change hyperlink color in css
- Category
- CSS
- Title
- bootstrap btn classes
- Category
- CSS
- Title
- how to get random images
- Category
- CSS
- Title
- transparent background css
- Category
- CSS
- Title
- css preprocessor
- Category
- CSS
- Title
- css font-size
- Category
- CSS
- Title
- custom selection color css
- Category
- CSS
- Title
- tint image css
- Category
- CSS
- Title
- rotate image horizontally css
- Category
- CSS
- Title
- css background image size
- Category
- CSS
- Title
- flex align top css
- Category
- CSS
- Title
- css using the same background-color as the parent background
- Category
- CSS
- Title
- responsive youtube video on a website
- Category
- CSS
- Title
- syntax for manipulating a class in css
- Category
- CSS
- Title
- CSS make image fill whole background
- Category
- CSS
- Title
- font-weight css
- Category
- CSS
- Title
- como fazer listrada css
- Category
- CSS
- Title
- how to create a shape in css
- Category
- CSS
- Title
- how to make text not highlightable css
- Category
- CSS
- Title
- css padding attribute order
- Category
- CSS
- Title
- background-image: image css
- Category
- CSS
- Title
- css how to stop screen from left and right
- Category
- CSS
- Title
- select first div css
- Category
- CSS
- Title
- import google fonts into react
- Category
- CSS
- Title
- custom border css
- Category
- CSS
- Title
- css media queries
- Category
- CSS
- Title
- display flex css
- Category
- CSS
- Title
- html link to css in another folder
- Category
- CSS
- Title
- forcing website to show in landscape mode only
- Category
- CSS
- Title
- html font size
- Category
- CSS