पारदर्शी पृष्ठभूमि छवियाँ - सीएसएस-ट्रिक्स

Anonim

कोई सीएसएस संपत्ति पृष्ठभूमि-अस्पष्टता नहीं है, लेकिन आप नियमित रूप से अस्पष्टता के पीछे एक छद्म तत्व को सम्मिलित करके नकली कर सकते हैं इसके पीछे तत्व का सटीक आकार।

div ( width: 200px; height: 200px; display: block; position: relative; ) div::after ( content: ""; background: url(image.jpg.webp); opacity: 0.5; top: 0; left: 0; bottom: 0; right: 0; position: absolute; z-index: -1; )