display: inline;
<form>
时失败存在
它没有并排排列。
ul#custom {
float:right;
width:100%;
padding:0;
margin:0;
list-style-type:none;
}
#custom li{
display: inline;
}
<ul id="custom"><li>
<form name="form1" method="post" action="checklogin.php">
<label for="field_1">Login ID (Your Email)</label>
<input type="text" name="myusername" id="field_1" class="short" />
<label for="field_1">Password</label>
<input type="password" name="mypassword" id="field_1" class="short" />
<input type="submit" class="submit" value="Login" />
</form>
</li> <li> **should appear right beside the login form not under it. **</li></ul>
最佳答案
ul li { display:inline-block; }
完美运行。
关于html - 显示 : inline; fails when <form> is present,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1611059/