8 views
CSSAdd prefixes
1.card { 2 width: 350px; 3 background: white; 4 padding: 20px; 5 position: relative; 6} 7 8.card .title { 9 color: black; 10 font-size: 2rem; 11 font-weight: 600; 12} 13 14.card .description { 15 color: black; 16 margin-top: 10px; 17 margin-bottom: 20px; 18} 19 20.card .prefs { 21 color: blue; 22} 23 24.card .actions { 25 margin-top: 10px; 26 display: flex; 27 justify-content: space-between; 28 align-items: center; 29 font-size: .8em; 30} 31 32.card button { 33 border: 1px solid; 34 border-radius: 4px; 35 padding: 5px; 36 background: none; 37 font-size: 1.2em; 38 font-weight: bold; 39} 40 41.card .decline { 42 border-color: red; 43 color: red; 44} 45 46.card .decline:hover { 47 background-color: red; 48 color: white; 49} 50 51.card .valid { 52 border-color: green; 53 color: green; 54} 55 56.card .valid:hover { 57 background-color: green; 58 color: white; 59} 60 61.card div::before, div::after { 62 content: ""; 63 z-index: -1; 64 position: absolute; 65 bottom: 15px; 66 left: 10px; 67 width: 50%; 68 top: 80%; 69 max-width: 300px; 70 background: rgba(0,0,0,0.7); 71 -webkit-box-shadow: 0 15px 10px rgba(0,0,0,0.7); 72 box-shadow: 0 15px 10px rgba(0,0,0,0.7); 73 -webkit-transform: rotate(-3deg); 74 transform: rotate(-3deg); 75} 76 77.card div::after { 78 right: 10px; 79 left: unset; 80 transform: rotate(3deg); 81}
HTML
1<div class="card"> 2 <span class="title">🍪 Cookie Notice</span> 3 <p class="description">We use cookies to ensure that we give you the best experience on our website. <a href="#">Read cookies policies</a>. </p> 4 <div class="actions"> 5 <a class="prefs"> 6 Manage preferences 7 </a> 8 <button class="decline"> 9 Decline 10 </button> 11 <button class="valid"> 12 Accept 13 </button> 14 </div> 15</div>