{"id":1181,"date":"2026-05-14T17:47:16","date_gmt":"2026-05-14T17:47:16","guid":{"rendered":"https:\/\/asklagaffe.com\/index.php\/2026\/05\/14\/computing-and-displaying-discounted-prices-in-css\/"},"modified":"2026-05-14T17:47:16","modified_gmt":"2026-05-14T17:47:16","slug":"computing-and-displaying-discounted-prices-in-css","status":"publish","type":"post","link":"https:\/\/asklagaffe.com\/index.php\/2026\/05\/14\/computing-and-displaying-discounted-prices-in-css\/","title":{"rendered":"Computing and Displaying Discounted Prices in CSS"},"content":{"rendered":"<p><strong>Ask La Gaffe source note:<\/strong> Official signal from CSS-Tricks. Filed under <em>12 Coding &amp; Web \u2014 Web Lab<\/em> for the 1337 \/ Ask La Gaffe Creative Media Academy.<\/p>\n<blockquote><p>A clever use of CSS to calculate and display a discounted product price by providing a base price and discount amount, featuring modern CSS features like attr(), mod(), and round(). Computing and Displaying Discounted Prices in CSS originally handwritten and published with love on CSS-Tricks. You should really get the newsletter as well.<\/p><\/blockquote>\n<p><strong>Original source:<\/strong> <a href=\"https:\/\/css-tricks.com\/computing-and-displaying-discounted-prices-in-css\/\" target=\"_blank\" rel=\"nofollow noopener\">CSS-Tricks<\/a><\/p>\n<p class=\"alg-source-disclaimer\"><em>This post is an attributed source pointer and short excerpt, not a full republication of the original article.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A clever use of CSS to calculate and display a discounted product price by providing a base price and discount amount, featuring modern CSS features like attr(), mod(), and round(). Computing and Displaying Discounted Prices in CSS originally handwritten and published with love on CSS-Tricks. You should really get the newsletter as well.<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[163,44,139,164,209,43,141,208],"class_list":["post-1181","post","type-post","status-publish","format-standard","hentry","category-12-coding-web-web-lab","tag-12-coding-web-web-lab","tag-44","tag-ask-la-gaffe","tag-coding-web-creation","tag-css-tricks","tag-official-source","tag-purple","tag-tutorial-front-end-craft"],"_links":{"self":[{"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/posts\/1181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/comments?post=1181"}],"version-history":[{"count":0,"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/posts\/1181\/revisions"}],"wp:attachment":[{"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/media?parent=1181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/categories?post=1181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/asklagaffe.com\/index.php\/wp-json\/wp\/v2\/tags?post=1181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}