私はかなりストレスの多い問題を抱えています。次の図のように、inputというdivクラスを適用して、ユーザー名/パスワードフィールドのボックスのスタイルを設定しました。
ただし、検索バーに別のスタイルを適用したいのですが、インラインスタイルシートを使用しても、古い入力要素のスタイルが使用されます。私はほとんどすべてを試しました。
ログインhtml
<div class="form">
<form name="form1" method="POST" action="login.php">
<div class="input">
<input name="username" id="username" placeholder="Username">
<input name="password" id="password" placeholder="Password">
</div>
<input type="submit" name="Submit" value="Login" class="submit">
</form>
</div>
検索バーのhtml
<div class="ajax-div">
<div class="searchbar">
<input type="text" onKeyUp="getScriptPage('box','text_content')" id="text_content">
</div>
<div id="box"></div>
</div>
その最後のwidth:入力のパラメーターは、ページ上のすべての入力バーの幅を指定します。
.form {
margin-top:-182px;
margin-left:1100px;
position:static;
width: 220px;
height:150px;
padding: 20px;
padding-top:10px;
border: 1px solid #270644;
background:url(bg-right.png);
}
.label {
font-size: 12px;
font-family: arial, sans-serif;
list-style-type: none;
color: #999;
text-shadow: #000 1px 1px;
margin-bottom: 10px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
display: block;
}
input {
/* input boxes*/
-webkit-transition-property: -webkit-box-shadow, background;
-webkit-transition-duration: 0.25s;
padding: 6px;
border-bottom: 0px;
border-left: 0px;
border-right: 0px;
border-top: 1px solid #666;
-moz-box-shadow: 0px 0px 2px #000;
-webkit-box-shadow: 0px 0px 2px #000;
margin-bottom: 10px;
background: #FFF;
width: 130px;
}
検索バーに適用しようとしているCSS:
searchbar {
left: 350px;
top:100px;
width: 300px;
}