
sectionの背景画像の上下を斜めにするために、::beforeと::afterで実装させているのですが、それに加えて、背景画像にボカシを入れる事は可能でしょうか?ボカシも疑似要素でやるために、前述の::after、::beforeで疑似要素を使い切ってるために、無理でしょうか?
現状、ボカシ加工をした背景画像を設置して、問題はないといえばないのですが。
どうしても気になったもので。
よろしくお願いいたします。
コードは、下記のように記載してあります。
html
1<section>○○○</section>
css
1section { 2position: relative; 3} 4 5section::before { 6content: ''; 7clip-path: polygon(0 0, 100% 0%, 100% 0%, 0 100%); 8background: #FFF; 9width: 100%; 10height: 100px; 11position: absolute; 12top: -1px; 13left: 0; 14} 15 16section.middle::after { 17content: ''; 18clip-path: polygon(0 0, 100% 99%, 100% 100%, 0 100%); 19background: #FFF; 20width: 100%; 21height: 100px; 22position: absolute; 23top: auto; 24bottom: -1px; 25left: 0; 26z-index: 1000; 27}

> ボカシ加工をした背景画像
opacityプロパティを使ってはいけないのですな?
https://developer.mozilla.org/ja/docs/Web/CSS/opacity
sectionの背景画像の上下を斜めにしているHTMLとCSSを質問に追記してください。
あと、背景画像ボカシは filter: blur() のことですか。
下記のように記載してあります。
html
<section>○○○</section>
css
section {
position: relative;
}
section::before {
content: '';
clip-path: polygon(0 0, 100% 0%, 100% 0%, 0 100%);
background: #FFF;
width: 100%;
height: 100px;
position: absolute;
top: -1px;
left: 0;
}
section.middle::after {
content: '';
clip-path: polygon(0 0, 100% 99%, 100% 100%, 0 100%);
background: #FFF;
width: 100%;
height: 100px;
position: absolute;
top: auto;
bottom: -1px;
left: 0;
z-index: 1000;
}
質問は編集できますのでそのコードは質問に追記してください。ここだと初期値は閉じてますので回答者の目に入らない可能性がたかいです。
コードはマークダウンのコードブロックに入れてください。

回答2件
あなたの回答
tips
プレビュー