CSS中伪元素的定位上下文问题 ORIGIN全文地址:CSS中伪元素的定位上下文问题推荐:编程鼠标·电竞鼠标在研究CSS名著《CSS设计指南》(第3版)中,对讲到界面组件中的用CSS为弹出层设计三角形这个知识点时,对例子代码中伪元素的定位上下文关系产生了很大的困惑。!DOCTYPE html html head meta charset="utf-8"/ titleStylin'with CSS - Figure 6.24 Popup Overlay/title style *{margin:0;padding:0;font-family:helvetica,arial,sans-serif;}figure{width:144px;height:153px;/* sizing of image box */margin:20px 20px;/* space between boxes */border:1px solid #666;/* image border */position:relative;/* positioning context for popups */float:left;/* makes images sit side by side */}img{display:block;}/* remove baseline spacing from under image */figcaption{display:none;/* hides popups */position:absolute;/* relative to images */left:74%;top:14px;/* positions popup on right side of image */width:130px;/* width of popup */padding:10px;/* space around popup content */background:#f2eaea;border:3px solid red;border-radius:6px;}