私は、2つのボックスクラスのdivの位置をjustify-contentで指定したいと思います。flex-endですが、上記の残りのスペースに垂直方向にimg-container divを垂直に配置したいのですが、これが可能であれば、好ましくはjavascriptなしではわかりません。ディスプレイでの画像の位置/ divの高さflex
レイアウトは、縦向きのモバイルデバイス向けです。コンテンツを正当化するのは最善のアプローチではないかもしれませんが、フォーム要素を画面の下部に配置して配置するレイアウトが欲しいですが、ロゴ領域からスペースを取って小さなデバイスに応答します。
.flexcontainer {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: flex-end;
justify-content: flex-end;
/*iPhone 4*/
height: 480px;
width:320px;
/*iPhone 6*/
/*height: 667px;
width:375px;*/
background-color: blue;
border: 1px solid red;
}
.box {
text-align:center;
height: auto;
width: 100%;
background-color: green;
border: 1px solid pink;
margin: 3px;
padding-top:20px;
padding-bottom:20px;
margin-top:20px;
margin-bottom:20px;
}
.img-container{
text-align:center;
}
<div class="flexcontainer">
<div class="img-container">
<img src='https://wiki.maemo.org/images/thumb/d/de/Maemo.org_logo_contest_sample1_bundyo.png/300px-Maemo.org_logo_contest_sample1_bundyo.png' width='80%'/>
</div>
<div class="box">
<input type="text" placeholder="username">
<br>
<input type="password" placeholder="password">
<br>
<button>submit</button>
</div>
<div class="box">
<button>password reset</button>
<br>
<button>register</button>
</div>
</div>
返信用のおかげで、私は少し良く私は小さなデバイスを検討したいiphone 4サイズに設定コンテナの幅を持っている最後のビットを説明している必要があります。 iphone 4の高さ/幅をCSSでコメントアウトし、iphone 6サイズを使用すると、ロゴはあなたのjsfiddleで中央から外れます。私は、高さが変わると、空のスペースにロゴを垂直に配置することを望んでいました。 https://jsfiddle.net/gczcorn0/1/ – mao
さて、私はそれを取得します。私はあなたのために私の答えを更新し、うまくいけばそれは今あなたが欲しいものです:) – thepio
偉大なthatsちょうどそれよりも良い – mao