http://2plus10.com/tec/blur_pannel.html
このページを見てくもりガラスエフェクトを実装したのですが背景画像の指定で躓いています。
background-attachment: fixed;を僕は指定したくないのですがこれがないと#wrapの画像の大きさと#profileの画像の大きさが別になってしまい、エフェクトをかけてるところだけ画像の別の部分が表示されてしまいます。
他のサイトを見てみてもbackground-attachmentを指定しているサイトばかりでスクロールしても背景画像が動きません。
background-attachmentを指定しないでも動かせる方法がわかる方はいらっしゃいませんでしょうか?
lang
1 <div id="wrap"> 2 <div id="profile"> 3 <img src="img.jpg"/> 4 <h1> 5 text 6 </h1> 7 </div> 8 </div> 9 <style> 10 *{ 11 margin: 0; 12 padding: 0; 13 } 14 #wrap{ 15 width: 800px; 16 height: 400px; 17 background-repeat: no-repeat; 18 background-attachment: fixed; 19 background-size: 100%; 20 background-image: url("back.jpg"); 21 } 22 #profile{ 23 background: inherit; 24 position: relative; 25 border-radius: 8%; 26 padding: 8px; 27 border: 1px solid rgba(255,255,255,.1); 28 box-shadow: 0 0 10px rgba(0,0,0,.4); 29 z-index: 0; 30 color: white; 31 overflow: hidden; 32 } 33 #profile:before,#profile:after{ 34 content: ''; 35 position: absolute; 36 top: 0; 37 left: 0; 38 width: 100%; 39 height: 100%; 40 z-index: -1; 41 } 42 #profile:before{ 43 content: ''; 44 background: inherit; 45 filter: blur(5px); 46 -webkit-filter: blur(5px); 47 } 48 #profile:after{ 49 content: ''; 50 background-color: rgba(0,0,0,.1); 51 } 52 </style>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。