首页 > 解决方案 > 试图让我的删除按钮坐在右侧

问题描述

我不擅长css,但我试图让我的按钮坐在“发布者”旁边。我得到了我想要的按钮,但我希​​望它在盒子里面。

截屏:

在此处输入图像描述

标签: css

解决方案


好吧,也许你不知道你真正需要什么。这里我从你的截图中做一个例子,通过使用flex对齐内容和按钮,希望这对你有帮助。

.thebottom{
  background-color:#F5F5F5;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:20px;
}

.theleft{
  display:flex;
  flex-direction:column;
}

.deletebtn{
  background-color:#F24701;
  padding:10px 25px;
  color:#fff;
  text-align:center;
}
<div class="thebottom">
<div class="theleft">
  <div>
    Post by : ABC
  </div>
  <div>
  30th of August, 3AM
  </div>
</div>
<div class="deletebtn">DELETE</div>
</div>


推荐阅读