【问题标题】:Gridview blank space when zoom out缩小时的Gridview空白
【发布时间】:2018-11-18 09:06:58
【问题描述】:

我在 asp.net 中有一个 gridview。当我缩小页面时,gridview 中会出现一个空白区域,如image 所示。如何解决?

css代码:

.module {
border: 1px solid #9BA0AF;
margin: 0;
margin-top: 0px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 15px;
background: #ffffff;
position:static;
height: 100%;
width:100px;
background-size: contain;
 }

.moduleheader {
height: 38px;
width: 100%;
background: #F1F1F4 url(../images/secondary_bar.png) repeat-x;
background-position: left top;
background-repeat: repeat-x;
background-size: 100% 100%;
}

我在 div 元素内的 gridview 上方也有 css 代码。

<div style="border: 1px solid #9BA0AF; width:30%; margin: 20px 3% 0 3%;      background-color:white;
        border-radius: 15px 15px 15px 15px;
        -moz-border-radius: 5px 5px 5px 5px;
        -khtml-border-radius: 5px 5px 5px 5px;
        -webkit-border-radius: 5px 5px 5px 5px;
        overflow: hidden !important; position:static; background-size: 100% 100%;">
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="false" GridLines="None" RowStyle-Wrap="false">

提前致谢。

【问题讨论】:

    标签: css asp.net gridview


    【解决方案1】:

    我找到了解决办法!我在 div 中添加了 max-width 属性,如下所示:

    <div style="border: 1px solid #9BA0AF; width:30%; margin: 20px 3% 0 3%; background-color:white;
            border-radius: 15px 15px 15px 15px;
            -moz-border-radius: 5px 5px 5px 5px;
            -khtml-border-radius: 5px 5px 5px 5px;
            -webkit-border-radius: 5px 5px 5px 5px;
            overflow: hidden !important; position:static; background-size: 100% 100%; max-width: 500px;">
    

    【讨论】:

      猜你喜欢
      • 2014-02-27
      • 2019-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多