如何在网格列内垂直对齐文本

时间:2021-03-06 22:50:46

标签: html css css-grid vertical-alignment

如果单击按钮时列的宽度减小,我正在尝试垂直对齐网格列内的文本。

这是Hierarchy这个词的原始对齐方式 This is the original alignment of the word Hierarchy

当我单击按钮时,列的宽度会发生变化。我得到这样的输出。

这里层次结构应该旋转,它应该垂直对齐 Here Hierarchy should be rotated and it should be aligned vertically. 它应该是这样的 And it should appear like this.

这是我的代码

 .web_hierarchy {
  display: grid;
  margin-left: 10px;
  margin-right: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  grid-template-columns: 45px 45px 1fr 200px;
  grid-template-rows: 450px 200px;
  grid-template-areas:
    "sidebar hierarchy build inspector"
    "sidebar hierarchy assets inspector";
  border: 2px solid black;

}

.hierarchy {
  grid-row-end: span 2;
  background-color: #ffe5b4;
  border-right: 1px solid black;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

0 个答案:

没有答案
相关问题