【发布时间】:2020-06-03 00:44:05
【问题描述】:
我有一个具有相对位置的 div 和两个使用它的孩子,并且都具有绝对位置。我需要它们。但我想在相对 div 中创建另一个孩子并给它绝对位置。但现在的问题是我希望它的某些部分出现在元素之外。那么如何在 CSS 中做到这一点呢?提前致谢。
参考我需要的是:Example of what I need, check the search icon. How it is placed. I want that kind of thing.
div {
//Parent div
position:relative;
}
div {
//Child div
position:absolute;
}
div {
//Child div
position:absolute;
//This is an emoji
//But I want this to appear half outside of the parent div,
//i.e. on the border of the parent div
}
【问题讨论】:
-
你有位置:为此固定
-
请阅读How to Ask和minimal reproducible example。像这样的问题应该不仅仅是“我想要什么”和一张图片。