单词不断中断 HTML
Words keep breaking in HTML
我有一个由“
”和“
- ”组成的文本,放在一个盒子里。
列表没有问题,但段落中的单词在到达框的填充时分成两半。
my text
<style>
@media (min-width: 768px)
<style>
.col-md-12 {
flex: 0 0 100%;
max-width: 100%;
}
.alert {
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-radius: 0.25rem;
}
.alert-warning {
color: #856404;
background-color: #fff3cd;
border-color: #ffeeba;
}
.garrigues_RemindersAML__Exvyp {
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-radius: 0.25rem;
color: #0c5460;
border-color: #ffeeba;
text-align: justify;
}
</style>
<div class="row" style="margin-top: 15px;">
<div class="alert alert-warning garrigues_RemindersAML__Exvyp col-md-12">
<p style="font-size: 17px;margin-left:0px;">Reminder </p>
<p> A priori, it is not necessary to request any document from this type of clients. The following documents must be obtained from public sources of information, and included in the AML questionnaire:</p>
<ul>
<li>Documentation proving that it is one of the clients considered low risk.</li>
<li>Documentation accrediting the activity (for example, annual accounts or screenshot of the website).</li>
</ul>
<p> If the customer is a subsidiary or branch of a financial entity or of listed companies whose securities are admitted to trading in a market regulated in the EU or Equivalent Third Countries, it must be justified that they belong (directly or indirectly in more than 50% to the financial or listed entity).</p>
<p> This client has LOW RISK and, therefore, applies SIMPLIFIED MEASURES OF DILIGENCE DUE.</p>
</div>
</div>
我已尽一切努力防止它们中断,但只有 2 个结果:它们中断,或者段落溢出框外。
我已经尝试了所有选项 white-space, word-break, overflow-wrap, overflow, display, width, margin, height... 结果总是一样的:他们中断或溢出。
有没有办法防止它们被破坏,将它们放在下一行,而不是溢出它们?
提前致谢。
编辑:每个段落都来自数据库,然后由 React web 应用程序中的组件呈现,代码并不像看起来那么简单。
文本不能在单词之间中断,因为只使用了
s(用于 'non breaking space')。使用正常的 space 个字符。
p {
background: teal;
width: 150px;
margin: 1em;
}
<p>This text has a long_long_word to test the issue</p>
<p>This text has a long_long_word to test the issue</p>
你试过“word-wrap: break-word;”吗?
我已经尝试过这个并且它有效。
我有一个由“
”和“
- ”组成的文本,放在一个盒子里。
列表没有问题,但段落中的单词在到达框的填充时分成两半。
my text
<style> @media (min-width: 768px) <style> .col-md-12 { flex: 0 0 100%; max-width: 100%; } .alert { position: relative; padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; } .alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; } .garrigues_RemindersAML__Exvyp { position: relative; padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; color: #0c5460; border-color: #ffeeba; text-align: justify; } </style> <div class="row" style="margin-top: 15px;"> <div class="alert alert-warning garrigues_RemindersAML__Exvyp col-md-12"> <p style="font-size: 17px;margin-left:0px;">Reminder </p> <p> A priori, it is not necessary to request any document from this type of clients. The following documents must be obtained from public sources of information, and included in the AML questionnaire:</p> <ul> <li>Documentation proving that it is one of the clients considered low risk.</li> <li>Documentation accrediting the activity (for example, annual accounts or screenshot of the website).</li> </ul> <p> If the customer is a subsidiary or branch of a financial entity or of listed companies whose securities are admitted to trading in a market regulated in the EU or Equivalent Third Countries, it must be justified that they belong (directly or indirectly in more than 50% to the financial or listed entity).</p> <p> This client has LOW RISK and, therefore, applies SIMPLIFIED MEASURES OF DILIGENCE DUE.</p> </div> </div>
我已尽一切努力防止它们中断,但只有 2 个结果:它们中断,或者段落溢出框外。
我已经尝试了所有选项 white-space, word-break, overflow-wrap, overflow, display, width, margin, height... 结果总是一样的:他们中断或溢出。
有没有办法防止它们被破坏,将它们放在下一行,而不是溢出它们?
提前致谢。
编辑:每个段落都来自数据库,然后由 React web 应用程序中的组件呈现,代码并不像看起来那么简单。
文本不能在单词之间中断,因为只使用了
s(用于 'non breaking space')。使用正常的 space 个字符。
p {
background: teal;
width: 150px;
margin: 1em;
}
<p>This text has a long_long_word to test the issue</p>
<p>This text has a long_long_word to test the issue</p>
你试过“word-wrap: break-word;”吗?
我已经尝试过这个并且它有效。