div inside another div , actually over the bottom slice

Reply

Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

div inside another div , actually over the bottom slice

 
0
  #1
Jul 14th, 2006
hi,

Wishes.

This is part of code i would like to work it out.

[html]<div >
<div id="titDiv"><?php echo $params->get('title');?></div>
<div id="layer0" style="position: absolute; border: 1px; width: 200; height: 460></div>
<div id="Layer1" style="position:relative; width:136px; height:177px; z-index:1; left: 0px; top: 0px;"><img src="http://127.0.0.1/images/overlay.gif" width="630" height="35">
</div>[/html]

I want layer 1 at the bottom of the layer0 div , and also always relative to layer0. If we minimize the window or change the size of the layer0 div, layer1 should be relative to the change always not like abosute.

Anyone have any idea in this regard how to do it. I am gonna mad with these DIV's..

I request experts help with this ...

regards

Harish
Last edited by tgreer; Jul 17th, 2006 at 12:19 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: div inside another div , actually over the bottom slice

 
0
  #2
Jul 14th, 2006
Not sure if I've understood your requirements correctly:rolleyes:

To 'fix' layer1 to the bottom of layer0 try this:
HTML and CSS Syntax (Toggle Plain Text)
  1. /* CSS */
  2. #layer0 {
  3. background: red;
  4. width: 200px;
  5. height: 460px;
  6. }
  7.  
  8. #Layer1 {
  9. position:relative;
  10. top: 100%;
  11. width:136px;
  12. height:177px;
  13. margin-top: -177px;
  14. z-index:1;
  15. background: blue;
  16. }
HTML and CSS Syntax (Toggle Plain Text)
  1. <!-- HTML -->
  2. <div id="layer0">
  3. <div id="Layer1"></div>
  4. </div>
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

Re: div inside another div , actually over the bottom slice

 
0
  #3
Jul 14th, 2006
hi ,
ataching a snap of output needed.

regards

Harish
Attached Thumbnails
div.GIF  
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: div inside another div , actually over the bottom slice

 
1
  #4
Jul 14th, 2006
The following should give you the structure for the layout.
HTML and CSS Syntax (Toggle Plain Text)
  1. /* CSS */
  2. #titDiv {
  3. background: green;
  4. padding: 10px;
  5. }
  6.  
  7. #titDiv p {
  8. float: left;
  9. }
  10.  
  11. #layer0 {
  12. float: right;
  13. background: #fff;
  14. height: 460px;
  15. }
  16.  
  17. #layer1 {
  18. position:relative;
  19. top: 100%;
  20. margin-top: -35px;
  21. width:630px;
  22. height:35px;
  23. z-index:1;
  24. background: blue;
  25. }
  26.  
  27. /* easy clearing */
  28.  
  29. .clearfix:after {
  30. content: ".";
  31. display: block;
  32. height: 0;
  33. clear: both;
  34. visibility: hidden;
  35. }
  36.  
  37. .clearfix { display: inline-table; }
  38.  
  39. /* Hides from IE-mac \*/
  40. * html .clearfix {height: 1%;}
  41. .clearfix {display: block;}
  42. /* End hide from IE-mac */
HTML and CSS Syntax (Toggle Plain Text)
  1. <!-- HTML -->
  2. <div id="titDiv" class="clearfix">
  3. <p>div #titDiv</p>
  4. <div id="layer0">
  5. <p>div #layer0</p>
  6. <div id="layer1">
  7. <img src="" />
  8. </div>
  9. </div>
  10. </div>
Keep in mind though that any elements placed inside these divs will need to be floated to maintain the layout.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

Re: div inside another div , actually over the bottom slice

 
0
  #5
Jul 15th, 2006
Hi latinboy,

You gave me the exact solution i was looking for and help me know something new on this. Thanks and regards

Harish
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

Re: div inside another div , actually over the bottom slice

 
0
  #6
Jul 17th, 2006
Hi latin,

Well when i added content to the div , on load it does fine but once content loading happends the bottom div is not seen.

why onload it worked fine and not later.. the layer1 dic loads fine at bottom of the layer0 but once the content gets in to the div layer0 layer1 div is not seen.

plz help me...again
Last edited by hbmarar; Jul 17th, 2006 at 3:56 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: div inside another div , actually over the bottom slice

 
0
  #7
Jul 17th, 2006
Would need to see the page as you have it to answer accurately.

Provide a link to the page, or attach as file.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC