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 關注
- 145 瀏覽
添加回答
舉報