[英]How to constrain content to modal dialog width?
I have a long string of text in a modal dialog box, but the text does not wrap or stay inside the dialog.我在模态对话框中有很长的文本字符串,但文本没有换行或留在对话框内。 How can I fix this?
我怎样才能解决这个问题? Below is an image and my template for the dialog.
下面是一个图像和我的对话框模板。
<div class="modal modal-backdrop" tabindex="-1" role="dialog" [ngStyle]="{display: shareLinkShowDialog ? 'block' : 'none'}">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Share Link to {{selectedHouseMember.getName()}}
</h5>
</div>
<div class="modal-body" style="text-align: center;">
<p>{{shareLink}}</p>
</div>
<div class="modal-footer">
<button class="btn btn-warning" (click)="toggleShareLinkDialog()">
Close
</button>
</div>
</div>
</div>
</div>
use用
width:100%;宽度:100%; max-width:100%;
最大宽度:100%;
to parent给父母
<div class="modal-body" style="text-align: center; word-wrap: break-word;">
<p>
{{shareLink}}
</p>
</div>
Got it working using word-wrap: break-word;
使用
word-wrap: break-word;
. . I referenced this question: html - Bootstrap modal horizontal text overflowing
我参考了这个问题: html - Bootstrap modal水平文本溢出
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.