code_junkie

How would you make two <div>s overlap?

Nov 12th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. | |
  2. ---| LOGO |------------------------
  3. | |_______________| LINKS |
  4. | CONTENT |
  5.  
  6. html, body {
  7. margin: 0px;
  8. }
  9.  
  10. #logo {
  11. position: absolute; // reposition logo from the natural layout
  12. left: 75px;
  13. top: 0px;
  14. width: 300px;
  15. height: 200px;
  16. z-index: 2;
  17. }
  18.  
  19. #content {
  20. margin-top: 100px; // provide buffer for logo
  21. }
  22.  
  23. #links {
  24. height: 75px;
  25. margin-left: 400px; // flush links (with a 25px "padding") right of logo
  26. }
  27.  
  28. <div id="logo"><img src="logo.jpg" /></div>
  29. <div id="content">
  30. <div id="links"></div>
  31. </div>
  32.  
  33. <div style="margin-top: -25px;">
  34.  
  35. #logo
  36. {
  37. position: absolute:
  38. z-index: 2000;
  39. left: 100px;
  40. width: 100px;
  41. height: 50px;
  42. }
  43.  
  44. div#logo {
  45. position: absolute;
  46. left: 100px; // or whatever
  47. }
Add Comment
Please, Sign In to add comment