Does the input inside with the display unit look not very good, why?

When I put input

c type=text

into an element li

with display:block

I get weird results? Here's an example:

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

      

For the former, input

I can only see the bullet when input

focused, but inside input

. For the second, input

it is not on the same line as the parent mark li

.

Can someone explain this and can suggest a fix?

thank

+3


source to share


2 answers


Using



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

      

+3


source


try without style = "display: block"



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

      

+1


source







All Articles