CSS min-width -Eigenschaft funktioniert nicht

Ich habe Folgendes problem:
Ich habe div-Element, das andere Elemente enthält und die ich versuche zu machen seine Breite abhängig vom Inhalt. Ich auch einschränken, die maximale Breite dieses div. Ich benutze min-width und max-width im CSS, aber es scheint, dass min-width funktioniert nicht. Die Breite des div ist immer die max-width Wert, egal was der Inhalt ist.

Beispiel:

Ich würde gerne das weiße div (das ist das Haupt-div, war ich Rede) streng um die form, in der es, ohne Leerstellen auf der linken und rechten Seite. Ich gab das Formular Stil max-width:500px zu zeigen, dass, auch wenn der Inhalt gering ist, die Haupt-div die gleiche bleibt.

HTML

<div class="gInnerBox sInnerBoxMain">
    <form style="max-width:500px; margin-left: auto; margin-right: auto">            
        <div id='content'>
                   <!-- CONTENT -->
        </div>
    </form>
</div>

CSS

.gInnerBox{
    position: relative;
    background-color: #fff;
    opacity: 0.9;
    padding: 10px 10px 10px 10px;    

    box-shadow: -5px -5px 20px #000, 5px 5px 20px #000;
    -moz-box-shadow: -5px -5px 20px #000, 5px 5px 20px #000;
    -webkit-box-shadow: -5px -5px 20px #000, 5px 5px 20px #000;

    border: 1px solid #000;
    border-radius: 20px;
    -moz-border-radius: 20px;
    -webkit-border-radius: 20px;
}

.sInnerBoxMain{
    max-width: 1000px;
    min-width: 500px;
    margin-left: auto;
    margin-right: auto;
    top: 50px;
}

Beispiel http://wstaw.org/m/2011/11/25/ttt.png

InformationsquelleAutor der Frage vizzdoom | 2011-11-24

Schreibe einen Kommentar