CSS问题

时间:2016-03-16 11:52:39

标签: html css angularjs doctype

自从添加<!DOCTYPE html>以来,我一直有css问题 -

我知道我知道。我应该从一开始就包括doctype - 但我没有。我认为这个问题可能出现在网格(复数 - 网格)div中 - 可能与高度有关。为什么我认为这是因为页面的其余部分完美呈现。查询网格时显示没有数据,似乎高度为0,带有未样式的标题。

这里是网格div的代码 -

<div style="height: 100%; clear: left; width: 100%">

  <div style="min-width: 630px">

    <img ng-show="loaded == false" src="js/angular/assets/img/loading.gif" style="width: 536px; height: 224px; display: block; margin-left: auto; margin-right: auto" />

    <img ng-show="error == true" src="js/angular/assets/img/error.png" style="width: 90px; height: 90px; display: block; margin-left: auto; margin-right: auto" />

  </div>
  <div ng-show="boxDataGrid == true && loaded == true" style="clear: both;">

    <div ag-grid="gridOptions1" class="ag-fresh" ng-style="expanded ? {width: '1550px'} : {}"></div>

  </div>

  <div ng-show="ladderGrid == true && loaded == true" style="clear: both;">

    <div ag-grid="gridOptions4" class="ag-fresh" style="height: 100%; width: 100%"></div>

  </div>

  <div ng-show="ladderDataGrid == true && loaded == true" style="clear: both;">

    <div ag-grid="gridOptions5" class="ag-fresh" style="height: 100%; width: 100%"></div>

  </div>

</div>

是否有任何东西可以让任何人需要改变?

2 个答案:

答案 0 :(得分:4)

高度不能为%,你必须像高度一样手动给它:400px;。

答案 1 :(得分:0)

我们不能给予100%的高度而不给予Position:absolute;或位置:固定;因此,如果我们不使用它们,我们就不能以%为单位给出高度。

现在使用px或em或任何其他值。

<div style="height: 500px; clear: left; width: 100%">

  <div style="min-width: 630px">

    <img ng-show="loaded == false" src="js/angular/assets/img/loading.gif" style="width: 536px; height: 224px; display: block; margin-left: auto; margin-right: auto" />

    <img ng-show="error == true" src="js/angular/assets/img/error.png" style="width: 90px; height: 90px; display: block; margin-left: auto; margin-right: auto" />

  </div>
  <div ng-show="boxDataGrid == true && loaded == true" style="clear: both;">

    <div ag-grid="gridOptions1" class="ag-fresh" ng-style="expanded ? {width: '1550px'} : {}"></div>

  </div>

  <div ng-show="ladderGrid == true && loaded == true" style="clear: both;">

    <div ag-grid="gridOptions4" class="ag-fresh" style="height: 100%; width: 100%"></div>

  </div>

  <div ng-show="ladderDataGrid == true && loaded == true" style="clear: both;">

    <div ag-grid="gridOptions5" class="ag-fresh" style="height: 100%; width: 100%"></div>

  </div>

</div>