私はこれらの入力フィールドを応答的に中央に配置しようとしていますが、少し問題があります。誰かが私がどこに間違っているかもしれないかを教えてもらえますか?私は親divとコンテナ要素を作成しようとしましたが、 "margin:0"は機能していないようです。センターフォームの入力が応答します
HTML
<div id="settings-info">
<div class="settings-info-container">
<form enctype="multipart/form-data" id="userUpdateForm">
<input type="text" id="userFnameValue" class="userInfoValues" placeholder="First Name"
value="{{ userSettings[0]['fName'] }}"/> <br>
<input type="text" id="userLnameValue" class="userInfoValues" placeholder="Last Name"
value="{{ userSettings[0]['lName'] }}"/> <br>
<input type="text" id="userLocalValue" class="userInfoValues" placeholder="Location"
value="{{ userSettings[0]['userLocation'] }}"/> <br>
<input type="text" id="userNameValue" class="userInfoValues" placeholder="UserName"
value="{{ userSettings[0]['userName'] }}"/><br>
<input type="text" id="userGenderValue" class="userInfoValues" placeholder="Gender"
value="{{ userSettings[0]['userGender'] }}"/> <br>
<input type="text" id="userEmailValue" class="userInfoValues" placeholder="Email"
value="{{ userSettings[0]['emailAddress'] }}"/><br>
<div id="info-pref-sub-btn">
<span id="info-pref-sub-text">Update Info</span>
</div>
</form>
</div>
</div>
CSS
#settings-info{
position: absolute;
top: 395px;
background-color: rgba(0, 0, 0, 0.84);
/*background-color: red;*/
width: 100%;
}
.settings-info-container{
position: relative;
width: 100%;
background-color: rgba(0, 0, 0, 0.84);
/*background: green;*/
}
.userInfoValues{
position: relative;
font-size: 120%;
text-align: center;
left: 9%;
width: 82%;
/*width: 250px;*/
height: 38px;
margin: 12px auto 18px;
border-radius: 8px;
border: 2px solid white;
opacity: 0.5;
background: #000;
color: white;
}
/*same as our access and details submit button...may want to put in a class*/
#info-pref-sub-btn {
position: relative;
width: 100%;
height: 60px;
color: white;
font-size: 145%;
font-weight: bold;
background-color: #0070a3;
border: 0;
border-radius: 1px;
text-align: center;
}
#info-pref-sub-text{
position: relative;
top: 30%;
}
中央にないものは何ですか?フィドルはよく見える – Huangism
ですか?私はクロムでそれを実行しているとクロムのように見えるが、iphone5と6でそれはオフに見えると右に向かって見える。 – stingMantis