html - 显示 : inline; fails when <form> is present

标签 html css

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/

相关文章:

html - Bootstrap 3 轮播不工作

javascript - 在javascript中获取设备宽度

java - 使用 Table 标签为 gmail 和 yahoo 设计模板?

javascript - 两个提交按钮,其中一个始终隐藏,如何按 Enter 并使用正确的提交按钮

javascript - 使用带有样式组件的自定义组件时无法触发 onClick 函数

html - Bootstrap - 表CSS问题

css - 如何在 Angular 单元测试中访问 .css 文件中存在的样式

html - Chrome CSS 问题

html - CSS表格单元格在div上有空间

html - 页脚不在底部