2011-01-14 14 views

答えて

2

あなたの現在のCSSにこれを追加します。

.abs { 
    width: 100%; 
} 
.box { 
    width: 220px; 
    margin: auto; 
} 
+0

それだけです。あなたは私の一日を救った。どうもありがとうございます。私はそれをできるだけ早く答えてマークします。ありがとうございました。 – qlib

1
.background1{ 
    margin:auto; 
    background-color:#000000; 
    min-width:100%; 
    min-height:500px; 
} 
.bgcolor { 
    position:relative; 
    width:100%; 
    height:100%; 
    background-color:#000000; 
    opacity:0.5; 
} 
.abs { 
    display:block; 
    margin:auto; 
    width:100%; 
    height:500px; 
} 
.box { 
    margin:auto; 
    position: relative; 
    width:220px; 
    height:80px; 
    background-color:#ffffff; 
    border:1px solid grey; 
} 
+0

私はそれを追加しましたが、何も起こりませんでした。何が間違っていたのですか?http://jsfiddle.net/7AUy7/1/ – qlib

+0

編集を参照してください! nawreは私にそれを打つ! – benhowdle89

0
.abs{ 
    position: aboslute; 
    width: 100%; 
} 

.box{ 
    /*either use*/ 
    width: 220px; /*or larger for fixed width*/ 
    /*or use*/ 
    max-width: 400px; /*or any other size to give it a flexible auto size*/ 

    margin: auto; /* or margin: 0 auto 0 auto;*/ 
} 

古いIEのバージョンでは、このような構築物を許可していません。その場合は、次のものを追加する必要があります。

.abs{ 
    text-align: center; 
} 
.box{ 
    text-align: left; 
} 

下位互換性のために、次のものを追加する必要があります。

関連する問題