Home html css Ribbon - HTML CSS Ribbon - HTML CSS Author - thinhphamvn December 30, 2022 0 Ribbon - HTML CSSresultindex.htmlstyle.css>>> Download Source Code (Google Drive) Ribbon | HTML CSS ribbon * { margin: 0; padding: 0; box-sizing: border-box; } body { min-height: 100vh; display: flex; justify-content: center; align-items: center; background-color: #f0f0f0; background-image: url('background.png'); background-size: 400px; } .box { position: relative; max-width: 600px; width: 90%; height: 400px; background: linear-gradient(145deg, #2c374d, #000c18); box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); } .ribbon { width: 150px; height: 150px; overflow: hidden; position: absolute; } .ribbon::before, .ribbon::after { position: absolute; z-index: -1; content: ''; display: block; border: 5px solid #c00105; } .ribbon span { position: absolute; display: block; width: 225px; padding: 15px 0; color: white; background-color: red; font: 700 18px/1 cursive; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); text-transform: uppercase; text-align: center; } .top__left { top: -10px; left: -10px; } .top__left::before, .top__left::after { border-top-color: transparent; border-left-color: transparent; } .top__left::before { top: 0; right: 0; } .top__left::after { bottom: 0; left: 0; } .top__left span { right: -25px; top: 30px; transform: rotate(-45deg); } Tags html css Facebook Twitter Whatsapp Newer Older