Need to display Update Progress at the center of a Grid view placed in a Ajax Update Panel. Is there a way to place the Update progreass control at the center of the grid view (or else center of the page) with CSS (without using jQuery or Java Script)?

有帮助吗?

解决方案

Put the grid-view and update progress html within a wrapper div. Position div relatively and position the update progress absolutely at center.

See this jsfiddle that I have set up: http://jsfiddle.net/DDdyU/

key styles are

.wrapper
{
    position: relative;
}
.updateProgress
{
    position:absolute;
    top: 50%;
    left: 50%;
    margin-left: -50px;
    margin-right: -20px;
}

negative margins are half size of update-progress.

其他提示

Not with just pure CSS unless you absolutely position the UpdateProgess div in the middle of the GridView. I feel like jQuery would be cleaner if you can use it in your application.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top