Advertisement
pusatdata

Aneka Kotak Rounded

Apr 7th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Demo: Pure CSS folded-corner effect &#8211; Nicolas Gallagher</title>
  6. <meta name="description" content="Create a simple CSS folded-corner effect using pseudo-elements. Semantic HTML and no images.">
  7. <link rel="canonical" href="/pure-css-folded-corner-effect/demo/">
  8. <style>
  9.  
  10.  
  11.  
  12. /* == START FOLDED CORNERS */
  13.  
  14. .note {
  15. position:relative;
  16. width:480px;
  17. padding:1em 1.5em;
  18. margin:2em auto;
  19. color:#fff;
  20. background:#97C02F;
  21. overflow:hidden;
  22. }
  23.  
  24. .note:before {
  25. content:"";
  26. position:absolute;
  27. top:0;
  28. right:0;
  29. border-width:0 16px 16px 0; /* This trick side-steps a webkit bug */
  30. border-style:solid;
  31. border-color:#fff #fff #658E15 #658E15; /* A bit more verbose to work with .rounded too */
  32. background:#658E15; /* For when also applying a border-radius */
  33. display:block; width:0; /* Only for Firefox 3.0 damage limitation */
  34. /* Optional: shadow */
  35. -webkit-box-shadow:0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
  36. -moz-box-shadow:0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
  37. box-shadow:0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
  38. }
  39.  
  40. .note.red {background:#C93213;}
  41. .note.red:before {border-color:#fff #fff #97010A #97010A; background:#97010A;}
  42.  
  43. .note.blue {background:#53A3B4;}
  44. .note.blue:before {border-color:#fff #fff transparent transparent; background:transparent;}
  45.  
  46. .note.taupe {background:#999868;}
  47. .note.taupe:before {border-color:#fff #fff #BDBB8B #BDBB8B; background:#BDBB8B;}
  48.  
  49. /* ROUNDED CORNERS VERSION
  50. * All modern browsers can produce this effect with a single pseudo-element.
  51. * However, they all have bugs (mainly to do with border-radius) that make this a bit tricky.
  52. * As far as I can tell, this is the only cross-browser method for the moment.
  53. * Cant use this method for the simple effect because Opera 11 will only show backgrounds
  54. * through transparent borders if there is a border-radius applied.
  55. */
  56.  
  57. .note.rounded {
  58. -webkit-border-radius:5px 0 5px 5px;
  59. -moz-border-radius:5px 0 5px 5px;
  60. border-radius:5px 0 5px 5px;
  61. }
  62.  
  63. .note.rounded:before {
  64. border-width:8px; /* Triggers a 1px 'step' along the diagonal in Safari 5 (and Chrome 10) */
  65. border-color:#fff #fff transparent transparent; /* Avoids the 1px 'step' in webkit. Background colour shows through */
  66. -webkit-border-bottom-left-radius:5px;
  67. -moz-border-radius:0 0 0 5px;
  68. border-radius:0 0 0 5px;
  69. }
  70.  
  71. .note p {margin:0;}
  72. .note p + p {margin:1.5em 0 0;}
  73. /* == END FOLDED CORNERS */
  74.  
  75.  
  76. </style>
  77.  
  78. </head>
  79.  
  80. <body>
  81.  
  82. <div class="container header">
  83. <header>
  84. <hgroup>
  85. <h1>Pure CSS folded-corner effect</h1>
  86. <h2>By <a href="http://nicolasgallagher.com">Nicolas Gallagher</a></h2>
  87. </hgroup>
  88. <p><em>Known support</em>: Firefox 3.5+, Chrome 4+, Safari 4+, Opera 10+, IE 8+.</p>
  89. </header>
  90. </div>
  91.  
  92. <div class="note">
  93. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pulvinar rhoncus risus, vel ornare lacus sagittis sit amet. Duis vel sem magna. Proin pulvinar velit eleifend ligula ultrices vestibulum. Nunc posuere dolor eu mauris feugiat dignissim.</p>
  94. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pulvinar rhoncus risus, vel ornare lacus sagittis sit amet. Duis vel sem magna. Proin pulvinar velit eleifend ligula ultrices vestibulum. Nunc posuere dolor eu mauris feugiat dignissim.</p>
  95. </div>
  96.  
  97. <div class="note red rounded">
  98. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pulvinar rhoncus risus, vel ornare lacus sagittis sit amet. Duis vel sem magna. Proin pulvinar velit eleifend ligula ultrices vestibulum. Nunc posuere dolor eu mauris feugiat dignissim.</p>
  99. </div>
  100.  
  101. <div class="note blue">
  102. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pulvinar rhoncus risus, vel ornare lacus sagittis sit amet. Duis vel sem magna. Proin pulvinar velit eleifend ligula ultrices vestibulum. Nunc posuere dolor eu mauris feugiat dignissim.</p>
  103. </div>
  104.  
  105. <div class="note taupe">
  106. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pulvinar rhoncus risus, vel ornare lacus sagittis sit amet. Duis vel sem magna. Proin pulvinar velit eleifend ligula ultrices vestibulum. Nunc posuere dolor eu mauris feugiat dignissim.</p>
  107. </div>
  108.  
  109. <div class="container footer">
  110. <p>Read the article: <a href="/pure-css-folded-corner-effect/">Pure CSS folded-corner effect</a>.</p>
  111. <p class="follow"><a href="https://twitter.com/necolas">You can find me on <span>Twitter</span></a>.</p>
  112. </div>
  113.  
  114. </body>
  115. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement