如何在右侧设置宽度的fit-content . 我使用 fit-content
值作为宽度,并且每个东西都在左侧,但在右侧内容放在页面的中心 . 我使用这个CSS来制作动态宽度的内容:
.chat li.right .chat-body {
margin-right: 60px;
border: 1px solid $c-grey;
padding: 10px;
background-color: whitesmoke;
border-color: #e3e3e3;
/*box-shadow: 0 1px 0 #cfcfcf;*/
border-radius: 2px;
margin-left: 20%;
max-width: 80%;
width: fit-content;
}
这是我的聊天示例:CodePen Example
1 回答
替换为我的代码 .
和:
Working Demo