Adjust CSS in the browser-independent page

0

I have a function on a page (ASP.NET) that calls another as a popup:

BtnFinalize.OnClientClick="javascript: DisplayPopupMobile ('/ ShoppingCart / Form.aspx', 900,580); return false;";

Using Chrome is coming correct, centered on the page, but if using Firefox is different, it's being applied to a div that controls everything ID="colorbox"

How could I set a browser-independent default value

element.style {
    display: block;
    visibility: visible;
    top: 42px;
    left: 502px;
    position: fixed;
    width: 900px;
    height: 580px;
    overflow: hidden;
}
    
asked by anonymous 03.04.2017 / 19:33

1 answer

0

If all you want is to center the element on the page, then a value in px for top and left is not the best option.

then try to use the following css : top: 50%; left: 50%; transform: translate(-50%, -50%);

.centro {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

html, body {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: whitesmoke;
  padding: 0px;
  margin: 0px;
}

.bloco {
  background-color: white;
  box-shadow: 0px 0px 10px black;
  width: 240px;
  height: 180px;
  border-radius: 5px;
}
<div class="bloco centro">
</div>
    
03.04.2017 / 19:44