1

如何将 GridView 的正方形更改为圆形,或者是否可以在圆形对象上显示 gridview 或说图像?

我试图:-

1-add cssclass to the gridview where css class had a line of code for a background image
2-applied headerclass css to the gridview and gave the image source there.
3-applied a backimage property to the Grid.
(the image in all the 3 cases was a circle)

CSS是

    .circle{ background:url(circle.png); opacity:0.5;height:176px;width:176px;} 

我试图GridView在 Visual Studio 10 的我的 aspx 页面中插入

但似乎没有什么能按我想要的方式工作。GridView 单元格在前 2 个案例中未对齐。

如果可能的话,请给我一个正确的方法。

提前致谢

4

1 回答 1

1

You don't have to use an image, just use CSS to form a circle, for example

.circle {
    width: 320px;
    height: 320px;
    background: LightPink;
    -moz-border-radius: 160px;
    -webkit-border-radius: 160px;
    border-radius: 160x;
}

Also, don't change shape of the grid itself - it may cause misalignments. Place the grid inside of a DIV with above class applied.

Demo: http://jsfiddle.net/pnFGt/

于 2013-09-18T14:10:44.767 回答