Well, there are several ways. I will try my best to explain what you can do.
rel rel link HTML, , , , . , , . .
<link rel="preload" href="style.css" as="style">
<img rel="preload" src="image.png" as="image" />
: css.
- html .
, . html css. , - .
- SVG
HTML, svg-loader, html.
- div, , .
, .
div :
div#preload { display: none; }
const cardOne = require("path/to/card1/img");
const cardTwo = require("path/to/card2/img");
...
render() {
return (
<div id="preload">
<img src={cardOne} />
<img src={cardTwo} />
{}
</div>
);
}
div , , , , :
#element_01 {
background: url(path/image_01.png) no-repeat;
display: none;
}
#element_02 {
background: url(path/image_02.png) no-repeat;
display: none;
}
#element_03 {
background: url(path/image_03.png) no-repeat;
display: none;
}
source
share