我想知道为什么我在`article`中作为伪元素放置的`background-image:linear-gradient`的位置是这样的

问题描述 投票:0回答:0

background-image:linear-gradient

https://besthorrorscene.com/<<

我正在克隆这个网站,每个网站下面的渐变都很漂亮,我试图复制它,但我不明白的是,我想如果我只是给它 bottom:0;离开:0;它在标签下面会有一个很好的渐变,但它没有出现。无奈之下,我翻阅了网站的源代码,但我不明白为什么它有这个权利:0;除了左边:0;。我问是因为我的头快要爆炸了。请帮助。

.index-module--Article--Hjn11::before{
    background-image: linear-gradient(0deg,rgba(0,0,0,.08),transparent);
    bottom: 0;
    content: "";
    height: 100px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
}

我想如果给伪元素position:absolute;底部:0;和 left:0;,一个漂亮的渐变会出现在底部,但它没有。

为什么是对的:0;用过吗?

css css-position linear-gradients
© www.soinside.com 2019 - 2024. All rights reserved.