【发布时间】:2020-05-28 02:12:50
【问题描述】:
我遇到了 text-align:left 的问题:我的消息(文本)没有向左对齐。到目前为止,我已经尝试了几件事:添加宽度:100%、浮动:左以及显示:块。不幸的是,他们都没有工作。我在想可能是 simplebar 会影响它,尽管我不知道那是怎么回事。如果您能以某种方式帮助我,将不胜感激! 这是我的 CSS 和 HTML:
<h2 id="receiver" name="{{receiver}}">Chat with {{receiver}}</h2>
<div data-simplebar id="my-element" class="history">
{% for message in hist_list %}
{{message}}<br>
{% endfor %}
</div>
.history {
position: absolute;
top: 210px;
left: 249px;
transform: translate(-50%, -50%);
height: 416px;
text-align:left;
width:100%;
}
* {
box-sizing: border-box;
margin:0;
padding:0;
text-align: center;
font-family: 'Exo', sans-serif;
color: black;
}
这是 Simpebar,它可能会干扰我的 CSS:
[data-simplebar] {
position: relative;
flex-direction: column;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
}
【问题讨论】:
标签: html css text-align simplebar