Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

以下代码实现效果,为什么不能搭配不同方位? direction,margin-derection(反方向),

 .container {
 width: 300px;
 height: 50px;
 border-radius: 10px;
 background-color: lightblue;
 margin: 0 auto;
 position: relative;
 }
 .container::after {
 content: "";
 width: 0;
 height: 0;
 border: 10px solid transparent;
 border-left: 10px solid lightblue;
 position: absolute;
 top: 50%;
 margin-top: -10px;
 right: 0;
 margin-right: -20px;
 }

失效

 top: 50%;
 right: 0;
 margin-bottom: 10px;
 margin-left: 20px;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

布局问题,你已经用了绝对布局,调整位置用left,right,bottom,top这四个就足够了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...