tags:

views:

40

answers:

2

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" value="an edit bx">
</div>

see also related question http://stackoverflow.com/questions/3183297/i-have-a-basic-problem-understanding-css-positioning/3225332#3225332

+2  A: 

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>
Pranay Rana
Mawg
+1  A: 

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.

Salil