1 Replies - 167 Views - Last Post: 06 June 2018 - 09:16 AM

#1 aspfun   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 109
  • Joined: 16-January 13

CSS scripts to make the panel always locate at center of screen?

Posted 06 June 2018 - 09:09 AM

I inserted a panel into one aspx page and set css as below.
When monitor = 17", it is located at center of screen but when monitor=23" is located at left of screen.
How to modify CSS scripts so that the panel always located at center of screen regardless of monitor size?


<asp:Panel ID="pnlMaster" runat="server" CssClass="map" BackColor="#cfd6e5">

.map {
z-index: 1;
left: 10%;
background-color: lightblue;
position: absolute;
top: 8%;
width: 1052px;
height: 720px;
-moz-border-radius: 10px;
border-radius: 10px;
}

Is This A Good Question/Topic? 0
  • +

Replies To: CSS scripts to make the panel always locate at center of screen?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14924
  • View blog
  • Posts: 59,580
  • Joined: 12-June 08

Re: CSS scripts to make the panel always locate at center of screen?

Posted 06 June 2018 - 09:16 AM

Try setting the left and right margins to 'auto' to have it center.

margin-right:auto; margin-left: auto;

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1