{"id":89,"date":"2026-04-07T01:14:54","date_gmt":"2026-04-07T01:14:54","guid":{"rendered":"https:\/\/gigz.pk\/css\/?post_type=lesson&#038;p=89"},"modified":"2026-04-20T11:45:19","modified_gmt":"2026-04-20T11:45:19","slug":"text-alignment-decoration","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/","title":{"rendered":"Text Alignment &amp; Decoration"},"content":{"rendered":"\n<p>Text alignment and decoration are important CSS properties used to control how text appears on a webpage. They help improve readability, design, and overall user experience.<\/p>\n\n\n\n<p>Text Alignment<\/p>\n\n\n\n<p>Text alignment defines how text is positioned horizontally inside an element.<\/p>\n\n\n\n<p>The text-align property is used for this purpose.<\/p>\n\n\n\n<p>Common values include left, right, center, and justify.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>p {<br>text-align: center;<br>}<\/p>\n\n\n\n<p>In this example, all paragraph text will be centered on the page.<\/p>\n\n\n\n<p>Left alignment is the default and is commonly used for body text.<\/p>\n\n\n\n<p>Center alignment is often used for headings and titles.<\/p>\n\n\n\n<p>Right alignment is useful for specific layouts such as side notes.<\/p>\n\n\n\n<p>Justify alignment spreads text evenly across the width, creating a clean and professional look.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>p {<br>text-align: justify;<br>}<\/p>\n\n\n\n<p>Text Decoration<\/p>\n\n\n\n<p>Text decoration is used to add or remove visual lines from text. It is commonly used for links and emphasis.<\/p>\n\n\n\n<p>The text-decoration property controls this feature.<\/p>\n\n\n\n<p>Common values include underline, overline, line-through, and none.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>h1 {<br>text-decoration: underline;<br>}<\/p>\n\n\n\n<p>This will underline the heading text.<\/p>\n\n\n\n<p>You can also remove the default underline from links.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>a {<br>text-decoration: none;<br>}<\/p>\n\n\n\n<p>Line-through is often used to show deleted or discounted content.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>p {<br>text-decoration: line-through;<br>}<\/p>\n\n\n\n<p>Overline adds a line above the text, which is less commonly used but can be useful in design.<\/p>\n\n\n\n<p>Combining Text Alignment and Decoration<\/p>\n\n\n\n<p>You can use both properties together to style text more effectively.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>h2 {<br>text-align: center;<br>text-decoration: underline;<br>}<\/p>\n\n\n\n<p>This will create a centered heading with an underline.<\/p>\n\n\n\n<p>Conclusion<\/p>\n\n\n\n<p>Text alignment and decoration are simple yet powerful tools in CSS. By using them properly, you can create clean, attractive, and easy-to-read web pages. Practice these properties to improve your web design skills.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/css\/\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">CSS Fundamentals (Beginner) > Typography &#038; Text Styling > Text Alignment &#038; Decoration<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1776685402158\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1776685401913\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n","protected":false},"menu_order":0,"template":"","class_list":["post-89","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Text Alignment &amp; Decoration - CSS learning mastery<\/title>\n<meta name=\"description\" content=\"Learn CSS text alignment and decoration with easy examples. Style text using alignment, underline, and formatting techniques.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Text Alignment &amp; Decoration - CSS learning mastery\" \/>\n<meta property=\"og:description\" content=\"Learn CSS text alignment and decoration with easy examples. Style text using alignment, underline, and formatting techniques.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/\" \/>\n<meta property=\"og:site_name\" content=\"CSS learning mastery\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-20T11:45:19+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/text-alignment-decoration\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/text-alignment-decoration\\\/\",\"name\":\"Text Alignment &amp; Decoration - CSS learning mastery\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\"},\"datePublished\":\"2026-04-07T01:14:54+00:00\",\"dateModified\":\"2026-04-20T11:45:19+00:00\",\"description\":\"Learn CSS text alignment and decoration with easy examples. Style text using alignment, underline, and formatting techniques.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/text-alignment-decoration\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/text-alignment-decoration\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/text-alignment-decoration\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS Fundamentals (Beginner) > Typography & Text Styling > Text Alignment & Decoration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\",\"name\":\"CSS learning mastery\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/css\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Text Alignment &amp; Decoration - CSS learning mastery","description":"Learn CSS text alignment and decoration with easy examples. Style text using alignment, underline, and formatting techniques.","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:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/","og_locale":"en_US","og_type":"article","og_title":"Text Alignment &amp; Decoration - CSS learning mastery","og_description":"Learn CSS text alignment and decoration with easy examples. Style text using alignment, underline, and formatting techniques.","og_url":"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/","og_site_name":"CSS learning mastery","article_modified_time":"2026-04-20T11:45:19+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/","url":"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/","name":"Text Alignment &amp; Decoration - CSS learning mastery","isPartOf":{"@id":"https:\/\/gigz.pk\/css\/#website"},"datePublished":"2026-04-07T01:14:54+00:00","dateModified":"2026-04-20T11:45:19+00:00","description":"Learn CSS text alignment and decoration with easy examples. Style text using alignment, underline, and formatting techniques.","breadcrumb":{"@id":"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/css\/lesson\/text-alignment-decoration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/css\/"},{"@type":"ListItem","position":2,"name":"CSS Fundamentals (Beginner) > Typography & Text Styling > Text Alignment & Decoration"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/css\/#website","url":"https:\/\/gigz.pk\/css\/","name":"CSS learning mastery","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/css\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/lesson\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/media?parent=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}