CSS로 쿠폰을 만들려면 코드는 다음과 같습니다 -
예시
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } img { width: 100%; } .couponContainer { border: 5px dashed #bbb; width: 80%; border-radius: 15px; margin: 0 auto; max-width: 600px; } .detailContainer { padding: 2px 16px; background-color: #d4d4d4; } .promo { background: rgb(104, 104, 104); color: white; padding: 10px; } .expiryDate { color: red; font-weight: bold; } </style> </head> <body> <div class="couponContainer"> <div class="detailContainer"> <h3>Food Inc ©</h3> </div> <img src="https://images.pexels.com/photos/376464/pexels-photo376464.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"/> <div class="detailContainer" style="background-color:white"> <h2>Worlds Best Pancakes</h2> </div> <div class="detailContainer"> <p> Use code <span class="promo">Free24</span> to get 24% off on your next dish </p> <p class="expiryDate">Expires in 20 days</p> </div> </div> </body> </html>
출력
위의 코드에 의해 다음 출력이 생성됩니다 -