我使用 < Pre > 在 Modal 中显示我的 json 数据。但是
根据 json 的大小变成了不同的大小。我想修复高度。如果 json 较大,它将滚动显示。这是我的模态框。
<div class="modal-content json-modal-body" id="full-width" ng-controller="projectdetailsController"> <div class="modal-header modal-header-confirm"> <h4 class="modal-title ng-binding"> <span class="glyphicon glyphicon-indent-left"></span>{{modalOptions.headerText}} </h4> </div> <div class="modal-body"> <pre ng-bind-html="json | prettifyFilter"></pre> </div> </div>
当 json 为空时。变成这样
我该怎么做?
最佳答案
试试这个:
<style>
div.scroll {
width: 100px;
height: 100px;
overflow: scroll;
}
</style>
看看,这是否解决了您的问题。
关于html - 修复 <Pre> 的大小并使其在 html 中可滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27873560/