今、私のdiv content
は水平方向にのみセンタリングされていますが、垂直方向にもアライメントすることを目指しています。 MacとiOSのSafariとAndroidのChromeでテストしました。フレックスボックス垂直アライメントが動作しない
ここに私のCSSがあります。
html, body {
height: 100%;
}
body {
background: #002560;
background: linear-gradient(to bottom right, #002560, #0c182b);
margin: 0;
background-repeat: no-repeat;
background-attachment: fixed;
font-family: 'Lato', sans-serif;
color: white;
}
私のHTMLはこのように見えます。ここで
<div style="display:flex;align-items:center;justify-content:center;" id="content">
<div>
<h1>I'd love to be centre aligned correctly.</h1>
</div>
</div>
は、私はiOSの(および他のプラットフォーム)上で見ているものです。
。 –
@JulianEspinosa * facepalm *これを拾ってくれてありがとう、私はよく知っているはずです! –