cuốn sách gpt4 ai đã làm

html - các phần tử :trước và :after trên phần tử img

In lại Tác giả: Vũ trụ không gian 更新时间:2023-11-04 04:48:58 30 4
mua khóa gpt4 Nike

是否可以在 img 元素上使用前后伪选择器?认为它是但没有任何运气,将 css 切换到 div 并且它工作正常。 .page-overhang 类是 img 元素。

// page overhang mixin
@mixin overhang {
&:before,
&:after {
position: absolute;
left: 0;
display: block;
chiều rộng: 10px;
height: 18px;
background: url(../images/sprite.png) no-repeat;
nội dung: "";
}

&:before {
top: -18px;
background-position: 0 -100px;
}

&:after {
bottom: -18px;
background-position: 0 -119px;
}
}

/* scss file */
.page-overhang {
position: relative;
display: block;
@include overhang();
}

câu trả lời hay nhất

:trước:sau đó 伪元素不能用于 void elements ,因为它们指定要添加到元素实际内容之前或之后的内容,而 void 元素可以没有内容。

关于html - :before and :after elements on an img element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13870635/

30 4 0
không gian vũ trụ
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress