tags:

views:

46

answers:

3

I'm gonna create two div tags with CSS that appear in the page like below :

alt text

Would you please guide me, how I should write the CSS codes?
Thanks.

A: 

Update: Fixed For Two DIVs

Demonstration :)

Please see the source code...

Sarfraz
Thanks. Can't we create it just with two `Div` tags? Isn't it possible?
Mohammad
@Mohammad: just working on that....
Sarfraz
@Mohammad: done plz check the link in my answer :)
Sarfraz
@Sarfraz, you're still using 3 divs in your answer. I believe the questioner needs to do it with 2 divs
Naeem Sarfraz
@Naeem Sarfraz: i did not spot that in the question. you are right, thanks anyways
Sarfraz
@Naeem Sarfraz: fixed for two divs :) thanks man ;-)
Sarfraz
Thanks a lot my friend. I could resolve my problem.
Mohammad
@Mohammad: you are welcome
Sarfraz
+2  A: 

try this

 #div-01
    {
      position :absolute;
      top:0px;
      left:0px;
      height:600px;
      width:800px;
      background-color:gray;
    }   

    #div-02
    {
      position :absolute;
      top:0px;
      left:200px;
      height:500px;
      width:400px;
      background-color:yellow;
    }
Vibin Jith
+1  A: 

I suggest this

#div-01 
{ 
  z-index:1;
  height:300px; 
  width:800px; 
  background-color:gray; 
}    

#div-02 
{ 
  z-index:2;
  height:500px; 
  width:400px; 
  background-color:yellow; 
} 

<div id="div-01">
    <div id="div-02"></div>
</div>
Nasser Hadjloo