# Min-width/min-height problem

**URL:** <https://forum.kirupa.com/t/min-width-min-height-problem/317111>\
**Category:** Uncategorized\
**Created:** [December 10, 2010, 7:08pm UTC](https://forum.kirupa.com/t/min-width-min-height-problem/317111 "2010-12-10T19:08:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![outback](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@outback](https://forum.kirupa.com/u/outback)\
**Post date:** [December 10, 2010, 7:08pm UTC](https://forum.kirupa.com/t/min-width-min-height-problem/317111/1 "2010-12-10T19:08:08Z")

</div>

Hi All,

Sorry for my bad english, I’m having a huge problem on centering a DIV

```auto

#myDiv {
    position: absolute;
    background-color: #333;
    width:100%;
    min-width: 960px;
    height: 100%;
    min-height:550px;
    left:50%;
    top:50%;
    margin-left: - /* I need a function that gives me half of the div width here */ px;
    margin-top: - /* I need a function that gives me half of the div height here */ px;
}

```

Can anyone please HELP?

Thanks por your attention!!!

Best regards!
