Faisant une pause dans mon emploi du temps chargé, j’ai récemment regardé beaucoup d’effets sympas. Il existe désormais de nombreux plug-ins basés sur jquery, mais la compatibilité de nombreux plug-ins n'est pas très bonne, donc les plug-ins natifs sont la voie à suivre. Dans la vie quotidienne, le verre dépoli n’est plus courant. Non, voici le verre dépoli :
Haha, passons aux choses sérieuses. Voyons d'abord l'effet final :
<.>
<body> <div > iPhone 7 dramatically improves the most important aspects of the iPhone experience. It introduces advanced new camera systems. The best performance and battery life ever in an iPhone. Immersive stereo speakers. The brightest, most colorful iPhone display. Splash and water resistance.1 And it looks every bit as powerful as it is. This is iPhone 7. </div> </body>
Le code CSS est le suivant :
body { min-height: 100vh; box-sizing: border-box; margin: 0; padding-top: calc(50vh - 6em); font: 150%/1.6 serif; background: url("http://www.jackzxl.net/wp-content/MyFile/2016/09/iphone.jpg") fixed 0 center; background-size: cover; } div { margin: 0 auto; padding: 1em; max-width: 30em; border-radius: 0.3em; box-shadow: 0 0 0 1px hsla(0,0%,100%,.3) inset, 0 .5em 1em rgba(0, 0, 0, 0.6); text-shadow: 0 1px 1px hsla(0,0%,100%,.3); background: hsla(0,0%,100%,.3); }
overflow: hidden; position: relative;
div::before{ content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; filter: blur(20px); margin: -20px; background: url("http://www.jackzxl.net/wp-content/MyFile/2016/09/iphone.jpg") fixed 0 center; background-size: cover; }
<.>
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!