


How to achieve gap effect on the card and coupon layout with gradient background?
Apr 05, 2025 am 07:48 AMCleverly use CSS Mask to create a gradient background card voucher gap effect
In design, adding notch effects to card coupons, especially gaps in gradient backgrounds, is often a challenge. This article will introduce in detail how to use the mask
attribute of CSS to easily achieve this effect.
Design puzzle: Card coupon gap under gradient background
If the background of the card coupon is solid, you can easily achieve the gap by directly masking it with a solid color. But the gradient background is not the case, and a simple mask will destroy the gradient effect. Therefore, there is a need for a method to accurately "dig out" the gap while retaining the gradient.
Solution: CSS Mask Properties
The CSS mask
attribute is the key to solving this problem. It allows us to "block" elements using images or gradients, thus creating a variety of complex matte effects that are perfect for notch designs in gradient backgrounds.
The following code snippet demonstrates how to create a circular gap using a radial gradient:
.card { -webkit-mask: radial-gradient(circle at 20px 20px, #0000 20px, transparent 0); /* Safari and Chrome */ mask: radial-gradient(circle at 20px 20px, #0000 20px, transparent 0); /* Firefox */ }
This code creates a circular mask through a radial gradient. #0000
means opaque black (occlusion area), transparent
means transparent (notch area). 20px 20px
specifies the center position, 20px
controls the notch radius. In terms of browser compatibility, -webkit-mask
has been added to support Safari and Chrome.
Effect preview
After applying the above code, a circular gap will appear in the upper left corner of the coupon, while the gradient background will remain intact.
Auxiliary tools
In addition to manually writing CSS code, some online design tools can also assist in card coupon design and gap generation. For example, some "coupon designers" or "graphic editors" may provide more intuitive notch creation capabilities.
Summarize
Using the CSS mask
attribute, we can efficiently add gaps in various shapes to the gradient background card coupons to improve the design effect. This method is simple and easy to use and can maintain the overall appearance of the card coupon.
The above is the detailed content of How to achieve gap effect on the card and coupon layout with gradient background?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Ordinary investors can discover potential tokens by tracking "smart money", which are high-profit addresses, and paying attention to their trends can provide leading indicators. 1. Use tools such as Nansen and Arkham Intelligence to analyze the data on the chain to view the buying and holdings of smart money; 2. Use Dune Analytics to obtain community-created dashboards to monitor the flow of funds; 3. Follow platforms such as Lookonchain to obtain real-time intelligence. Recently, Cangming Money is planning to re-polize LRT track, DePIN project, modular ecosystem and RWA protocol. For example, a certain LRT protocol has obtained a large amount of early deposits, a certain DePIN project has been accumulated continuously, a certain game public chain has been supported by the industry treasury, and a certain RWA protocol has attracted institutions to enter.

The duration of the airdrop dividend is uncertain, but the LayerZero, StarkNet and ZK ecosystems still have long-term value. 1. LayerZero achieves cross-chain interoperability through lightweight protocols; 2. StarkNet provides efficient and low-cost Ethereum L2 expansion solutions based on ZK-STARKs technology; 3. ZK ecosystem (such as zkSync, Scroll, etc.) expands the application of zero-knowledge proof in scaling and privacy protection; 4. Participation methods include the use of bridging tools, interactive DApps, participating test networks, pledged assets, etc., aiming to experience the next generation of blockchain infrastructure in advance and strive for potential airdrop opportunities.

The coordinated rise of Bitcoin, Chainlink and RWA marks the shift toward institutional narrative dominance in the crypto market. Bitcoin, as a macro hedging asset allocated by institutions, provides a stable foundation for the market; Chainlink has become a key bridge connecting the reality and the digital world through oracle and cross-chain technology; RWA provides a compliance path for traditional capital entry. The three jointly built a complete logical closed loop of institutional entry: 1) allocate BTC to stabilize the balance sheet; 2) expand on-chain asset management through RWA; 3) rely on Chainlink to build underlying infrastructure, indicating that the market has entered a new stage driven by real demand.

The most popular tracks for new funds currently include re-staking ecosystems, integration of AI and Crypto, revival of the Bitcoin ecosystem and DePIN. 1) The re-staking protocol represented by EigenLayer improves capital efficiency and absorbs a large amount of long-term capital; 2) The combination of AI and blockchain has spawned decentralized computing power and data projects such as Render, Akash, Fetch.ai, etc.; 3) The Bitcoin ecosystem expands application scenarios through Ordinals, BRC-20 and Runes protocols to activate silent funds; 4) DePIN builds a realistic infrastructure through token incentives to attract the attention of industrial capital.

Dogecoin, Pepe and Brett are leading the meme coin craze. Dogecoin (DOGE) is the originator, firmly ranked first in the market value list, Pepe (PEPE) has achieved hundreds of times increase with its social geek culture, and Brett (BRETT) has become popular with its unique visual style as a new star in Base chain; the three were issued in 2013, 2023 and 2024 respectively. Technically, Dogecoin is based on Litecoin, Pepe and Brett are ERC-20 tokens, and the latter relies on the Base chain to improve efficiency. In terms of community, DOGE Twitter fans have exceeded 3 million, Pepe Reddit is leading in activity, Brett's popularity in Base chain, and DOGE has logged in on the platform.

The following are several free mobile APP recommendations that can grasp Bitcoin prices, real-time K-line trends and exchange markets at any time: Binance official APP: one of the world's largest exchanges, providing real-time price, K-line charts, and in-depth charts, suitable for Binance users to view BTC spot and contract markets. OkX APP: The interface is simple, the data is updated quickly, and it supports a variety of trading pairs, making it easy to view BTC/USDT and other quotations. Huobi (HTX) APP: an old platform that supports market viewing and price warning, suitable for Huobi users to control asset fluctuations. CoinMarketCap (CMC): Aggregate data from multiple exchanges, suitable for tracking market value rankings and historical trends. TradingView: Professional charting tools, suitable

Google has launched a browser extension called "PasswordCheckup" to help users determine whether their passwords are in a secure state. In the future, this password leakage detection feature will be a default feature of Google Chrome, not just limited to optional extensions. Although the PasswordCheckup extension provided by Google can automatically detect the password security used by users when logging into different websites, interested users can still experience it in advance by downloading the ChromeCanary version. However, it should be noted that this function is turned off by default and users need to turn it on manually. Once the function is enabled, users can know the login they entered when logging in on non-Google sites.

The OEX official website entrance is the primary channel for users to enter the OEX (OEX) platform. The platform is known for its safety, efficiency and convenience, and provides currency trading, contract trading, financial management services, etc. 1. Visit the official website; 2. Click "Register" to fill in your mobile phone number or email address; 3. Set your password and verify; 4. Log in after successful registration. The platform's advantages include high security, simple operation, rich currency, and global service. It also provides beginner's guidance and teaching modules, suitable for all types of investors.
