CSS 实现部分图片在弹框外

CSS About 340 words

需求

背景图片一半在弹框外。

实现

使用position: absolute绝对定位,设置top为负数即可。

.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
    padding: 30px;
    border-radius: 30px;
}

.bg-popup {
    position: absolute;
    top: -135px;
    width: 480px;
    height: 270px;
}
Views: 22 · Posted: 2025-08-24

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh