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.
精彩评论