18910140161

JavaScript-使Flex项彼此靠近-堆栈溢出

顺晟科技

2022-10-18 14:17:56

161

看起来

怎么样

我需要使描述更接近学生姓名,Student_comment当前位于display flexflex direction row中,但我需要使描述位于顶部,以便它更接近日期和学生姓名,我尝试了填充和边距,但都不起作用。这是我的代码:

 .Student_Comment1 {
  display: flex;
  flex-direction: row;
}

.StudentComments_DashBoard {
  width: 80%;
  margin: auto;
  padding-top: 2vw;
}

.StudentComment_Description {
  padding-left: 3.7vw;
  padding-bottom: 1vw;
}

.Student_CommentDate {
  padding-left: 1.5vw;
  font-size: 0.9vw;
  padding-top: 0.3vw;
}

.StudentName_Comment {
  font-weight: 500;
  font-size: 1.3vw;
}

.dotForStudent {
  height: 2.5em;
  width: 2.5em;
  border-radius: 50%;
  border: 1px solid grey;
  background-color: white;
  margin-top: 0.9vw;
  margin-right: 1vw;
}
<代码><;DIV Class=“ StudentComments_仪表板”>;<;DIV Class=“ studentcom_仪表板”>;<;DIV类=“学生_注释1 ”>;<;SPAN CLASS=“ dotForStudent ”>;<;/SPAN>;<;DIV Class=“学生姓名_注释”>;学生姓名<;/DIV>;<;DIV类=“学生_注释日期”>;&;nbsp;2021年5月11日<;/DIV>;<;/DIV>;<;DIV Class=“ studentComment_描述”>;Lorem Ipsum Lorem Ipsum Lorem IPSum<;/DIV>;<;/DIV>;<;/DIV>;


顺晟科技:

添加<div class="StudentComments_DashBoard"> <div class="StudentCom_DashBoard"> <div class="Student_Comment1"> <span class="dotForStudent"></span> <div class="StudentName_Comment"> Student Name </div> <div class="Student_CommentDate"> &nbsp; May 11, 2021 </div> </div> <div class="StudentComment_Description">Lorem ipsum lorem ipsum lorem ipsum lorem ipsum ? </div> </div> </div>到您的align-items: flex-end;类CSS

Student_Comment1
  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航