How to rid of empty div that contains a GridView

前端 未结 8 757
时光说笑
时光说笑 2021-01-11 18:21

In ASP.NET Gridviews generate a table which generates a parent div container. This can break CSS layouts since there is no way to attach styles to the generated div. Is ther

8条回答
  •  清酒与你
    2021-01-11 18:59

    If you're stuck with an unstyled wrapper (which it appears that you are) but want to enforce a style, give it another wrapper, and apply your style to the combination. If a plain div has some padding you want to get rid of (for example), this in the aspx:

    and this for CSS:

    div#crushGvDiv, div#crushGvDiv div { padding: 0; margin: 0; }
    

提交回复
热议问题