Advertisement
itskrystalized

z-index tutorial

Jul 19th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <-- HTML kód -->
  2. <div class="gyokerek">
  3. <div id="zelso">
  4. első</div>
  5. <div id="zmasodik">
  6. második</div>
  7. <div id="zharmadik">
  8. harmadik</div>
  9. </div>
  10.  
  11. <-- CSS kód -->
  12. <style type="text/css">
  13. .gyokerek {
  14. position: relative;
  15. margin: 0 auto;
  16. width: 200px;
  17. height: 160px;
  18. background-color: #f0f0e2;
  19. }
  20.  
  21. #zelso {
  22. position: absolute;
  23. width: 100px;
  24. height: 100px;
  25. background-color: #edc9c7;
  26. color: #ffffff;
  27. text-align: center;
  28. top: 10px;
  29. left: 10px;
  30. z-index: 1;
  31. }
  32.  
  33. #zmasodik {
  34. position: absolute;
  35. width: 100px;
  36. height: 100px;
  37. background-color: #474142;
  38. color: #ffffff;
  39. text-align: center;
  40. top: 30px;
  41. left: 50px;
  42. z-index: 3;
  43. }
  44.  
  45. #zharmadik {
  46. position: absolute;
  47. width: 100px;
  48. height: 100px;
  49. background-color: #b9d7eb;
  50. color: #ffffff;
  51. text-align: center;
  52. top: 50px;
  53. left: 90px;
  54. z-index: 2;
  55. }</style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement