简体   繁体   English

带有显示块的li内的输入看起来不太好,为什么?

[英]Input within an li with display block doesn't look good, why?

When I put an input with type=text within a li item with display:block I get weird results? 当我在带有display:blockli项目中input type=textinput ,我得到了奇怪的结果? Here is an example: 这是一个例子:

<ul>
    <li><input type="text" value="withvalue" style="display: block" /></li>
    <li><input type="text" style="display: block" /></li>
</ul>

For the first input I can only see the bullet when the input is focused and it's inside the input . 对于第一个input我只能在input被聚焦时看到子弹并且它在input内部。 For the second input , it is not in the same line as the li parent bullet. 对于第二个input ,它与li父级子弹不在同一行。

Can someone please explain it and maybe suggest a fix? 有人可以解释一下,也许建议一个修复?

Thanks 谢谢

使用

<li style = "display:inline;"> ... </li>

try without style="display: block" 尝试没有style =“display:block”

<ul>
    <li><input type="text" value="withvalue" /></li>
    <li><input type="text" /></li>
</ul>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM