开发者

HTML forms / CSS - should "position" be on the enclosing DIV or the enclosed control?

Which is correct?

<div class="TEdit" id="Edit1" style="position: absolute; left: 200px; top: 100px;">
    <input type="text" name="Edit1" value="an edit bx">
</div>

or

<div class="TEdit" id="Edit1" >
    <input type="text" style="position: absolute; left: 200px; top: 100px;" name="Edit1" v开发者_StackOverflow中文版alue="an edit bx">
</div>

see also related question I have a basic problem understanding CSS positioning


First one is correct because div is parent tag:

<div class="TEdit" id="Edit1" style="position: absolute; left: 200px; top:  
 100px;"><input type="text" name="Edit1" value="an edit bx"></div>


First one is correct.

Position should given to the DIV not onlt because it is a parent tag but also it's a content tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜