Expand|Select|Wrap|Line Numbers
- <style>
- #div1 {
- position: absolute;
- top: 50px;
- left: 50px;
- width: 200px;
- height: 200px;
- }
- .content{
- position: absolute;
- top :30px;
- left:30px;
- }
- </style>
<div id="div1">
This is the text of parent.
<div class="content">
This is the text of content1.
This is the text of content1.
</div>
<div class="content">
This is the text of content2.
This is the text of content2.
</div>
</div>
[/html]
In general, div1 often has a relative position. But I must set it with absolute position.
I want to ask that: if doing like that, is it correctly? I don't know what happen with it's children element. I don't care about the parent elements of div1