1 回答
TA贡献1775条经验 获得超8个赞
您需要将区域分配给类:
.chat-container {
display: grid;
grid-template-areas: "chat-list chat-title chat-title" "chat-list message-list message-list" "chat-list chat-form chat-form";
grid-template-columns: 200px 1fr;
border-radius: 10px;
height: 95vh;
width: 100%;
}
.chat-title {
padding: 10px;
background: blue;
grid-area: chat-title; /* added */
}
.chat-list {
padding: 10px;
background: red;
grid-area: chat-list; /* added */
}
.message-list {
padding: 10px;
background: green;
grid-area: message-list; /* added */
}
.chat-form {
padding: 10px;
background: yellow;
grid-area: chat-form; /* added */
}
<div class="chat-container">
<section class="chat-list">
Chat List
</section>
<section class="chat-title">Chat title</section>
<section class="message-list">
Message List
</section>
<section class="chat-form">Chat form</section>
</div>
- 1 回答
- 0 关注
- 93 浏览
添加回答
举报