{"id":7596,"date":"2024-01-19T17:01:00","date_gmt":"2024-01-19T17:01:00","guid":{"rendered":"https:\/\/codehim.com\/?p=7596"},"modified":"2024-01-22T15:02:12","modified_gmt":"2024-01-22T10:02:12","slug":"css-code-for-text-decoration","status":"publish","type":"post","link":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/","title":{"rendered":"CSS Code For Text Decoration"},"content":{"rendered":"<p>This CSS code snippet demonstrate five different styles of text decoration property. It is helpful to make decorative text with wavy, dashed, double, dotted, and overline border style. After including this tiny CSS library, you can apply any decorations for your text by just using the class name.<\/p>\n<h2>How to Use CSS Code For Text Decoration<\/h2>\n<p>1. In order to apply text decoration to your text, wrap your text into a span element and define a class name for text decoration. The following are available classes to make different styles of text decorations.<\/p>\n<ol>\n<li>wavy<\/li>\n<li>dashed<\/li>\n<li>double<\/li>\n<li>dotted<\/li>\n<li>over<\/li>\n<\/ol>\n<pre class=\"prettyprint linenums lang-html\">&lt;h1&gt;Fun with &lt;code&gt;text-decoration&lt;\/code&gt;!&lt;\/h1&gt;\r\n\r\n&lt;p&gt;&lt;span class=\"wavy\"&gt;The wavy underline is created with&lt;\/span&gt; &lt;code&gt;text-decoration: wavy underline&lt;\/code&gt;.&lt;\/p&gt;\r\n\r\n&lt;p&gt;&lt;span class=\"dashed\"&gt;A dashed underline uses&lt;\/span&gt; &lt;code&gt;text-decoration: dashed underline&lt;\/code&gt;.&lt;\/p&gt;\r\n\r\n&lt;p&gt;&lt;span class=\"double\"&gt;Add a splash of color...&lt;\/span&gt;&lt;\/p&gt;\r\n\r\n&lt;p&gt;&lt;span class=\"dotted\"&gt;Like this:&lt;\/span&gt; &lt;code&gt;text-decoration: #f44336 dotted underline&lt;\/code&gt;.&lt;\/p&gt;\r\n\r\n&lt;p&gt;&lt;span class=\"over\"&gt;Even put a line &lt;em&gt;above&lt;\/em&gt; the text with&lt;\/span&gt; &lt;code&gt;text-decoration: underline overline&lt;\/code&gt;.&lt;\/p&gt;\r\n\r\n&lt;p&gt;And for letters that drop below the underline (&lt;span class=\"skip\"&gt;the quick brown fox jumps over the lazy dog&lt;\/span&gt;): &lt;code&gt;text-decoration-skip: ink&lt;\/code&gt;.&lt;\/p&gt;\r\n<\/pre>\n<p>2. Add the following CSS styles into your project for all text decorations.<\/p>\n<pre class=\"prettyprint linenums lang-css\">*,\r\n*:before,\r\n*:after {\r\n  box-sizing: border-box;\r\n  margin: 0;\r\n  padding: 0;\r\n}\r\n\r\nbody {\r\n  font: 1.4em\/1.75 sans-serif;\r\n  margin: 1em;\r\n}\r\n.cd__main{\r\n   display: block !important;\r\n}\r\n   \r\nh1 {\r\n  font-size: 1.5em;\r\n  margin-bottom: .5em;\r\n}\r\n\r\np {\r\n  margin-bottom: 1.5em; \r\n  display: block;\r\n}\r\n\r\nli {\r\n  list-style: none;\r\n  padding-bottom: .75em;\r\n}\r\n\r\n.wavy {\r\n  text-decoration: #ec407a wavy underline;\r\n}\r\n\r\n.double {\r\n  text-decoration: #a0f double underline;\r\n}\r\n\r\n.dashed {\r\n  text-decoration: #26a69a dashed underline;\r\n}\r\n\r\n.dotted {\r\n  text-decoration: #d50000 dotted underline;\r\n}\r\n\r\n.over {\r\n  text-decoration: #00c853 overline underline;\r\n}\r\n\r\n.skip {\r\n  text-decoration: #2962ff underline;\r\n  text-decoration-skip: ink;\r\n}\r\n\r\n\/* general styling *\/\r\ncode,\r\npre {\r\n  background-color: rgba(0, 0, 0, 0.04);\r\n  border-radius: 3px;\r\n  font-family: Consolas, \"Liberation Mono\", Menlo, Courier, monospace;\r\n  padding: 3px;\r\n}\r\n\r\ncode {\r\n  white-space: nowrap;\r\n}<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully created decorative text. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This CSS code snippet demonstrate five different styles of text decoration property. It is helpful to make decorative text with&#8230;<\/p>\n","protected":false},"author":1,"featured_media":7613,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[63],"tags":[],"class_list":["post-7596","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5-css3"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSS Code For Text Decoration &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a CSS Code For Text Decoration. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Code For Text Decoration &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a CSS Code For Text Decoration. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-19T17:01:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T10:02:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"CSS Code For Text Decoration\",\"datePublished\":\"2024-01-19T17:01:00+00:00\",\"dateModified\":\"2024-01-22T10:02:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\"},\"wordCount\":136,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png\",\"articleSection\":[\"HTML5 &amp; CSS3\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\",\"url\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\",\"name\":\"CSS Code For Text Decoration &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png\",\"datePublished\":\"2024-01-19T17:01:00+00:00\",\"dateModified\":\"2024-01-22T10:02:12+00:00\",\"description\":\"Here is a free code snippet to create a CSS Code For Text Decoration. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png\",\"width\":1280,\"height\":960,\"caption\":\"CSS Code For Text Decoration\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML5 &amp; CSS3\",\"item\":\"https:\/\/codehim.com\/category\/html5-css3\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CSS Code For Text Decoration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS Code For Text Decoration &#8212; CodeHim","description":"Here is a free code snippet to create a CSS Code For Text Decoration. You can view demo and download the source code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/","og_locale":"en_US","og_type":"article","og_title":"CSS Code For Text Decoration &#8212; CodeHim","og_description":"Here is a free code snippet to create a CSS Code For Text Decoration. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-19T17:01:00+00:00","article_modified_time":"2024-01-22T10:02:12+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"CSS Code For Text Decoration","datePublished":"2024-01-19T17:01:00+00:00","dateModified":"2024-01-22T10:02:12+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/"},"wordCount":136,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png","articleSection":["HTML5 &amp; CSS3"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/","url":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/","name":"CSS Code For Text Decoration &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png","datePublished":"2024-01-19T17:01:00+00:00","dateModified":"2024-01-22T10:02:12+00:00","description":"Here is a free code snippet to create a CSS Code For Text Decoration. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/11\/CSS-Code-For-Text-Decoration.png","width":1280,"height":960,"caption":"CSS Code For Text Decoration"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/html5-css3\/css-code-for-text-decoration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"HTML5 &amp; CSS3","item":"https:\/\/codehim.com\/category\/html5-css3\/"},{"@type":"ListItem","position":3,"name":"CSS Code For Text Decoration"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":1895,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/7596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=7596"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/7596\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/7613"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=7596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=7596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=7596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}