{
  "Introduction to CSS": [
    {
      "title": "Introduction to CSS",
      "description": "A style sheet language, which writes out the look and structure of an HTML or XML document, makes CSS a very powerful language for the division of content from designs.Developers can use CSS to control how any given webpage will be presented on different devices or different sizes of screens, which makes things simple for web developers to control the visual style of multiple pages at once.",
      "sub_description": "In the past, before HTML had really proliferated to the version 3.2, and even this had assumed such responsibilities as styling content in addition to the structure, it used HTML attributes like ,&lt;font&gt;, &lt;b&gt; and etc., for styling, the code became messy and hard to maintain, and therefore, for simple changes, it was difficult to update or maintain. ",
      "additional_info": "To deal with this, the W3C created CSS. CSS separated the style formatting from the HTML page and put it in a separate file, clean up the code. Using an external CSS file helps developers make changes to an entire site with just one simple change, making it easier to make sitewide updates.",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Syntax:"
        },
        {
          "type": "paragraph",
          "text": "The basic syntax of CSS encompasses a selector and a declaration block. The selector is the HTML element you'd like to style, and the declaration block is compiled as a list containing your styling instructions (property-value pairs)."
        },
        {
          "type": "textarea",
          "text": "Selector {\n  Property: Value;\n  Property: Value;\n}",
          "template": "<!DOCTYPE html><html lang=\"en\"><head><title>Document</title><style>h1 { color: blue; } #webcooks { background-color: yellow; } .courses { font-size: 18px; color: green; } h2, p { text-align: center; }</style></head><body><div class=\"container\"><h1>Text</h1><p>This is sample content. Edit the CSS to style it.</p></div></body></html>"
        },
        {
          "type": "list",
          "items": [
            "The selector is the name given to the HTML element you wish to add styles to (e.g., p for paragraphs, h1 for headings).",
            "It is placed and encompassed in the declaration block {} which comprises one or more declarations.",
            "A declaration consists of an entity and its value, separated with a colon (:). Declaration always ends with a semicolon (;)."
          ]
        }
      ]
    },
    {
      "title": "CSS Selector",
      "description": "CSS selectors will let you target a specific HTML element so you can apply different styles based on that.",
      "sub_description": "There are five basic categories of CSS selectors and each has a specific role: ",
      "additional_info": "",
      "content": [
        {
          "type": "list",
          "items": [
            "Simple Selectors",
            "Combinator Selectors",
            "Psuedo-class Selectors",
            "Psuedo-elements Selectors",
            "Attribute selectors"
          ]
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Simple Selectors:"
        },
        {
          "type": "paragraph",
          "text": "This selector targets elements with its name or ID/class attributes. For example, you can select all paragraphs elements via p, an element with specific IDs with an #example, and elements whose class attribute hold a certain value in the .example."
        },
        {
          "type": "textarea",
          "text": "h1 {\n  color: blue;\n}\n\n#webcooks {\n  background-color: yellow;\n}\n\n.courses {\n  font-size: 18px;\n  color: green;\n}\n\nh2, p {\n  text-align: center;\n}",
          "template": "<!DOCTYPE html><html lang=\"en\">\n<head>\n<title>Document</title>\n<style>\nh1 {\ncolor: blue;\n}\n#webcooks {\nbackground-color: yellow;\n}\n.courses {\nfont-size: 18px;\ncolor: green;\n}\nh2, p {\ntext-align: center;\n}\n</style>\n</head>\n<body>\n<h1>Text</h1>\n<p id=\"webcooks\">This is sample content. Edit the CSS to style it.</p>\n<div class=\"courses\">\n<h2>HTML</h2>\n<p>HTML is the standard markup language for creating web pages.</p>\n<h2>CSS</h2>\n<p>CSS is the language we use to style an HTML document.</p>\n<h2>JavaScript</h2>\n<p>JavaScript is the programming language of the web.</p>\n    </div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Combinator Selectors:"
        },
        {
          "type": "paragraph",
          "text": " The relationship selectors, based on the relationship between other elements. You can select a child element (>), adjacent siblings (+), or general siblings (~). "
        },
        {
          "type": "textarea",
          "text": "div > p {\n  color: red;\n}\n\nul li {\n  list-style-type: square;\n}\n\narticle + aside {\n  margin-top: 20px;\n}\n\nheader, footer {\n  background-color: lightgrey;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Selectors Demo</title>\n<style>\ndiv>p{color:red;}\nul li{list-style-type:square;}\narticle+aside{margin-top:20px;}\nheader,footer{background-color:lightgrey;padding:10px;text-align:center;}\n</style>\n</head>\n<body>\n<header>\n<h1>Website Header</h1>\n</header>\n<div>\n<p>This paragraph is a direct child of div (red).</p>\n<section>\n<p>This paragraph is NOT a direct child of div.</p>\n</section>\n</div>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n<article>\n<h2>Article Section</h2>\n<p>This is an article.</p>\n</article>\n<aside>\n<p>This aside comes immediately after article.</p>\n</aside>\n<footer>\n<p>Website Footer</p>\n</footer>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Psuedo-class Selectors:"
        },
        {
          "type": "paragraph",
          "text": "Pseudo-classes allow you to target an element depending on its state. For example, you can style a link when a user hovers over it (:hover) and also style the first child of any parent container (:first-child)."
        },
        {
          "type": "textarea",
          "text": "a:hover {\n  color: blue;\n}\n\ninput:focus {\n  border-color: green;\n}\n\nli:first-child {\n  font-weight: bold;\n}\n\np:last-child {\n  margin-bottom: 0;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Pseudo Classes Demo</title>\n<style>\na:hover{color:blue;}\ninput:focus{border-color:green;}\nli:first-child{font-weight:bold;}\np:last-child{margin-bottom:0;}\n</style>\n</head>\n<body>\n<h1>Pseudo Classes Example</h1>\n<a href=\"#\">Hover over this link</a>\n<br><br>\n<input type=\"text\" placeholder=\"Click to focus\">\n<ul>\n<li>First Item (Bold)</li>\n<li>Second Item</li>\n<li>Third Item</li>\n</ul>\n<div>\n<p>This is the first paragraph.</p>\n<p>This is the last paragraph.</p>\n</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Pseudo-elements Selectors:"
        },
        {
          "type": "paragraph",
          "text": "Pseudo-elements allow you to apply styles to particular portions of an element, including the first letter and line. For example, ::before inserts content before an element, and ::first-letter jumps you to the first letter of a text block."
        },
        {
          "type": "textarea",
          "text": "p::first-line {\n  font-weight: bold;\n}\n\nh2::before {\n  content: 'Important: ';\n  color: red;\n}\n\nblockquote::after {\n  content: '— Author';\n  display: block;\n  text-align: right;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Pseudo Elements Demo</title>\n<style>\np::first-line{font-weight:bold;}\nh2::before{content:'Important: ';color:red;}\nblockquote::after{content:'— Author';display:block;text-align:right;}\n</style>\n</head>\n<body>\n<h2>Read This Message</h2>\n<p>This paragraph demonstrates the first-line pseudo-element. Only the first line will appear bold when enough text is present to wrap into multiple lines.</p>\n<blockquote>\nThis is a sample quote to demonstrate the after pseudo-element.\n</blockquote>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Attribute Selectors:"
        },
        {
          "type": "paragraph",
          "text": "These selectors enable you to select elements based on its attributes or attribute values. The example [type=\"text\"] will select input elements where the type attribute is set to \"text\"."
        },
        {
          "type": "textarea",
          "text": "a[href='https://www.webcooks.in'] {\n  color: blue;\n  text-decoration: none;\n}\n\ninput[type='text'] {\n  border: 1px solid #ccc;\n}\n\nimg[alt] {\n  border: 2px solid green;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Attribute Selectors Demo</title>\n<style>\na[href='https://www.webcooks.in']{color:blue;text-decoration:none;}\ninput[type='text']{border:1px solid #ccc;}\nimg[alt]{border:2px solid green;}\n</style>\n</head>\n<body>\n<a href=\"https://www.webcooks.in\">Webcooks Home</a>\n<br><br>\n<input type=\"text\" placeholder=\"Enter text\">\n<br><br>\n<img src=\"https://www.webcooks.in/assets/images/webcooks-logo.webp\" alt=\"Webcooks Logo\">\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "Each of these selectors brings an element of flexibility and accuracy to how elements can be targeted and, thus, makes CSS a more powerful tool in handling control of designs on web pages."
        }
      ]
    },
    {
      "title": "Ways to add CSS",
      "description": "A browser renders a web page with all the information it gets from CSS that is required to style the content.",
      "sub_description": "Three ways to add CSS to an HTML file are:",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "External CSS:"
        },
        {
          "type": "paragraph",
          "text": " To put an external CSS together, you write a stand-alone file that has only styling. This gets linked to your HTML document with the  tag inside the  part of your document. It has the .css extension and includes no HTML code other than the pure CSS rules. This is the best approach to maintaining the styles for multiple HTML pages in a centralized manner but keeping it efficient."
        },
        {
          "type": "textarea",
          "text": "<link rel='stylesheet' href='styles.css'>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>External CSS Demo</title>\n<link rel=\"stylesheet\" href=\"styles.css\">\n</head>\n<body>\n<h1>Welcome to Webcooks!</h1>\n</body>\n</html>",
          "showButton": false
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Internal CSS:"
        },
        {
          "type": "paragraph",
          "text": "Internal CSS is applied for in-line styling of a particular style within a given HTML document. Style rules are placed inside &lt;style&gt; tags, usually in the <head> of the HTML document. The beauty of this method comes into play when you want to style just one page or make specific specifications on the page without affecting other files."
        },
        {
          "type": "textarea",
          "text": "<style>\n  body {\n    background-color: lightblue;\n  }\n</style>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Internal CSS Demo</title>\n<style>\nbody{background-color:lightblue;}\n</style>\n</head>\n<body>\n<h1>Welcome to Webcooks!</h1>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Inline CSS:"
        },
        {
          "type": "paragraph",
          "text": "Inline CSS applies styles directly to single HTML elements using the style attribute within the tag itself. Inline CSS is very useful if one needs to apply a different style to just one element on the page, but it is less efficient for big projects because it clutters the HTML code and is hard to maintain."
        },
        {
          "type": "textarea",
          "text": "<h1 style=\"color:blue;\">Welcome to Webcooks!</h1>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Inline CSS Demo</title>\n</head>\n<body>\n<h1 style=\"color:blue;\">Welcome to Webcooks!</h1>\n</body>\n</html>"
        }
      ]
    },
    {
      "title": "CSS Comments",
      "description": "Comments in CSS are notes or explanations included in the code, not shown on the webpage but visible in the source code. They help a developer document his or her work so that it's easier to understand and maintain. ",
      "sub_description": "These are especially helpful at describing what certain styles are for, so if and when someone has to edit them in the future, it's easier to do. ",
      "additional_info": "CSS comments begin with /* and conclude with */. Both apply to both single-line comments and multi-line comments. The text between these markers is ignored by the rendering browser.",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Syntax:"
        },
        {
          "type": "textarea",
          "text": "<style>\n/* --------------------This is a CSS\n\t----------------comment*/\n</style>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Comments Demo</title>\n<style>\n/* --------------------This is a CSS\n\t----------------comment*/\n</style>\n</head>\n<body>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "For example:"
        },
        {
          "type": "textarea",
          "text": "/* This is a single-line comment */\n\n/*\n   This is a multi-line comment\n   It can span multiple lines\n*/\n\nbody {\n    background-color: #f0f0f0; /* Setting the background color */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Comments Demo</title>\n<style>\n/* This is a single-line comment */\n\n/*\n   This is a multi-line comment\n   It can span multiple lines\n*/\n\nbody {\n    background-color: #f0f0f0; /* Setting the background color */\n}\n</style>\n</head>\n<body>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Colors": [
    {
      "title": "CSS Colors",
      "description": "Colors can be applied to most of the available HTML elements using the predefined color names or other color models, like RGB, HEX, HSL, RGBA, and HSLA values. ",
      "sub_description": "All these methods are discussed here, along with their breakdown as follows. ",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Predefined Color Names:"
        },
        {
          "type": "paragraph",
          "text": "CSS has numerous predefined color names (such as \"red\", \"blue\", \"green\") that can be applied to the color of any text, background, or border of an HTML element."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: lightblue; /* Light blue background */\n    color: navy; /* Navy text color */\n}\n\nh1 {\n    color: green; /* Green heading */\n}\n\np {\n    color: red; /* Red paragraph text */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Colors Demo</title>\n<style>\nbody{background-color:lightblue;color:navy;}\nh1{color:green;}\np{color:red;}\n</style>\n</head>\n<body>\n<h1>CSS Color Example</h1>\n<p>This paragraph text is red.</p>\n<p>CSS makes webpages colorful and attractive.</p>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Color CSS Text:"
        },
        {
          "type": "paragraph",
          "text": "Color is a property used to set color for text within an element. "
        },
        {
          "type": "textarea",
          "text": "h1 {\n    color: #ff6347; /* Tomato color for h1 */\n}\n\nh2 {\n    color: rgb(0, 128, 0); /* Green color for h2 */\n}\n\np {\n    color: rgba(0, 0, 255, 0.5); /* Semi-transparent blue for paragraph */\n}\n\nspan {\n    color: hsl(120, 100%, 50%); /* Bright green using HSL */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Color Formats Demo</title>\n<style>\nh1{color:#ff6347;}\nh2{color:rgb(0,128,0);}\np{color:rgba(0,0,255,0.5);}\nspan{color:hsl(120,100%,50%);}\n</style>\n</head>\n<body>\n<h1>HEX Color Example</h1>\n<h2>RGB Color Example</h2>\n<p>This paragraph uses RGBA color format.</p>\n<p><span>This text uses HSL color format.</span></p>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS Background Color:"
        },
        {
          "type": "paragraph",
          "text": "CSS uses the background-color property to specify the background color for an HTML element."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: #f0f8ff; /* Alice Blue background for the body */\n}\n\nheader {\n    background-color: rgba(255, 99, 71, 0.8); /* Semi-transparent Tomato color for header */\n}\n\nfooter {\n    background-color: hsl(210, 50%, 50%); /* Steel Blue background for footer */\n}\n\n.section {\n    background-color: rgb(255, 228, 196); /* Bisque background for sections */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:#f0f8ff;}\nheader{background-color:rgba(255,99,71,0.8);padding:10px;color:#fff;}\nfooter{background-color:hsl(210,50%,50%);padding:10px;color:#fff;}\n.section{background-color:rgb(255,228,196);padding:15px;margin:10px 0;}\n</style>\n</head>\n<body>\n<header>\n<h1>Website Header</h1>\n</header>\n<div class=\"section\">\n<p>This is a content section with a background color.</p>\n</div>\n<div class=\"section\">\n<p>Another section to demonstrate background styling.</p>\n</div>\n<footer>\n<p>Website Footer</p>\n</footer>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": " CSS Border Color: "
        },
        {
          "type": "paragraph",
          "text": "You can specify the color for the border using either the border-color or the border property. Alternatively, you can set each side of the border to be a different color using a four-value system."
        },
        {
          "type": "textarea",
          "text": ".box {\n    border: 2px solid #ff4500; /* Orange Red border color for boxes */\n}\n\nh1 {\n    border-bottom: 3px dashed rgba(0, 128, 0, 0.7); /* Semi-transparent Green dashed border for headings */\n}\n\n.button {\n    border: 1px solid hsl(240, 100%, 50%); /* Bright Blue border for buttons */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Border Colors Demo</title>\n<style>\n.box{border:2px solid #ff4500;}\nh1{border-bottom:3px dashed rgba(0,128,0,0.7);}\n.button{border:1px solid hsl(240,100%,50%);}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with an orange red border.</div>\n<h1>This heading has a semi-transparent green dashed border.</h1>\n<button class=\"button\">This button has a bright blue border.</button>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "RGB Value:"
        },
        {
          "type": "paragraph",
          "text": "The rgb() function sets color using Red, Green, and Blue (RGB) values. All values are between 0 to 255 where 0 means no intensity at all and 255 means full intensity."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: rgb(255, 255, 255); /* White background */\n}\n\nh1 {\n    color: rgb(255, 0, 0); /* Red text color */\n}\n\n.box {\n    background-color: rgb(0, 128, 0); /* Green box background */\n}\n\n.button {\n    color: rgb(255, 255, 255); /* White text color for buttons */\n    background-color: rgb(0, 0, 255); /* Blue button background */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:rgb(255,255,255);}\nh1{color:rgb(255,0,0);}\n.box{background-color:rgb(0,128,0);}\n.button{color:rgb(255,255,255);background-color:rgb(0,0,255);}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a green background.</div>\n<h1>This heading has a red text color.</h1>\n<button class=\"button\">This button has a blue background.</button>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "RGBA Value:"
        },
        {
          "type": "paragraph",
          "text": "The rgba() function extends RGB by including an Alpha channel defining the transparency. The alpha value ranges from 0 that means fully transparent to 1 that means fully opaque"
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: rgba(255, 255, 255, 1); /* White background with full opacity */\n}\n\nh1 {\n    color: rgba(255, 0, 0, 0.8); /* Red text color with 80% opacity */\n}\n\n.box {\n    background-color: rgba(0, 128, 0, 0.5); /* Green box background with 50% opacity */\n}\n\n.button {\n    color: rgba(255, 255, 255, 1); /* White text color for buttons */\n    background-color: rgba(0, 0, 255, 0.7); /* Blue button background with 70% opacity */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:rgba(255,255,255,1);}\nh1{color:rgba(255,0,0,0.8);}\n.box{background-color:rgba(0,128,0,0.5);}\n.button{color:rgba(255,255,255,1);background-color:rgba(0,0,255,0.7);}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a green background.</div>\n<h1>This heading has a red text color.</h1>\n<button class=\"button\">This button has a blue background.</button>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "HEX Color:"
        },
        {
          "type": "paragraph",
          "text": "Finally, there are hexadecimal values, used to describe colors in CSS. Hexadecimal is written as #RRGGBB, with RR, GG, and BB representing the red, green, and blue values in hexadecimal format."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: #ffffff; /* White background */\n}\n\nh1 {\n    color: #ff0000; /* Red text color */\n}\n\n.box {\n    background-color: #00ff00; /* Green box background */\n}\n\n.button {\n    color: #ffffff; /* White text color for buttons */\n    background-color: #0000ff; /* Blue button background */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:#ffffff;}\nh1{color:#ff0000;}\n.box{background-color:#00ff00;}\n.button{color:#ffffff;background-color:#0000ff;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a green background.</div>\n<h1>This heading has a red text color.</h1>\n<button class=\"button\">This button has a blue background.</button>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "3-Digit HEX Value:"
        },
        {
          "type": "paragraph",
          "text": "This is short notation for 6-digit HEX values. Digits repeat; #F09 is the same as #FF0099. "
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: #fff; /* White background */\n}\n\nh1 {\n    color: #f00; /* Red text color */\n}\n\n.box {\n    background-color: #0f0; /* Green box background */\n}\n\n.button {\n    color: #fff; /* White text color for buttons */\n    background-color: #00f; /* Blue button background */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:#fff;}\nh1{color:#f00;}\n.box{background-color:#0f0;}\n.button{color:#fff;background-color:#00f;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a green background.</div>\n<h1>This heading has a red text color.</h1>\n<button class=\"button\">This button has a blue background.</button>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "HSL Value:"
        },
        {
          "type": "paragraph",
          "text": "HSL = Hue, Saturation, and Lightness. The hsl() function generates the color based on these properties. Hue is an angle in a color wheel (0° to 360°), Saturation is the intensity of the color (0% to 100%), and Lightness is the lightness/darkness (0% is black, 100% is white)."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: hsl(0, 100%, 100%); /* White background */\n}\n\nh1 {\n    color: hsl(0, 100%, 50%); /* Red text color */\n}\n\n.box {\n    background-color: hsl(120, 100%, 50%); /* Green box background */\n}\n\n.button {\n    color: hsl(0, 0%, 100%); /* White text color for buttons */\n    background-color: hsl(240, 100%, 50%); /* Blue button background */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:hsl(0,100%,100%);}\nh1{color:hsl(0,100%,50%);}\n.box{background-color:hsl(120,100%,50%);}\n.button{color:hsl(0,0%,100%);background-color:hsl(240,100%,50%);}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a green background.</div>\n<h1>This heading has a red text color.</h1>\n<button class=\"button\">This button has a blue background.</button>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "HSLA color Value:"
        },
        {
          "type": "paragraph",
          "text": "The hsla() function adds an Alpha channel to HSL to control the transparency, with 0 fully transparent and 1 fully opaque. These colour models allow for quite a bit of flexibility in how you can apply colour to your webpage so permitting rather precise control over the look and feel and user experience."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: hsla(0, 100%, 100%, 0.9); /* White background with 90% opacity */\n}\n\nh1 {\n    color: hsla(0, 100%, 50%, 0.8); /* Red text color with 80% opacity */\n}\n\n.box {\n    background-color: hsla(120, 100%, 50%, 0.7); /* Green box background with 70% opacity */\n}\n\n.button {\n    color: hsla(0, 0%, 100%, 1); /* White text color for buttons with full opacity */\n    background-color: hsla(240, 100%, 50%, 0.6); /* Blue button background with 60% opacity */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:hsla(0,100%,100%,0.9);}\nh1{color:hsla(0,100%,50%,0.8);}\n.box{background-color:hsla(120,100%,50%,0.7);}\n.button{color:hsla(0,0%,100%,1);background-color:hsla(240,100%,50%,0.6);}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a green background.</div>\n<h1>This heading has a red text color.</h1>\n<button class=\"button\">This button has a blue background.</button>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Background": [
    {
      "title": "CSS Background",
      "description": "In CSS, background properties control the background color, images, and behavior of an element. ",
      "sub_description": "They allow you to style the background of any HTML element effectively.",
      "additional_info": "Here are some useful CSS Background Properties:",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Background Color:"
        },
        {
          "type": "paragraph",
          "text": "The background-color property allows a predefined color name, or an RGB, HEX, or HSL value to be assigned to an element's background color."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-color: #f0f8ff; /* AliceBlue background color */\n}\n\n.header {\n    background-color: #ffebcd; /* BlanchedAlmond background color for header */\n}\n\n.footer {\n    background-color: #8a2be2; /* BlueViolet background color for footer */\n}\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-color:#f0f8ff;}\n.header{background-color:#ffebcd;}\n.footer{background-color:#8a2be2;}\n</style>\n</head>\n<body>\n<div class=\"header\">This is a header with a BlanchedAlmond background color.</div>\n<div class=\"footer\">This is a footer with a BlueViolet background color.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Opacity"
        },
        {
          "type": "paragraph",
          "text": "The opacity property controls how transparent an element is. The values range from 0.0 (completely transparent) to 1.0 (fully opaque)"
        },
        {
          "type": "textarea",
          "text": ".image-container {\n    opacity: 0.5; /* 50% opacity for images */\n}\n\n.text-box {\n    background-color: rgba(255, 0, 0, 0.3); /* Red background with 30% opacity */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\n.image-container{opacity:0.5;}\n.text-box{background-color:rgba(255,0,0,0.3);}\n</style>\n</head>\n<body>\n<div class=\"image-container\">This is an image with 50% opacity.</div>\n<div class=\"text-box\">This is a text box with a Red background color and 30% opacity.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Background Image:"
        },
        {
          "type": "paragraph",
          "text": " Background-image property lets you place an image in the backside of an element.The background-image property accepts a value in the form of a URL or file path, and it can be used on block-level and inline elements."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-image: url('https://www.webcooks.in/assets/images/webcooks-logo.webp'); /* URL of the background image */\n    background-repeat: no-repeat; /* Prevents the image from repeating */\n    background-size: cover; /* Makes the image cover the entire background */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-image:url('https://www.webcooks.in/assets/images/webcooks-logo.webp');background-repeat:no-repeat;background-size:contain;height:50vh;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS Background-Repeat:"
        },
        {
          "type": "paragraph",
          "text": "By default, background images are repeated both horizontally and vertically. However, you can control the repeat behavior using the background-repeat property. You can choose to repeat the background only on the X-axis (repeat-x), Y-axis (repeat-y), or not at all (no-repeat)."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-image: url('https://www.webcooks.in/pattern.jpg'); /* URL of the background image */\n    background-repeat: repeat; /* The background image will repeat both horizontally and vertically */\n}\n\n/* Other background-repeat options: */\n/* background-repeat: no-repeat; - No repetition */\n/* background-repeat: repeat-x; - Repeats horizontally */\n/* background-repeat: repeat-y; - Repeats vertically */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-image:url('https://www.webcooks.in/pattern.jpg');background-repeat:repeat;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS Background-Position:"
        },
        {
          "type": "paragraph",
          "text": "Background Position property will define how to put the background image. You can position this background at the top, bottom, left, right, or even center, among others."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-image: url('https://www.webcooks.in/assets/images/webcooks-logo.webp'); /* URL of the background image */\n    background-position: center; /* The background image will be centered */\n}\n\n/* Other background-position options: */\n/* background-position: top left; - Top left corner */\n/* background-position: bottom right; - Bottom right corner */\n/* background-position: 50% 50%; - Positioning using percentage values */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-image:url('https://www.webcooks.in/assets/images/webcooks-logo.webp');background-position:center;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS Background-Attachment:"
        },
        {
          "type": "paragraph",
          "text": "Background-attachment property specifies whether the background image scrolls when you scroll the page or it stays fixed."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-image: url('https://www.webcooks.in/assets/images/webcooks-logo.webp'); /* URL of the background image */\n    background-attachment: fixed; /* The background image will be fixed and not scroll with the page */\n}\n\n/* Other background-attachment options: */\n/* background-attachment: scroll; - The background scrolls with the page */\n/* background-attachment: local; - The background scrolls within the element's content */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-image:url('https://www.webcooks.in/assets/images/webcooks-logo.webp');background-attachment:fixed;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "scroll: "
        },
        {
          "type": "paragraph",
          "text": "This property implies that the background scrolls along with the page."
        },
        {
          "type": "textarea",
          "text": "body {\n    background-image: url('https://www.webcooks.in/assets/images/webcooks-logo.webp'); /* URL of the background image */\n    background-attachment: scroll; /* The background will scroll along with the content */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-image:url('https://www.webcooks.in/assets/images/webcooks-logo.webp');background-attachment:scroll;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "fixed: "
        },
        {
          "type": "paragraph",
          "text": "In this case, the background remains fixed while the content scrolls."
        },
        {
          "type": "textarea",
          "text": "body {\n  background-image: url('https://www.webcooks.in/assets/images/webcooks-logo.webp'); /* URL of the background image */\n    background-attachment: fixed; /* The background will stay fixed while content scrolls */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background-image:url('https://www.webcooks.in/assets/images/webcooks-logo.webp');background-attachment:fixed;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Shorthand Background property:"
        },
        {
          "type": "paragraph",
          "text": "The background shorthand property allows you to define all background properties (like color, image, repeat, position, and attachment) in a single line to simplify your CSS code. This line combines background color, background image, no-repeat, center positioning, and fixed attachment in one shorthand property."
        },
        {
          "type": "textarea",
          "text": "body {\n    background: url('https://www.webcooks.in/assets/images/webcooks-logo.webp') no-repeat center center; /* URL of the image, no repeat, centered */\n    background-color: #f0f0f0; /* Background color */\n    background-size: cover; /* Image covers the entire element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Background Colors Demo</title>\n<style>\nbody{background:url('https://www.webcooks.in/assets/images/webcooks-logo.webp') no-repeat center center;background-color:#f0f0f0;background-size:contain; height: 50vh;}\n</style>\n</head>\n<body>\n<div class=\"background-image\">This is a background image.</div>\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "This line combines background color, background image, no repeat and center positioning, fixed attachment all into one shorthand property."
        }
      ]
    }
  ],
  "CSS Borders": [
    {
      "title": "CSS Borders",
      "description": "The border-style property specifies how the border of an HTML element looks. ",
      "sub_description": "Several options can be used for this property:",
      "additional_info": "",
      "content": [
        {
          "type": "list",
          "items": [
            "solid: A single, solid line is used for the border.",
            "none: No border is displayed.",
            "double: Two solid lines are shown, separated by a gap for a double border.",
            "dotted: A border consisting of dots.",
            "dashed: The border appears as a series of dashes.",
            "groove: This will cause a 3D effect in which borders appear to be carved into the page. Even this effect is a result of the color.",
            "ridge: It offers a type of 3D effect which makes borders appear as if they have come from the page. Again the effect is dependent on the color of the border.",
            "inset: The border appears to be indented by being impressed into the page.",
            "outset: This border type renders it as if the element is raised from the page.",
            "hidden: Just like none, no borders are rendered."
          ]
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Border Width:"
        },
        {
          "type": "paragraph",
          "text": "The border-width property specifies how thick the border is. Of course, it is possible to set different widths for each side of the element or use standard values such as thin, medium, and thick. Individual sides can also have varying thicknesses."
        },
        {
          "type": "textarea",
          "text": ".box {\n    border-width: 2px; /* Sets the border width to 2 pixels */\n    border-style: solid; /* Defines the border style */\n    border-color: #000; /* Sets the border color to black */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Borders Demo</title>\n<style>\n.box{border-width:2px;border-style:solid;border-color:#000;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a 2px solid black border.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Border Color:"
        },
        {
          "type": "paragraph",
          "text": "The border-color property allows you to choose the color of the border. Different colors can be applied to each side of the border, giving more flexibility in design."
        },
        {
          "type": "textarea",
          "text": ".box {\n    border-width: 2px; /* Sets the border width to 2 pixels */\n    border-style: solid; /* Defines the border style */\n    border-color: #ff5733; /* Sets the border color to a custom color (red-orange) */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Borders Demo</title>\n<style>\n.box{border-width:2px;border-style:solid;border-color:#ff5733;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a 2px solid red-orange border.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Border Sides:"
        },
        {
          "type": "paragraph",
          "text": "You can apply different styles to each side of the border by using properties like border-top-style, border-right-style, border-bottom-style, border-left-style. "
        },
        {
          "type": "textarea",
          "text": ".box {\n    border-top: 3px solid blue; /* Applies a blue border to the top */\n    border-right: 2px dashed green; /* Applies a green dashed border to the right */\n    border-bottom: 4px double red; /* Applies a double red border to the bottom */\n    border-left: none; /* No border on the left side */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Borders Demo</title>\n<style>\n.box{border-top:3px solid blue;border-right:2px dashed green;border-bottom:4px double red;border-left:none;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a blue border on the top, a green dashed border on the right, a double red border on the bottom, and no border on the left.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Shorthand Border property:"
        },
        {
          "type": "paragraph",
          "text": "border shorthand property is used to specify the width, style, and color for a border at once in a single line."
        },
        {
          "type": "textarea",
          "text": ".box {\n    border: 2px solid black; /* Sets the border width, style, and color in one line */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Borders Demo</title>\n<style>\n.box{border:2px solid black;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a 2px solid black border.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Rounded Borders:"
        },
        {
          "type": "paragraph",
          "text": "The CSS property border-radius makes an element produce rounded corners. You may use one or multiple values controlling which corner is rounded. You might also specify various radius values for each corner."
        },
        {
          "type": "textarea",
          "text": ".box {\n    border: 2px solid black;\n    border-radius: 15px; /* Rounds the corners of the border */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Borders Demo</title>\n<style>\n.box{border:2px solid black;border-radius:15px;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a 2px solid black border and 15px rounded corners.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Margin": [
    {
      "title": "CSS Margin",
      "description": "CSS margins create space around an element, positioned outside its borders. ",
      "sub_description": "The following properties define margins for each side: ",
      "additional_info": "margin-top,margin-right,margin-bottom and margin-left",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Values for Margin Properties:"
        },
        {
          "type": "paragraph",
          "text": "Margins can take various values"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "length:"
        },
        {
          "type": "paragraph",
          "text": "The margin can be set in units like pixels (px), points (pt), centimeters (cm), rem, or em."
        },
        {
          "type": "textarea",
          "text": ".box {\n    margin: 20px; /* Sets a margin of 20 pixels on all sides */\n    margin: 1rem; /* Sets a margin of 1 rem unit on all sides */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.box{margin:20px;margin:1rem;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a 20px margin on all sides.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "% :"
        },
        {
          "type": "paragraph",
          "text": "The margin can also be defined using a percentage of the width of the parent element."
        },
        {
          "type": "textarea",
          "text": ".box {\n    margin: 5%; /* Sets a margin of 5% of the parent element's width on all sides */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.box{margin:5%;}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a 5% margin on all sides.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "auto value:"
        },
        {
          "type": "paragraph",
          "text": "Using the auto value distributes margins equally on all sides. If the element has horizontal width but no vertical height, it will center within its container, with margins split evenly on the sides."
        },
        {
          "type": "textarea",
          "text": ".centered-box {\n    width: 50%;\n    margin: auto; /* This will center the box horizontally within its parent container */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.centered-box{width:50%;margin:auto;}\n</style>\n</head>\n<body>\n<div class=\"centered-box\">This is a centered box.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "inherit value:"
        },
        {
          "type": "paragraph",
          "text": "The inherit value makes an element adopt its margin from the parent. For example, if the parent element has a margin-right of 200px, the child will also have the same right margin. "
        },
        {
          "type": "textarea",
          "text": ".child-element {\n    margin: inherit; /* This will take the margin value from its parent element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.child-element{margin:inherit;}\n</style>\n</head>\n<body>\n<div class=\"child-element\">This is a child element with a margin inherited from its parent.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Margin Collapse:"
        },
        {
          "type": "paragraph",
          "text": "Margin collapse occurs when two vertically aligned margins merge into a single margin, which takes the larger of the two. This behavior is common with block-level elements positioned one above the other."
        },
        {
          "type": "textarea",
          "text": ".parent {\n    margin: 20px; /* Margin of parent element */\n    background-color: lightblue;\n}\n\n.child {\n    margin: 30px; /* Margin of child element */\n    background-color: lightcoral;\n}\n\n/* The margins of the parent and child may collapse, resulting in a total margin of 30px instead of 50px */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.parent{margin:20px;background-color:lightblue;}\n.child{margin:30px;background-color:lightcoral;}\n</style>\n</head>\n<body>\n<div class=\"parent\">This is a parent element with a 20px margin.</div>\n<div class=\"child\">This is a child element with a 30px margin.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Margin Shorthand proprty: "
        },
        {
          "type": "paragraph",
          "text": "Margin can be a shorthand property that sets all margins in one line: margin-top, margin-right, margin-bottom and margin-left in that order. Here are some examples of shorthand usage:"
        },
        {
          "type": "textarea",
          "text": ".element {\n    margin: 10px 20px 30px 40px; /* top right bottom left */\n}\n\n/* This sets the margin for the top and bottom, and right and left sides */\n.element {\n    margin: 10px 20px; /* top-bottom right-left */\n}\n\n/* This sets the margin for all sides, top, right, bottom, and left */\n.element {\n    margin: 15px; /* all sides */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.element{margin:10px 20px 30px 40px;}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a margin of 10px 20px 30px 40px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Three values:"
        },
        {
          "type": "textarea",
          "text": ".element {\n    margin: 10px 20px 30px; /* top right-left bottom */\n}\n\n/* Example usage */\n/* 10px margin on top, 20px margin on left and right, and 30px margin on bottom */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.element{margin:10px 20px 30px;}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a margin of 10px 20px 30px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Two values:"
        },
        {
          "type": "textarea",
          "text": ".element {\n    margin: 10px 20px; /* top-bottom right-left */\n}\n\n/* Example usage */\n/* 10px margin on top and bottom, 20px margin on left and right */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.element{margin:10px 20px;}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a margin of 10px 20px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Single value:"
        },
        {
          "type": "textarea",
          "text": ".element {\n    margin: 15px; /* Applies 15px margin to top, right, bottom, and left */\n}\n\n/* Example usage */\n/* 15px margin on all sides of the element */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Margins Demo</title>\n<style>\n.element{margin:15px;}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a margin of 15px.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Padding": [
    {
      "title": "CSS Padding",
      "description": "The amount of space within the boundaries of an element, between the content of an element and its border, in CSS, is known as padding. ",
      "sub_description": "It adds an amount of internal spacing.",
      "additional_info": "Padding does not accept negative numbers.",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Padding for Specific Sides:"
        },
        {
          "type": "paragraph",
          "text": "There are four types of paddings."
        },
        {
          "type": "list",
          "items": [
            "Padding-top",
            "Padding-left",
            "Padding-right",
            "Padding-bottom"
          ]
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Types of Padding Values:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Length: "
        },
        {
          "type": "paragraph",
          "text": "Padding can be given in px, pt, cm, rem, or em."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 20px; /* Padding of 20 pixels */\n    padding: 1.5em; /* Padding of 1.5 times the element's font size */\n    padding: 15pt; /* Padding of 15 points */\n    padding: 2cm; /* Padding of 2 centimeters */\n}\n\n/* Example usage */\n/* Different lengths applied to the element */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element{padding:20px;padding:1.5em;padding:15pt;padding:2cm;}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 20px, 1.5em, 15pt, and 2cm.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Percent (%):"
        },
        {
          "type": "paragraph",
          "text": "Padding may be specified as a percent of the element's width."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 10%; /* Padding of 10% of the element's width */\n    padding: 5%; /* Padding of 5% of the element's width */\n}\n\n/* Example usage */\n/* Different percentages applied to the element */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element{padding:10%;padding:5%;}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 10% and 5%.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "inherit:"
        },
        {
          "type": "paragraph",
          "text": "The padding-size is inherited from the parent element."
        },
        {
          "type": "textarea",
          "text": ".parent {\n    padding: 20px; /* Padding for parent element */\n}\n\n.child {\n    padding: inherit; /* Inherits padding from the parent */\n}\n\n/* Example usage */\n/* The child will have the same padding as the parent */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.parent {\n    padding: 20px; /* Padding for parent element */\n}\n\n.child {\n    padding: inherit; /* Inherits padding from the parent */\n}\n\n/* Example usage */\n/* The child will have the same padding as the parent */\n</style>\n</head>\n<body>\n<div class=\"parent\">This is a parent element with a 20px padding.</div>\n<div class=\"child\">This is a child element with a padding inherited from its parent.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Padding Shorthand Property:"
        },
        {
          "type": "paragraph",
          "text": "The shorthand property for padding will enable you to specify all your padding values in just one line. There are four ways to use it."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 10px 20px 15px 5px; /* Top 10px, Right 20px, Bottom 15px, Left 5px */\n}\n\n/* You can also use shorthand with fewer values: */\n.element2 {\n    padding: 10px 20px; /* Top and Bottom 10px, Right and Left 20px */\n}\n\n.element3 {\n    padding: 10px; /* All sides 10px */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element {\n    padding: 10px 20px 15px 5px; /* Top 10px, Right 20px, Bottom 15px, Left 5px */\n}\n\n/* You can also use shorthand with fewer values: */\n.element2 {\n    padding: 10px 20px; /* Top and Bottom 10px, Right and Left 20px */\n}\n\n.element3 {\n    padding: 10px; /* All sides 10px */\n} \n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 10px 20px 15px 5px.</div>\n<div class=\"element2\">This is an element with a padding of 10px 20px.</div>\n<div class=\"element3\">This is an element with a padding of 10px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Single value:"
        },
        {
          "type": "paragraph",
          "text": "This is padding applied 50px all around the element."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 50px; /* 50px padding applied to top, right, bottom, and left */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element {\n    padding: 50px; /* 50px padding applied to top, right, bottom, and left */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 50px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Two values:"
        },
        {
          "type": "paragraph",
          "text": "This adds 20px to the top and bottom and 40px to the left and right."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 20px 40px; /* 20px padding for top and bottom, 40px for left and right */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element {\n    padding: 20px 40px; /* 20px padding for top and bottom, 40px for left and right */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 20px 40px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Three values:"
        },
        {
          "type": "paragraph",
          "text": "This adds 15px to the top, 5px to the left and right and 20px to the bottom."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 15px 5px 20px; /* 15px padding for top, 5px for left and right, 20px for bottom */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element {\n    padding: 15px 5px 20px; /* 15px padding for top, 5px for left and right, 20px for bottom */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 15px 5px 20px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Four values:"
        },
        {
          "type": "paragraph",
          "text": "This adds 5px to the top, 6px to the right, 7px to the bottom and 8px to the left. Padding adds to the total width of that element since both sides, its left and right side are filled up. This could increase the width unless dealt with properly."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 5px 6px 7px 8px; /* 5px padding for top, 6px for right, 7px for bottom, 8px for left */\n}\n\n/* Note: Padding adds to the total width of the element, potentially increasing the overall width if not managed properly. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Padding Demo</title>\n<style>\n.element {\n    padding: 5px 6px 7px 8px; /* 5px padding for top, 6px for right, 7px for bottom, 8px for left */\n}\n\n/* Note: Padding adds to the total width of the element, potentially increasing the overall width if not managed properly. */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 5px 6px 7px 8px.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Height and Width": [
    {
      "title": "CSS height and width property",
      "description": "The height and width properties in CSS will govern the size of elements. These are applicable to both block-level and inline elements.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Available Values:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Length: "
        },
        {
          "type": "paragraph",
          "text": "It is used to define a fixed size with the help of units like px, em, cm, etc."
        },
        {
          "type": "textarea",
          "text": ".element {\n    width: 300px;  /* Fixed width of 300 pixels */\n    padding: 2em;  /* Padding of 2 em units */\n    margin: 1cm;   /* Margin of 1 centimeter */\n}\n\n/* Note: Length values can be used for width, height, padding, margin, and other properties in CSS. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.element {\n    width: 300px;  /* Fixed width of 300 pixels */\n    padding: 2em;  /* Padding of 2 em units */\n    margin: 1cm;   /* Margin of 1 centimeter */\n}\n\n/* Note: Length values can be used for width, height, padding, margin, and other properties in CSS. */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of 300px, a padding of 2em, and a margin of 1cm.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Percentage (%):"
        },
        {
          "type": "paragraph",
          "text": "This is used to define the size as a percentage of the parent or containing element."
        },
        {
          "type": "textarea",
          "text": ".element {\n    width: 50%;   /* Width is set to 50% of the parent element's width */\n    padding: 10%;  /* Padding is set to 10% of the element's width */\n    margin: 5%;    /* Margin is set to 5% of the parent element's width */\n}\n\n/* Note: Percentage values can be used for width, height, padding, margin, and other properties in CSS. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.element {\n    width: 50%;   /* Width is set to 50% of the parent element's width */\n    padding: 10%;  /* Padding is set to 10% of the element's width */\n    margin: 5%;    /* Margin is set to 5% of the parent element's width */\n}\n\n/* Note: Percentage values can be used for width, height, padding, margin, and other properties in CSS. */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of 50%, a padding of 10%, and a margin of 5%.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Auto: "
        },
        {
          "type": "paragraph",
          "text": "The height and width would automatically get calculated by the browser on the basis of the content. "
        },
        {
          "type": "textarea",
          "text": ".element {\n    width: auto;   /* Width is set to auto, allowing the browser to calculate it based on content */\n    height: auto;  /* Height is also set to auto for dynamic sizing */\n}\n\n/* Note: The auto value allows the browser to adjust dimensions based on the content and surrounding elements, making layouts flexible and responsive. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.element {\n    width: auto;   /* Width is set to auto, allowing the browser to calculate it based on content */\n    height: auto;  /* Height is also set to auto for dynamic sizing */\n}\n\n/* Note: The auto value allows the browser to adjust dimensions based on the content and surrounding elements, making layouts flexible and responsive. */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of auto and a height of auto.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Initial: "
        },
        {
          "type": "paragraph",
          "text": "It resets the height and the width to its default values."
        },
        {
          "type": "textarea",
          "text": ".element {\n    width: initial;   /* Resets width to its default value */\n    height: initial;  /* Resets height to its default value */\n}\n\n/* Note: The initial value is useful when you want to remove any inherited styles and revert to the browser's default settings for an element. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.element {\n    width: initial;   /* Resets width to its default value */\n    height: initial;  /* Resets height to its default value */\n}\n\n/* Note: The initial value is useful when you want to remove any inherited styles and revert to the browser's default settings for an element. */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of initial and a height of initial.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Inherit: "
        },
        {
          "type": "paragraph",
          "text": "It will take the height and the width from its parent element."
        },
        {
          "type": "textarea",
          "text": ".element {\n    width: inherit;   /* Takes width from the parent element */\n    height: inherit;  /* Takes height from the parent element */\n}\n\n/* Note: The inherit value is useful when you want to ensure that child elements maintain the same dimensions as their parent, allowing for consistent styling. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.element {\n    width: inherit;   /* Takes width from the parent element */\n    height: inherit;  /* Takes height from the parent element */\n}\n\n/* Note: The inherit value is useful when you want to ensure that child elements maintain the same dimensions as their parent, allowing for consistent styling. */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of inherit and a height of inherit.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "2",
          "text": "max-width and min-width properties in CSS:"
        },
        {
          "type": "paragraph",
          "text": "The max-width and min-width properties in CSS is used to set the maximum and minimum widths that an element will expand to."
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Max-width: "
        },
        {
          "type": "paragraph",
          "text": "This property takes the maximum width that an element will accommodate. If content exceeds the max-width, it will either wrap or overflow based on additional CSS rules."
        },
        {
          "type": "textarea",
          "text": ".container {\n    max-width: 600px;  /* Sets the maximum width to 600 pixels */\n    width: 100%;       /* Allows the container to expand to full width up to the max-width */\n    margin: 0 auto;   /* Centers the container */\n}\n\n/* Note: The max-width property is useful for responsive designs, ensuring that elements do not exceed a specified width while still being flexible. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.container {\n    max-width: 600px;  /* Sets the maximum width to 600 pixels */\n    width: 100%;       /* Allows the container to expand to full width up to the max-width */\n    margin: 0 auto;   /* Centers the container */\n}\n\n/* Note: The max-width property is useful for responsive designs, ensuring that elements do not exceed a specified width while still being flexible. */\n</style>\n</head>\n<body>\n<div class=\"container\">This is a container with a maximum width of 600px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Min-width: "
        },
        {
          "type": "paragraph",
          "text": "It specifies the minimum amount of width to provide to an element.It will be at least that large, regardless of the content."
        },
        {
          "type": "textarea",
          "text": ".container {\n    min-width: 300px;  /* Sets the minimum width to 300 pixels */\n    width: 100%;       /* Allows the container to expand to full width up to the min-width */\n    margin: 0 auto;    /* Centers the container */\n}\n\n/* Note: The min-width property ensures that an element maintains a specified width, even if its content would typically reduce its size. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.container {\n    min-width: 300px;  /* Sets the minimum width to 300 pixels */\n    width: 100%;       /* Allows the container to expand to full width up to the min-width */\n    margin: 0 auto;    /* Centers the container */\n}\n\n/* Note: The min-width property ensures that an element maintains a specified width, even if its content would typically reduce its size. */\n</style>\n</head>\n<body>\n<div class=\"container\">This is a container with a minimum width of 300px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Value Types:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Length: "
        },
        {
          "type": "paragraph",
          "text": "Values like px, pt, em, etc., can be used with units."
        },
        {
          "type": "textarea",
          "text": ".box {\n    width: 300px;  /* Fixed width of 300 pixels */\n    height: 150pt; /* Height of 150 points */\n    padding: 1em;  /* Padding of 1 em, which scales with the font size */\n}\n\n/* Note: Length values allow precise control over the dimensions and spacing of elements. */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.box {\n    width: 300px;  /* Fixed width of 300 pixels */\n    height: 150pt; /* Height of 150 points */\n    padding: 1em;  /* Padding of 1 em, which scales with the font size */\n}\n\n/* Note: Length values allow precise control over the dimensions and spacing of elements. */\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a width of 300px, a height of 150pt, and a padding of 1em.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Percentage (%): "
        },
        {
          "type": "paragraph",
          "text": "This property expresses the width as a percentage in respect of the parent element's width."
        },
        {
          "type": "textarea",
          "text": "width: 50%; /* This sets the width to 50% of the parent element's width */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.box {width: 50%; /* This sets the width to 50% of the parent element's width */}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a width of 50%.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "None: "
        },
        {
          "type": "paragraph",
          "text": "By default, no minimum or maximum width is applied."
        },
        {
          "type": "textarea",
          "text": "max-width: none; /* This removes any maximum width restriction on the element */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Height and Width Demo</title>\n<style>\n.box {max-width: none; /* This removes any maximum width restriction on the element */}\n</style>\n</head>\n<body>\n<div class=\"box\">This is a box with a maximum width of none.</div>\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "Together with some of the other properties, these are very useful for creating flexible responsive layouts."
        }
      ]
    }
  ],
  "CSS Box Model": [
    {
      "title": "CSS Box Model",
      "description": "The CSS box model tries to explain the way elements on a web page are represented in terms of size and placement. ",
      "sub_description": "It divides into four components.",
      "additional_info": "Content, Padding, Border, Margin",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Content:"
        },
        {
          "type": "paragraph",
          "text": "That is, the core part of the element; it could be text, images, or other data inside it."
        },
        {
          "type": "textarea",
          "text": "/* Content: The actual content inside the box, such as text or images */\n\n.element {\n    width: 300px; /* Example content width */\n    height: 200px; /* Example content height */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Box Model Demo</title>\n<style>\n/* Content: The actual content inside the box, such as text or images */\n\n.element {\n    width: 300px; /* Example content width */\n    height: 200px; /* Example content height */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of 300px and a height of 200px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Padding:"
        },
        {
          "type": "paragraph",
          "text": "The amount of space within the boundaries of an element, between the content of an element and its border, in CSS, is known as padding."
        },
        {
          "type": "textarea",
          "text": ".element {\n    padding: 20px; /* Example padding applied around the content */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Box Model Demo</title>\n<style>\n.element {\n    padding: 20px; /* Example padding applied around the content */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a padding of 20px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Border:"
        },
        {
          "type": "paragraph",
          "text": "This lies around the padding and content. It makes the element optically separate itself from other elements on the page."
        },
        {
          "type": "textarea",
          "text": ".element {\n    border: 2px solid #000000; /* Example border separating the element from others */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Box Model Demo</title>\n<style>\n.element {\n    border: 2px solid #000000; /* Example border separating the element from others */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a border of 2px solid black.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Margin:"
        },
        {
          "type": "paragraph",
          "text": "It refers to the space outside an element, which is a boundary that defines this element and others close to it. The margins do not change the dimensions of an element but can adjust its position within the layout. "
        },
        {
          "type": "textarea",
          "text": ".element {\n    margin: 20px; /* Adds a 20px margin around the entire element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Box Model Demo</title>\n<style>\n.element {\n    margin: 20px; /* Adds a 20px margin around the entire element */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a margin of 20px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Total Width and Height"
        },
        {
          "type": "paragraph",
          "text": "The box model can be used to figure out the total width and height of an element as given below:"
        },
        {
          "type": "paragraph",
          "text": "Total Width: Total Width = Content Width + Left Padding + Right Padding + Left Border + Right Border"
        },
        {
          "type": "textarea",
          "text": ".element {\n    width: 200px; /* Content width */\n    padding: 10px; /* Left and Right padding of 10px each */\n    border: 5px solid #000; /* Left and Right border of 5px each */\n}\n\n/* Total Width = Content Width + Left Padding + Right Padding + Left Border + Right Border */\n/* Total Width = 200px + 10px + 10px + 5px + 5px = 230px */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Box Model Demo</title>\n<style>\n.element {\n    width: 200px; /* Content width */\n    padding: 10px; /* Left and Right padding of 10px each */\n    border: 5px solid #000; /* Left and Right border of 5px each */\n}\n\n/* Total Width = Content Width + Left Padding + Right Padding + Left Border + Right Border */\n/* Total Width = 200px + 10px + 10px + 5px + 5px = 230px */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a width of 200px, a left and right padding of 10px, and a left and right border of 5px.</div>\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "Total Height: Total Height = Content Height + Top Padding + Bottom Padding + Top Border + Bottom Border"
        },
        {
          "type": "textarea",
          "text": ".element {\n    height: 150px; /* Content height */\n    padding-top: 15px; /* Top padding */\n    padding-bottom: 15px; /* Bottom padding */\n    border-top: 5px solid #000; /* Top border */\n    border-bottom: 5px solid #000; /* Bottom border */\n}\n\n/* Total Height = Content Height + Top Padding + Bottom Padding + Top Border + Bottom Border */\n/* Total Height = 150px + 15px + 15px + 5px + 5px = 190px */",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Box Model Demo</title>\n<style>\n.element {\n    height: 150px; /* Content height */\n    padding-top: 15px; /* Top padding */\n    padding-bottom: 15px; /* Bottom padding */\n    border-top: 5px solid #000; /* Top border */\n    border-bottom: 5px solid #000; /* Bottom border */\n}\n\n/* Total Height = Content Height + Top Padding + Bottom Padding + Top Border + Bottom Border */\n/* Total Height = 150px + 15px + 15px + 5px + 5px = 190px */\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a height of 150px, a top padding of 15px, a bottom padding of 15px, a top border of 5px solid black, and a bottom border of 5px solid black.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Outline": [
    {
      "title": "CSS Outline",
      "description": "An outline is a line drawn outside border of an element and around an element to make the it stand-out. ",
      "sub_description": "It does not affect layout unlike borders and it is used to provide visual emphasis without any change to the dimension of an element.",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "2",
          "text": "CSS Outline properties:"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "outline-style:"
        },
        {
          "type": "paragraph",
          "text": "It defines the style of an outline. It is similar to border-style property of borders. It can take up following values:"
        },
        {
          "type": "list",
          "items": [
            "none: No border is displayed.",
            "solid: A solid border is displayed.",
            "double: This defines a double solid border.It creates two solid lines with gap in-between them.",
            "dotted: A dotted border is displayed.",
            "dashed: This defines a dashed border.",
            "groove: This displays a 3D grooved border which looks like it is carved into the page, its colour is dependent on the elements background colour and effect depends on border-colour value.",
            "ridge: This displays a 3D ridged border which looks like it is raised from the page. Its effect depends on border-colour value.",
            "inset: This displays a 3D inset border and makes it look like it is embedded into the page. Its effect depends on border-colour value.",
            "outset: This displays a 3D outset border and makes element appear raised from the page. Its effect depends on border-colour value.",
            "hidden: This displays a hidden border which means it is not visible."
          ]
        },
        {
          "type": "textarea",
          "text": ".element {\n    outline-style: dotted;/* Example of using a dotted outline style */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Outline Demo</title>\n<style>\n.element {\n    outline-style: dotted;/* Example of using a dotted outline style */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a dotted outline style.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "outline-width:"
        },
        {
          "type": "paragraph",
          "text": "It defines the width of an outline. It can take up values:thin (which is 1px)medium (which is 3px)thick (which is 5px)any length in px, pt, rem etc."
        },
        {
          "type": "textarea",
          "text": ".element {\n    outline-width: 3px; /* Example of setting the outline width to 3 pixels */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Outline Demo</title>\n<style>\n.element {\n    outline-width: 3px; /* Example of setting the outline width to 3 pixels */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with an outline width of 3 pixels.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "outline-color:"
        },
        {
          "type": "paragraph",
          "text": "This property is used to define the color of an outline."
        },
        {
          "type": "textarea",
          "text": ".element {\n    outline-color: red; /* Example of setting the outline color to red */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Outline Demo</title>\n<style>\n.element {\n    outline-color: red; /* Example of setting the outline color to red */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with an outline color of red.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "outline-offset:"
        },
        {
          "type": "paragraph",
          "text": "This property is used to add distance between outline and border or edge of an element. When used, the space between element and outline is transparent."
        },
        {
          "type": "textarea",
          "text": ".element {\n    outline-offset: 5px; /* Example of setting the outline offset to 5 pixels */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Outline Demo</title>\n<style>\n.element {\n    outline-offset: 5px; outline-style:dotted; outline-color:red; /* Example of setting the outline offset to 5 pixels */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with an outline offset of 5 pixels.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Outline shorthand property:"
        },
        {
          "type": "paragraph",
          "text": "It is the shorthand property for writing outline-width, outline-style and outline-color."
        },
        {
          "type": "paragraph",
          "text": "Syntax:outline: outline-width outline-style outline-color;"
        },
        {
          "type": "textarea",
          "text": ".element {\n    outline: 2px dashed #ff0000; /* Example of setting outline width, style, and color in shorthand */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Outline Demo</title>\n<style>\n.element {\n    outline: 2px dashed #ff0000; /* Example of setting outline width, style, and color in shorthand */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with an outline of 2px dashed red.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Text Formatting": [
    {
      "title": "CSS Text formatting properties",
      "description": "",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "5",
          "text": "color property:"
        },
        {
          "type": "paragraph",
          "text": "The color property is used to specify color for text of an element.It takes values that are color name like red, green etc, rgb or rgba like rgb(255,0,0,0.5), hex like #00ff00 and hsl or hsla values like hsla(90,90%,50%,0.9)."
        },
        {
          "type": "textarea",
          "text": ".element {\n    color: rgba(255, 0, 0, 0.5); /* Example of using RGBA for text color */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    color: rgba(255, 0, 0, 0.5); /* Example of using RGBA for text color */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a text color of rgba(255, 0, 0, 0.5).</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "background-color property:"
        },
        {
          "type": "paragraph",
          "text": "The background-color property defines background color for an element. It takes the same values as color property."
        },
        {
          "type": "textarea",
          "text": ".element {\n    background-color: #00ff00; /* Example of using HEX for background color */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    background-color: #00ff00; /* Example of using HEX for background color */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a background color of #00ff00.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "text-align property:"
        },
        {
          "type": "paragraph",
          "text": "The text-align property is used to align text horizontally. It takes values like left or right, center or justified."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-align: center; /* Example of centering text within an element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-align: center; /* Example of centering text within an element */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with text aligned to the center.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "text-decoration-style property:"
        },
        {
          "type": "paragraph",
          "text": "The text-decoration-style property is used to set the style of decoration line. It can have values which are solid (by default) for a straight line, double for two straight lines, dotted for dotted lines, dashed for dashes in line and wavy for a line that looks like a wave."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-decoration-style: dashed; /* Example of applying a dashed style to text decoration */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-decoration-style: dashed; text-decoration-line: underline; /* Example of applying a dashed style to text decoration */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a dashed text decoration style.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "text-align-last property:"
        },
        {
          "type": "paragraph",
          "text": "The text-align-last property defines how the last line of a text is aligned. It takes the same values as text-align which are left or right, center or justified."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-align-last: right; /* Example of aligning the last line of text to the right */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-align-last: right; /* Example of aligning the last line of text to the right */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with the last line of text aligned to the right.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "direction and unicode-bidi property:"
        },
        {
          "type": "paragraph",
          "text": "The direction and Unicode-bidi properties are used to specify how the text-flow or direction of text and how bidirectional text is displayed. Values taken by direction is rtl(right to left) and ltr(left to right), and values taken by Unicode-bidi is normal, embed and bidi-override."
        },
        {
          "type": "textarea",
          "text": ".element {\n    direction: rtl; /* Sets the text direction to right-to-left */\n    unicode-bidi: embed; /* Controls the handling of bidirectional text */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    direction: rtl; /* Sets the text direction to right-to-left */\n    unicode-bidi: embed; /* Controls the handling of bidirectional text */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with the text direction set to right-to-left and bidirectional text handling set to embed.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS Text Decoration:"
        },
        {
          "type": "paragraph",
          "text": "Text direction properties in CSS are used to define decoration on text like an underline, strikethrough etc."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-decoration: underline; /* Adds an underline to the text */\n    text-decoration-color: red; /* Specifies the color of the text decoration */\n    text-decoration-style: dashed; /* Sets the style of the text decoration to dashed */\n    text-decoration-thickness: 2px; /* Defines the thickness of the underline */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-decoration: underline; /* Adds an underline to the text */\n    text-decoration-color: red; /* Specifies the color of the text decoration */\n    text-decoration-style: dashed; /* Sets the style of the text decoration to dashed */\n    text-decoration-thickness: 2px; /* Defines the thickness of the underline */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with an underline text decoration of 2px thickness and red color.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "text-decoration-style property:"
        },
        {
          "type": "paragraph",
          "text": "The text-decoration-style property is used to set the style of decoration line. It can have values which are solid (by default) for a straight line, double for two straight lines, dotted for dotted lines, dashed for dashes in line and wavy for a line that looks like a wave."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-decoration-style: wavy; /* Sets the text decoration style to wavy */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-decoration-style: wavy; text-decoration-line: underline; /* Sets the text decoration style to wavy */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a wavy text decoration style.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "text-decoration-thickness property:"
        },
        {
          "type": "paragraph",
          "text": "The text-decoration-thickness property is used to specify the thickness for decoration line.It can take values which are auto (by default) in which browser automatically calculates the thickness, length in px, pt etc, (%) percentage and from-font which takes the thickness of font as line’s thickness."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-decoration-thickness: 2px; /* Sets the thickness of the text decoration to 2px */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-decoration-thickness: 2px; text-decoration-line: underline; /* Sets the thickness of the text decoration to 2px */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a text decoration thickness of 2px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "text-decoration shorthand property:"
        },
        {
          "type": "paragraph",
          "text": "The text-decoration property is the shorthand for text-decoration-line, text-decoration-color, text-decoration-style and text-decoration-thickness properties."
        },
        {
          "type": "paragraph",
          "text": "Syntax:text-decoration: text-decoration-line(required) text-decoration-color(optional) text-decoration-style(optional) text-decoration-thickness(optional)."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-decoration: underline dotted red 2px; /* Shorthand for text decoration: style, color, and thickness */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-decoration: underline dotted red 2px; /* Shorthand for text decoration: style, color, and thickness */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a text decoration of underline dotted red 2px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Text transformation:"
        },
        {
          "type": "paragraph",
          "text": "The text-transform property is used to define lowercase and uppercase letters in a text. Values it can take are none (by default), uppercase to transform all letters to uppercase, lowercase to transform all letters to lowercase, capitalize to make every first letter of a word uppercase and full-width which transforms letters to their full width version."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-transform: uppercase; /* Transforms text to all uppercase */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-transform: uppercase; /* Transforms text to all uppercase */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with text transformed to all uppercase.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS text spacing:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Text indentation:"
        },
        {
          "type": "paragraph",
          "text": "The text-indent property defines an indentation to the first line of text."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-indent: 20px; /* Indents the first line of text by 20px */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-indent: 20px; /* Indents the first line of text by 20px */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with the first line of text indented by 20px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Letter spacing:"
        },
        {
          "type": "paragraph",
          "text": "The letter-spacing property adds pace between letters of a text."
        },
        {
          "type": "textarea",
          "text": ".element {\n    letter-spacing: 2px; /* Adds 2px space between characters */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    letter-spacing: 2px; /* Adds 2px space between characters */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a letter spacing of 2px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Line height:"
        },
        {
          "type": "paragraph",
          "text": "The line-height property defines space between lines."
        },
        {
          "type": "textarea",
          "text": ".element {\n    line-height: 1.5; /* Sets the space between lines to 1.5 times the font size */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    line-height: 1.5; /* Sets the space between lines to 1.5 times the font size */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a line height of 1.5 times the font size.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Word spacing:"
        },
        {
          "type": "paragraph",
          "text": "The word-spacing property adds space between every word of a text."
        },
        {
          "type": "textarea",
          "text": ".element {\n    word-spacing: 10px; /* Increases the space between words by 10 pixels */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    word-spacing: 10px; /* Increases the space between words by 10 pixels */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a word spacing of 10px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "White space:"
        },
        {
          "type": "paragraph",
          "text": "The white-space property specifies how the white space is inside an element is handled (such as spaces, line breaks and tabs)."
        },
        {
          "type": "textarea",
          "text": ".element {\n    white-space: nowrap; /* Prevents text from wrapping to a new line */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    white-space: nowrap; /* Prevents text from wrapping to a new line */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with white space set to nowrap.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Text shadow:"
        },
        {
          "type": "paragraph",
          "text": "The text-shadow property adds shadow to a text which allows us to create variety of visual styles such as glowing text, subtle highlights, or more dramatic 3D effects.Syntax:text-shadow: horizontal-offset vertical-offset blur-radius color."
        },
        {
          "type": "textarea",
          "text": ".element {\n    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); /* Adds a shadow effect to the text */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Text Formatting Demo</title>\n<style>\n.element {\n    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); /* Adds a shadow effect to the text */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a text shadow of 2px 2px 5px rgba(0, 0, 0, 0.5).</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Fonts": [
    {
      "title": "CSS Fonts",
      "description": "The right font has a huge impact on readers experience on a website. It must be easy to read with te right colors and font size.",
      "sub_description": " A font helps build an identity for a website.",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Common font families:"
        },
        {
          "type": "paragraph",
          "text": "There are several commonly used generic font families:"
        },
        {
          "type": "list",
          "items": [
            "Serif: This font has small strokes at the edge of each letter. It promotes a sense of formality and elegance.",
            "Sans-serif: This font has clean lines (no small strokes). It has a modern and minimalistic look.",
            "Monospace: All letters in this font have same fixed width. It has a mechanical look.",
            "Cursive: This is a copy of handwritten text.",
            "fantasy: These are decorative/playful fonts."
          ]
        },
        {
          "type": "textarea",
          "text": "element {\n    font-family: 'Arial', sans-serif;\n    font-size: 16px;\n    font-weight: bold;\n    font-style: italic;\n    line-height: 1.5;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\nCSS Font Properties:\n\n.element {\n    font-family: 'Arial', sans-serif;\n    font-size: 16px;\n    font-weight: bold;\n    font-style: italic;\n    line-height: 1.5;\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font family of Arial, sans-serif, a font size of 16px, a font weight of bold, a font style of italic, and a line height of 1.5.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Font Style:"
        },
        {
          "type": "paragraph",
          "text": "The font-style property is used to specify style of the font that is normal, italic or oblique. It changes the appearance of text based on font style.<br><b>Values for font-style:</b>"
        },
        {
          "type": "list",
          "items": [
            "normal: This is by default and applies normal upright style to the text.",
            "italic: This applies italic style to the text where text is slanted to the right.",
            "oblique: This just like italics slants text to the right but it is generally less pronounced than in italics."
          ]
        },
        {
          "type": "textarea",
          "text": ".element {\n    font-style: italic; /* Applies italic style to the text */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n    font-style: italic; /* Applies italic style to the text */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font style of italic.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Font weight: "
        },
        {
          "type": "paragraph",
          "text": "The font-weight property specifies weight or boldness of the font. It regulates how light or heavy the text looks. Different levels of boldness are represented by the various values that the property supports, which range from normal to numeric values.<br><b>Values for font-weight property:</b>"
        },
        {
          "type": "list",
          "items": [
            "normal: This is the default value. The numeric values for normal is equivalent to 400. It displays text in its regular font weight.",
            "bold: This is used to make the text bold and it is the equivalent weight of 700 in numeric value.",
            "Numeric values (from 100 to 900):In CSS you can specify boldness of text in font-weight property using numeric values.Here 100 means thinnest and 900 means boldest, and 400 is normal or regular and 700 is bold."
          ]
        },
        {
          "type": "paragraph",
          "text": "Commonly used values:<br>100 means thin<br>200 means extra Light<br>300 means light<br>400 means normal or regular<br>500 means medium<br>600 means semi-bold<br>700 means bold<br>800 means extra-bold<br>900 means black"
        },
        {
          "type": "textarea",
          "text": ".element {\n    font-weight: bold; /* Makes the text bold */\n    font-weight: 600; /* Applies a semi-bold weight to the text */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n    font-weight: bold; /* Makes the text bold */\n    font-weight: 600; /* Applies a semi-bold weight to the text */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font weight of bold and 600.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "bolder: "
        },
        {
          "type": "paragraph",
          "text": "This value makes text’s font weight bolder than its parent element’s font weight, making it thicker."
        },
        {
          "type": "textarea",
          "text": ".element {\n    font-weight: bolder; /* Makes the text bolder than its parent element's font weight */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n    font-weight: bolder; /* Makes the text bolder than its parent element's font weight */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font weight of bolder.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "lighter:"
        },
        {
          "type": "paragraph",
          "text": " This value makes text’s font weight lighter than its parent element’s font weight, making it thinner."
        },
        {
          "type": "textarea",
          "text": ".element {\n    font-weight: lighter; /* Makes the text lighter than its parent element's font weight */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n    font-weight: lighter; /* Makes the text lighter than its parent element's font weight */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font weight of lighter.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Font size:"
        },
        {
          "type": "paragraph",
          "text": "The font-size property is used to set the size of text in an element. Being able to control the text size is vital in web designing, however you should not attempt to turn size of headings to paragraph and vice versa."
        },
        {
          "type": "textarea",
          "text": ".element {\n    font-size: 16px; /* Sets the font size to 16 pixels */\n}\n\n.element {\n    font-size: 1.5em; /* Sets the font size to 1.5 times the size of the parent element's font size */\n}\n\n.element {\n    font-size: 120%; /* Sets the font size to 120% of the parent element's font size */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n    font-size: 16px; /* Sets the font size to 16 pixels */\n}\n\n.element {\n    font-size: 1.5em; /* Sets the font size to 1.5 times the size of the parent element's font size */\n}\n\n.element {\n    font-size: 120%; /* Sets the font size to 120% of the parent element's font size */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font size of 16px, 1.5em, and 120%.</div>\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "<b>Values for font-size property:</b>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Absolute units: "
        },
        {
          "type": "paragraph",
          "text": "This type of value is fixed and does not alter based on factors like user preferences or screen size. This value is not generally recommended for responsive design. Units used are pixels(px), pt, cm, mm, in, em and rem."
        },
        {
          "type": "textarea",
          "text": ".element {\n       font-size: 12px; /* Sets the font size to 12 pixels */\n }",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n       font-size: 12px; /* Sets the font size to 12 pixels */\n   }\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font size of 12px.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Relative units: "
        },
        {
          "type": "paragraph",
          "text": "Sets the size of text in element based on size of surrounding elements. This means it user can change the text size in browsers. Units used are (%) percentage, vh (viewport height) and vw (viewport width)."
        },
        {
          "type": "textarea",
          "text": ".element {\n   font-size: 1.5em; /* Sets font size to 1.5 times the parent element's size */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n   font-size: 1.5em; /* Sets font size to 1.5 times the parent element's size */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font size of 1.5em.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Font shorthand:"
        },
        {
          "type": "paragraph",
          "text": "The font property is the shorthand to set several font-related properties in a single line.<br>Syntax:font: font-style font-variant font-weight font-size line-height font-family;"
        },
        {
          "type": "textarea",
          "text": ".element {\n   font: italic bold 16px/2 Arial, sans-serif; /* font-style font-weight font-size/line-height font-family */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Fonts Demo</title>\n<style>\n.element {\n   font: italic bold 16px/2 Arial, sans-serif; /* font-style font-weight font-size/line-height font-family */\n}\n</style>\n</head>\n<body>\n<div class=\"element\">This is an element with a font of italic bold 16px/2 Arial, sans-serif.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Icons": [
    {
      "title": "CSS Icons",
      "description": "Icon can be used to enhance visual appeal and usability of website. Icons can be easily applied using icon libraries.",
      "sub_description": "The straightforward way to add icons is using an icon library like font awesome and bootstrap icons.",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Using font awesome for icons:"
        },
        {
          "type": "paragraph",
          "text": "Go to fontawesome.com, log in, and obtain a code to include in the section of your HTML page in order to use the Font Awesome icons. Put the CDN link in header tag and begin using the icons."
        },
        {
          "type": "textarea",
          "text": "<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\">\n\n<!-- Example of using Font Awesome icons -->\n<i class=\"fas fa-coffee\"></i>  <!-- Coffee icon -->\n<i class=\"fas fa-heart\"></i>   <!-- Heart icon -->\n<i class=\"fas fa-user\"></i>    <!-- User icon -->",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>CSS Icons Demo</title>\n\n  <!-- Load Font Awesome properly -->\n  <link rel=\"stylesheet\"\n        href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\">\n\n  <style>\n    .element {\n      font: italic bold 16px/2 Arial, sans-serif;\n    }\n  </style>\n</head>\n\n<body>\n\n  <div class=\"element\">\n    This is an element with a font of italic bold 16px/2 Arial, sans-serif.\n  </div>\n\n  <!-- Icons must be inside body -->\n  <i class=\"fas fa-coffee\"></i>  <!-- Coffee icon -->\n  <i class=\"fas fa-user\"></i>    <!-- User icon -->\n  <i class=\"fas fa-heart\"></i>   <!-- Heart icon -->\n\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Using bootstrap for icons:"
        },
        {
          "type": "paragraph",
          "text": "Search bootstrap CDN online and in the bootstraps official website find the CDN link and paste it into the header tag of html document. "
        },
        {
          "type": "textarea",
          "text": "<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css\">\n\n<!-- Example of using Bootstrap icons -->\n<i class=\"bi bi-alarm\"></i>  <!-- Alarm icon -->\n<i class=\"bi bi-heart\"></i>  <!-- Heart icon -->\n<i class=\"bi bi-person\"></i>  <!-- Person icon -->",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>CSS Icons Demo</title>\n\n  <!-- Bootstrap CSS (optional) -->\n  <link rel=\"stylesheet\"\n        href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css\">\n\n  <!-- Bootstrap Icons (REQUIRED for icons to work) -->\n  <link rel=\"stylesheet\"\n        href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css\">\n\n  <style>\n    .element {\n      font: italic bold 16px/2 Arial, sans-serif;\n    }\n  </style>\n</head>\n\n<body>\n\n  <div class=\"element\">\n    This is an element with a font of italic bold 16px/2 Arial, sans-serif.\n  </div>\n\n  <!-- Icons must be inside body -->\n  <i class=\"bi bi-alarm\"></i>\n  <i class=\"bi bi-heart\"></i>\n  <i class=\"bi bi-person\"></i>\n\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Links": [
    {
      "title": "CSS Links",
      "description": "In CSS links can be styled in lots of ways.Properties like color, background-color, font-family, font-size, text-decoration etc can be used on links to manage their styling.",
      "sub_description": "There are four states in which style of links can be applied, namely:",
      "additional_info": "link, visited, hover, active",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "a:link – "
        },
        {
          "type": "paragraph",
          "text": "It is a normal and an unvisited link."
        },
        {
          "type": "textarea",
          "text": "a:link {\n    color: blue; /* Change the link color to blue */\n    text-decoration: none; /* Remove underline from the link */\n}\n<a href=\"https://www.webcooks.in\">Visit Webcooks</a>\n",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n  <title>CSS Links Demo</title>\n\n  <style>\n    a:link {\n      color: blue;            /* Change the link color to blue */\n      text-decoration: none;  /* Remove underline */\n    }\n\n    a:hover {\n      color: red;             /* Optional: change color on hover */\n    }\n  </style>\n\n</head>\n\n<body>\n\n  <div class=\"element\">\n    This is an element with a link of blue color and no underline.\n  </div>\n\n  <!-- Link must be inside body -->\n  <a href=\"https://www.webcooks.in\">Visit Webcooks</a>\n\n</body>\n\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "a:visited –"
        },
        {
          "type": "paragraph",
          "text": "It is a link that the user has visited."
        },
        {
          "type": "textarea",
          "text": "a:visited {\n    color: purple; /* Change the link color to purple */\n    text-decoration: underline; /* Add underline to the visited link */\n}\n<a href=\"https://www.webcooks.in\">Visit Webcooks</a>\n",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n  <title>CSS Links Demo</title>\n\n  <style>\n    a:visited {\n      color: purple;          /* Change visited link color */\n      text-decoration: underline;  /* Add underline */\n    }\n  </style>\n\n</head>\n\n<body>\n\n  <div class=\"element\">\n    This is an element with a link of purple color and underline.\n  </div>\n\n  <!-- Link must be inside body -->\n  <a href=\"https://www.webcooks.in\">Visit Webcooks</a>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "a:hover – "
        },
        {
          "type": "paragraph",
          "text": "It’s the link when users mouse hovers over it."
        },
        {
          "type": "textarea",
          "text": "a:hover {\n    color: orange; /* Change the link color to orange */\n    text-decoration: underline; /* Add underline to the link on hover */\n}\n<a href=\"https://www.webcooks.in\">Hover over Webcooks</a>\n",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <title>CSS Links Demo</title>\n  <style>\n    a:hover {\n      color: orange;           /* Change color on hover */\n      text-decoration: underline;  /* Add underline on hover */\n    }\n  </style>\n</head>\n<body>\n  <div class=\"element\">\n    This is an element with a link of orange color and underline on hover.\n  </div>\n  <!-- Link must be inside body -->\n  <a href=\"https://www.webcooks.in\">Hover over Webcooks</a>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "a:active –"
        },
        {
          "type": "paragraph",
          "text": " It is a link when it is clicked"
        },
        {
          "type": "textarea",
          "text": "a:active {\n    color: red; /* Change the link color to red when active */\n    font-weight: bold; /* Make the link bold while active */\n}\n<a href=\"https://www.webcooks.in\">Click me!</a>\n",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Links Demo</title>\n<style>\na:active {\ncolor: red;\nfont-weight: bold;\n}\n</style>\n</head>\n<body>\n<div class=\"element\">\nThis is an element with a link of red color and bold when active.\n</div>\n<a href=\"https://www.webcooks.in\">Click me !</a>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Lists": [
    {
      "title": "CSS Lists",
      "description": "There are two type of lists in CSS:",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Ordered list:"
        },
        {
          "type": "paragraph",
          "text": "This list has an order which means items are marked with numbers or letters."
        },
        {
          "type": "textarea",
          "text": "ol{ \n\tlist-style-type: decimal; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS List Style Demo</title>\n<style>\nol{list-style-type:decimal;}\n</style>\n</head>\n<body>\n<h1>Ordered List Example</h1>\n<ol>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ol>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Unordered list:"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": "ul { \n\tlist-style-type: disc; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Unordered List Demo</title>\n<style>\nul{list-style-type:disc;}\n</style>\n</head>\n<body>\n<h1>Unordered List Example</h1>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Different List Item Markers:"
        },
        {
          "type": "paragraph",
          "text": "The kind of list item marker is specified by the list-style-type attribute. Type of list item markers are displayed in example below:"
        },
        {
          "type": "textarea",
          "text": "ul { \n\tlist-style-type: circle; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS List Style Demo</title>\n<style>\nul{list-style-type:circle;}\n</style>\n</head>\n<body>\n<h1>Unordered List Example</h1>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "You can also use an image as a list item marker using list-style-image property."
        },
        {
          "type": "textarea",
          "text": "ul { \n\tlist-style-image: url('marker.png'); \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS List Style Demo</title>\n<style>\nul{list-style-image:url('https://www.webcooks.in/lms/assets/images/marker.png');list-style-position: inside;}\n</style>\n</head>\n<body>\n<h1>Unordered List Example</h1>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Position The List Item Markers:"
        },
        {
          "type": "paragraph",
          "text": "The marker's (bullet, number, etc.) positioning in respect to the list item text is controlled by the list-style-position property. "
        },
        {
          "type": "list",
          "items": [
            "inside: Since the marker is inside the list item box, it will be placed inside the list item's padding area. ",
            "outside: By default, the marker is outside the list item box."
          ]
        },
        {
          "type": "textarea",
          "text": "ul { \n\tlist-style-position: inside; \n}\nul { \n\tlist-style-position: outside; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS List Style Demo</title>\n<style>\nul{list-style-position:inside;}\n</style>\n</head>\n<body>\n<h1>Unordered List Example</h1>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Remove Default Settings:"
        },
        {
          "type": "paragraph",
          "text": "The list-style-type:none can be applied to remove markers from the list and margin:0 and padding:0 can be applied to or to remove default margin and padding."
        },
        {
          "type": "textarea",
          "text": "ul { \n\tlist-style: none; \n\tpadding: 0; \n\tmargin: 0; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS List Style Demo</title>\n<style>\nul{list-style:none;padding:0;margin:0;}\n</style>\n</head>\n<body>\n<h1>Unordered List Example</h1>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "List shorthand property:"
        },
        {
          "type": "paragraph",
          "text": "The list-style is the shorthand property for several list styling properties. "
        },
        {
          "type": "paragraph",
          "text": "Syntax:list-style: list-style-type list-style-position list-style-image;"
        },
        {
          "type": "textarea",
          "text": "ul { \n\tlist-style: square inside; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS List Style Demo</title>\n<style>\nul{list-style:square inside;}\n</style>\n</head>\n<body>\n<h1>Unordered List Example</h1>\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>JavaScript</li>\n</ul>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Tables": [
    {
      "title": "CSS Tables",
      "description": "Styling of tables can be done using CSS to manage the look of tables.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Table borders:"
        },
        {
          "type": "paragraph",
          "text": "The border property can be used to manage the styling of border of a table. "
        },
        {
          "type": "textarea",
          "text": "table { \n\tborder: 1px solid black; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntable{border:1px solid black;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Table width:"
        },
        {
          "type": "paragraph",
          "text": "The width property can be used to change width of a table for example setting it to 100% can be done."
        },
        {
          "type": "textarea",
          "text": "table { \n\twidth: 100%; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntable{width:100%;border: 1px solid black; }\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Table collapse property:"
        },
        {
          "type": "paragraph",
          "text": "The table borders can be collapsed into 1 single border using border-collapse property."
        },
        {
          "type": "textarea",
          "text": "table { \n\tborder-collapse: collapse; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntable{border-collapse:collapse;}\ntable td{border: 1px solid black;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Table Size:"
        },
        {
          "type": "paragraph",
          "text": "The size of the table can be set using height and width property. "
        },
        {
          "type": "textarea",
          "text": "table { \n\ttable-layout: fixed; \n\twidth: 250px; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntable{table-layout:fixed;width:250px;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS table alignment:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Horizontal alignment:"
        },
        {
          "type": "paragraph",
          "text": "The horizontal alignment of table data in table can be set using text-align property. By default, element’s content is aligned to the center, whereas element’s content is oriented to the left.For example:"
        },
        {
          "type": "list",
          "items": [
            "text-align: center;: This aligns text to center horizontally.",
            "text-align: left;: This aligns text to the left horizontally.",
            "text-align: right;: This aligns text to the right horizontally."
          ]
        },
        {
          "type": "textarea",
          "text": "td { \n\ttext-align: center; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\n table {\n\twidth: 100%;\n\tborder:solid 1px black;\n}\ntd{text-align:center;\nborder:solid 1px black;\n}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Vertical alignment:"
        },
        {
          "type": "paragraph",
          "text": "The vertical alignment of text is set by using vertical-align property. It takes values such as, top, bottom and center or middle."
        },
        {
          "type": "textarea",
          "text": "td { \n\tvertical-align: middle; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntd{ height: 100px;\nborder: solid 1px black;\nvertical-align:middle;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "CSS Table Styling:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Padding:"
        },
        {
          "type": "paragraph",
          "text": "The padding property is used to add space between content and border of the table. This property is applied to and elements."
        },
        {
          "type": "textarea",
          "text": "td { \n\tpadding: 10px; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntd{padding:10px;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Horizontal dividers:"
        },
        {
          "type": "paragraph",
          "text": "After applying border-collapse: collapse property to the you can add border-bottom property can be applied to content of the table (mainly &lt;th&gt; and &lt;td&gt; tag.)This will create an effect of horizontal dividers."
        },
        {
          "type": "textarea",
          "text": "tr { \n\tborder-bottom: 1px solid #ccc; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntr{border-bottom:1px solid #ccc;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Hoverable table:"
        },
        {
          "type": "paragraph",
          "text": "The :hover selector can be used to <tr> tag to make the rows hoverable in a table."
        },
        {
          "type": "textarea",
          "text": "table { \n\tborder-collapse: collapse; \n}\ntr:hover { \n\tbackground-color: #f5f5f5; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Table Demo</title>\n<style>\ntable{border-collapse:collapse;}\ntr:hover{background-color:#f5f5f5;}\n</style>\n</head>\n<body>\n<table>\n<tr>\n<td>HTML</td>\n<td>CSS</td>\n<td>JavaScript</td>\n</tr>\n</table>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "Responsive Table:"
        },
        {
          "type": "paragraph",
          "text": "If the screen is too small to display the full content, a responsive table will show a horizontal scroll bar.This can be done by using overflow-x:auto property."
        },
        {
          "type": "textarea",
          "text": ".table-responsive { \n\toverflow-x: auto; \n\twidth: 100%; \n\tdisplay: block; \n}\n\n.table { \n\twidth: 100%; \n\tborder: 1px solid #ddd; \n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Responsive Table Demo</title>\n<style>\n.table-responsive{overflow-x:auto;width:100%;display:block;}\n.table{width:100%;border:1px solid #ddd;border-collapse:collapse;}\n.table th,.table td{border:1px solid #ddd;padding:8px;text-align:left;}\n</style>\n</head>\n<body>\n<h1>Responsive Table Example</h1>\n<div class=\"table-responsive\">\n<table class=\"table\">\n<thead>\n<tr>\n<th>Course</th>\n<th>Duration</th>\n<th>Level</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>HTML</td>\n<td>4 Weeks</td>\n<td>Beginner</td>\n</tr>\n<tr>\n<td>CSS</td>\n<td>6 Weeks</td>\n<td>Intermediate</td>\n</tr>\n<tr>\n<td>JavaScript</td>\n<td>8 Weeks</td>\n<td>Advanced</td>\n</tr>\n</tbody>\n</table>\n</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Display property": [
    {
      "title": "CSS Display property",
      "description": "One of the most crucial and often used CSS properties for regulating how items are arranged on a webpage is the display property.",
      "sub_description": "It chooses how an element appears on the screen and works with other elements.",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Block-level elements:"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": "div {\n\twidth: 100%;\n\tmargin: 10px 0;\n\tbackground-color: #f0f0f0;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Block-level Elements Demo</title>\n<style>\ndiv{width:100%;margin:10px 0;background-color:#f0f0f0;}\n</style>\n</head>\n<body>\n<h1>Block-level Elements Example</h1>\n<div>This is a block-level element.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Inline elements:"
        },
        {
          "type": "paragraph",
          "text": "An inline element is an element which takes only necessary width and does not start on a new line."
        },
        {
          "type": "textarea",
          "text": "span {\n\tcolor: blue;\n\tfont-weight: bold;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Inline Elements Demo</title>\n<style>\nspan{color:blue;font-weight:bold;}\n</style>\n</head>\n<body>\n<h1>Inline Elements Example</h1>\n<span>This is an inline element.</span>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Display: none property -"
        },
        {
          "type": "paragraph",
          "text": "An element is not displayed when its none value is used. The element is completely removed from the document flow, thus there will be no room for it in the layout."
        },
        {
          "type": "textarea",
          "text": ".hidden {\n\tdisplay: none;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Display Property Demo</title>\n<style>\n.hidden{display:none;}\n</style>\n</head>\n<body>\n<h1>Display: none Example</h1>\n<div class=\"hidden\">This element is hidden using display: none.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Override The Default Display Value:"
        },
        {
          "type": "paragraph",
          "text": "You can change an inline element to block level and vice versa using display property."
        },
        {
          "type": "textarea",
          "text": ".override {\n\tdisplay: block;\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Display Property Demo</title>\n<style>\n.override{display:block;}\n</style>\n</head>\n<body>\n<h1>Display: block Example</h1>\n<div class=\"override\">This element is displayed as a block.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Hide an Element - display:none or visibility:hidden?:"
        },
        {
          "type": "paragraph",
          "text": "Using display: none, the element will be hidden and not occupy the same space in the webpage while using visibility: hidden, the element will be hidden but will occupy same space in the web page."
        },
        {
          "type": "textarea",
          "text": ".hidden {\n\tdisplay: none; /* Removes the element from the document flow */\n}\n\n.visible-hidden {\n\tvisibility: hidden; /* Hides the element but maintains its space */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Display Property Demo</title>\n<style>\n.hidden{display:none;}\n.visible-hidden{visibility:hidden;}\n</style>\n</head>\n<body>\n<h1>Display: none and visibility: hidden Example</h1>\n<div class=\"hidden\">This element is hidden using display: none.</div>\n<div class=\"visible-hidden\">This element is hidden using visibility: hidden.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Position": [
    {
      "title": "CSS Position",
      "description": "In CSS, the position property determines an element's placement inside its parent container or throughout the document. ",
      "sub_description": "An element's layout and interactions with other elements are determined also by its position property.",
      "additional_info": "There are 5 possible position values:",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "static:"
        },
        {
          "type": "paragraph",
          "text": "This is the default property for position of an element."
        },
        {
          "type": "textarea",
          "text": "static {\n\tposition: static;\n\t/* Default position value, elements are positioned according to the normal flow */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Position Property Demo</title>\n<style>\nstatic{position:static;}\n</style>\n</head>\n<body>\n<h1>Static Position Example</h1>\n<div class=\"static\">This element is positioned static.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "relative:"
        },
        {
          "type": "paragraph",
          "text": "The element with position: relative property will be positioned relative to its normal position. Setting top, right, left and bottom values for this element will adjust its position from its normal position."
        },
        {
          "type": "textarea",
          "text": "relative {\n\tposition: relative;\n\ttop: 10px;\n\tleft: 20px;\n\t/* Element is positioned relative to its normal position */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Position Property Demo</title>\n<style>\nrelative{position:relative;top:10px;left:20px;}\n</style>\n</head>\n<body>\n<h1>Relative Position Example</h1>\n<div class=\"relative\">This element is positioned relative.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "fixed:"
        },
        {
          "type": "paragraph",
          "text": "The position: fixed; makes an element fixed in its position relative to viewport which means the element stays in the same place even if webpage is scrolled. "
        },
        {
          "type": "textarea",
          "text": "fixed {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\t/* Element is positioned relative to the viewport */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Position Property Demo</title>\n<style>\n.fixed{position:fixed;top:0;left:0;}\n</style>\n</head>\n<body>\n<h1>Fixed Position Example</h1>\n<div class=\"fixed\">This element is positioned fixed.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "absolute:"
        },
        {
          "type": "paragraph",
          "text": "The element with postion: absolute; is positioned relative to the nearest positioned ancestor (i.e., an ancestor element with position as relative, absolute or fixed). If the absolute positioned element has no positioned ancestor then it positions itself relative to document body and moves with scrolling the page."
        },
        {
          "type": "textarea",
          "text": "absolute {\n\tposition: absolute;\n\ttop: 50px;\n\tleft: 100px;\n\t/* Element is positioned relative to its nearest positioned ancestor */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Position Property Demo</title>\n<style>\n.absolute{position:absolute;top:50px;left:100px;}\n</style>\n</head>\n<body>\n<h1>Absolute Position Example</h1>\n<div class=\"absolute\">This element is positioned absolute.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "sticky:"
        },
        {
          "type": "paragraph",
          "text": "The position:sticky; element is treated as relative until the page is scrolled to a certain positon where it becomes fixed. The top, right, bottom, and left properties manage where the element sticks before reaching a position to become fixed."
        },
        {
          "type": "textarea",
          "text": "sticky {\n\tposition: sticky;\n\ttop: 0;\n\t/* Element is positioned based on the user's scroll position */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Position Property Demo</title>\n<style>\n.sticky{position:sticky;top:0;}\n</style>\n</head>\n<body>\n<h1>Sticky Position Example</h1>\n<div class=\"sticky\">This element is positioned sticky.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The z-index property:"
        },
        {
          "type": "paragraph",
          "text": "The z-index property is used to control the stacking order of an element. It is done to manage the overlapping stacking order of elements. Stack order for an element can be positive or negative."
        },
        {
          "type": "textarea",
          "text": ".element {\n\tposition: relative;\n\tz-index: 10;\n\t/* Specifies the stack order of the element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Position Property Demo</title>\n<style>\n.element{position:relative;z-index:10;}\n</style>\n</head>\n<body>\n<h1>Z-Index Example</h1>\n<div class=\"element\">This element is positioned relative with a z-index of 10.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Overflow": [
    {
      "title": "CSS Overflow property",
      "description": "When content of an element overflows the element’s box size then we use overflow property to add scrollbars to the element’s box for better viewing of content.",
      "sub_description": "The overflow property has the following values:",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "visible: "
        },
        {
          "type": "paragraph",
          "text": "This is by default and the content overflows the element’s box in it."
        },
        {
          "type": "textarea",
          "text": ".element {\n\tvisibility: visible;\n\t/* The element is visible */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Overflow Property Demo</title>\n<style>\n.element{visibility:visible; width: 200px;height: 50px;border: 2px solid black;}\n</style>\n</head>\n<body>\n<h1>Visible Overflow Example</h1>\n<div class=\"element\">This element has visible overflow.The content is too long to fit inside the box, so it will spill outside the container.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "hidden: "
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": ".element {\n\tvisibility: hidden;\n\t/* The element is hidden but still takes up space */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Overflow Property Demo</title>\n<style>\n.element{visibility:hidden;width: 200px;height: 50px;border: 2px solid black;}\n</style>\n</head>\n<body>\n<h1>Hidden Overflow Example</h1>\n<div class=\"element\">This element has hidden overflow.The content is too long to fit inside the box, so the extra text will be cut off and not visible.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "scroll: "
        },
        {
          "type": "paragraph",
          "text": "The overflow is hidden or clipped and to view rest of the content a scrollbar is provided."
        },
        {
          "type": "textarea",
          "text": ".element {\n\toverflow: scroll;\n\t/* Scroll bars will appear even if the content fits within the element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Overflow Property Demo</title>\n<style>\n.element{overflow:scroll;  width: 200px;/* fixed width */height: 50px; /* fixed height */border: 2px solid black;}\n</style>\n</head>\n<body>\n<h1>Scroll Overflow Example</h1>\n<div class=\"element\">This element has scroll overflow.The content is too long to fit inside the box, so scrollbars appear for both horizontal and vertical scrolling.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "auto: "
        },
        {
          "type": "paragraph",
          "text": "It is similar to scroll but adds scrollbars only when needed."
        },
        {
          "type": "textarea",
          "text": ".element {\n\toverflow: auto;\n\t/* Scroll bars will appear only if the content overflows the element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Overflow Property Demo</title>\n<style>\n.element{overflow:auto; width: 200px;/* fixed width */height: 50px; /* fixed height */border: 2px solid black;}\n</style>\n</head>\n<body>\n<h1>Auto Overflow Example</h1>\n<div class=\"element\">This element has auto overflow.he content is too long to fit inside the box, so scrollbars appear automatically when necessary.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "overflow-x and overflow-y:"
        },
        {
          "type": "paragraph",
          "text": "The overflow-x species to change the overflow of content on the horizontal axis and overflow-y on the vertical axis."
        },
        {
          "type": "textarea",
          "text": ".element {\n\toverflow-x: hidden;  /* Hides horizontal overflow */\n\toverflow-y: scroll;  /* Always shows vertical scroll bar */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Overflow Property Demo</title>\n<style>\n.element{width: 200px;/* fixed width */height: 100px;/* fixed height */border: 2px solid black;overflow-x:hidden;overflow-y:scroll;}\n</style>\n</head>\n<body>\n<h1>Overflow-x and Overflow-y Example</h1>\n<div class=\"element\">This element has overflow-x hidden and overflow-y scroll.This content is long enough to require vertical scrolling, but horizontal scrolling is hidden even if text is too wide.</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Float property": [
    {
      "title": "CSS Float property",
      "description": "The float is used to position elements to the left or right of their containing element and allowing content to flow around them.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "5",
          "text": "left :"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": ".element {\n\tleft: 20px;  /* Positions the element 20 pixels from the left */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n<style>\n.element{left:20px;width: 150px;/* Give it a fixed width */height: 100px; /* Optional height */background-color: lightblue;margin: 10px;padding: 10px;border: 1px solid black;}container {border: 2px solid gray;padding: 10px;width: 400px; /* Container to show float effect */}\n</style>\n</head>\n<body><h1>Left Float Example</h1><div class='container'><div class='element'>This element is floated to the left.</div><p>This text wraps around the floated element. The float allows text and other inline content to flow around the box.</p></div></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "right: "
        },
        {
          "type": "paragraph",
          "text": "This floats the element to the right of its container."
        },
        {
          "type": "textarea",
          "text": ".element {\n\tright: 30px;  /* Positions the element 30 pixels from the right */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n<style>.element {float: right; /* Float element to the right */width: 150px;height: 100px;background-color: lightcoral;margin: 10px;padding: 10px;border: 1px solid black;}.container {border: 2px solid gray;padding: 10px;width: 400px; /* Container to show float effect */}</style>\n</head>\n<body><h1>Right Float Example</h1><div class='container'><div class='element'>This element is floated to the right.</div><p>This text wraps around the floated element. The float allows text and other inline content to flow around the box.</p></div></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "none :"
        },
        {
          "type": "paragraph",
          "text": "The element does not float and is displayed where it occurs. This is by default."
        },
        {
          "type": "textarea",
          "text": ".element {\n\tdisplay: none;  /* Hides the element completely from the page */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n<style>.element {/* No float applied */width: 150px;height: 100px;background-color: lightgreen;margin: 10px;padding: 10px;border: 1px solid black;}.container {border: 2px solid gray;padding: 10px;width: 400px;}</style>\n</head>\n<body><h1>None Float Example</h1><div class='container'><div class='element'>This element is not floated.</div><p>This text appears below the element because it is not floated.</p></div></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "inherit:"
        },
        {
          "type": "paragraph",
          "text": "This inherits the float value of element’s parentF"
        },
        {
          "type": "textarea",
          "text": ".child-element {\n\tcolor: inherit;  /* Inherits the color property from its parent element */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n<style>\n.child-element{color:inherit;}\n</style>\n</head>\n<body>\n<h1>Inherit Float Example</h1>\n<div class=\"child-element\">This element inherits the color property from its parent.</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Clear property:"
        },
        {
          "type": "paragraph",
          "text": "The clear property defines how the elements which are adjacent to floating elements will behave. "
        },
        {
          "type": "paragraph",
          "text": "property following values:"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "left"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": ".element {\n\tclear: left;  /* Prevents the element from wrapping around floated elements on the left */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n<style>.float-left {float: left;width: 150px;height: 100px;background-color: lightblue;margin: 10px;padding: 10px;border: 1px solid black;}.clear-left {clear: left; /* This element will be below all left-floated elements */background-color: lightcoral;padding: 10px;border: 1px solid black;}</style>\n</head>\n<body><h1>Clear Left Example</h1><div class='float-left'>Floated Left Element</div><div class='clear-left'>This element is cleared left and starts below the floated element.</div><p>Other content follows normally after the cleared element.</p></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "right"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": ".element {\n\tclear: right;  /* Prevents the element from wrapping around floated elements on the right */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n <style>.float-right {float: right;width: 150px;height: 100px;background-color: lightgreen;margin: 10px;padding: 10px;border: 1px solid black;}.clear-right {clear: right; /* This element moves below right-floated elements */background-color: lightcoral;padding: 10px;border: 1px solid black;}</style>\n</head>\n<body><h1>Clear Right Example</h1><div class='float-right'>Floated Right Element</div><div class='clear-right'>This element is cleared right and starts below the floated element.</div><p>Other content flows normally after the cleared element.</p></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "none"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": ".element {\n\tclear: none;  /* Allows the element to be positioned next to floated elements */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n<style>.float-left {float: left;width: 150px;height: 100px;background-color: lightblue;margin: 10px;padding: 10px;border: 1px solid black;}.clear-none {clear: none; /* Default: element does not clear any floats */background-color: lightcoral;padding: 10px;border: 1px solid black;}</style>\n</head>\n<body><h1>Clear None Example</h1><div class='float-left'>Floated Left Element</div><div class='clear-none'>This element is not cleared, so it flows alongside or around floated elements if possible.</div><p>Other content follows normally.</p></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "both"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": ".element {\n\tclear: left;  /* The element is moved below any floated elements on the left */\n}\n.element {\n\tclear: right;  /* The element is moved below any floated elements on the right */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>\n <style>.float-left {float: left;width: 150px;height: 100px;background-color: lightblue;margin: 10px;padding: 10px;border: 1px solid black;}.float-right {float: right;width: 150px;height: 100px;background-color: lightgreen;margin: 10px;padding: 10px;border: 1px solid black;}.clear-both {clear: both; /* Move below all floated elements */background-color: lightcoral;padding: 10px;border: 1px solid black;}</style>\n</head>\n<body><h1>Clear Both Example</h1><div class='float-left'>Floated Left Element</div><div class='float-right'>Floated Right Element</div><div class='clear-both'>This element is cleared both left and right and appears below all floated elements.</div><p>Other content follows normally.</p></body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "inherit:"
        },
        {
          "type": "paragraph",
          "text": "The element inherits its clear value from its parent element."
        },
        {
          "type": "textarea",
          "text": ".element {\n\tclear: inherit;  /* The element inherits the clear property from its parent */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Float Property Demo</title>  <style>.parent {float: left;width: 200px;height: 100px;background-color: lightblue;margin: 10px;padding: 10px;border: 1px solid black;clear: right; /* Parent has clear applied */}.child {clear: inherit; /* Inherits the parent's clear value (right) */background-color: lightcoral;padding: 10px;border: 1px solid black;}</style>\n</head>\n<body><h1>Inherit Clear Example</h1><div class='parent'>Parent element (floated left, cleared right)<div class='child'>Child element inherits clear from parent</div></div><p>Other content follows normally.</p></body>\n</html>"
        }
      ]
    }
  ],
  "CSS Inline-block property": [
    {
      "title": "CSS Inline-block property",
      "description": "The display: inline-block;:The display: inline-block is different from display: inline; as it allows height and width properties and, top and bottom margins/paddings are also allowed while in display: inline; these are not allowed. ",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Use of inline-block to create navigation links:"
        },
        {
          "type": "paragraph",
          "text": "The display: inline-block; is most commonly used to display list items horizontally."
        },
        {
          "type": "textarea",
          "text": "element {\n\tdisplay: inline-block;  /* The element behaves like an inline element but accepts width and height */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Inline-block Property Demo</title>\n<style>ul {list-style: none;padding: 0;margin: 0;}li {display: inline-block; /* Makes list items horizontal */margin-right: 15px;padding: 10px 20px;background-color: #007BFF;color: white;border-radius: 5px;}li:hover {background-color: #0056b3;cursor: pointer;}</style>\n</head>\n<body><ul><li>Home</li><li>About</li><li>Services</li><li>Contact</li></ul></body>\n</html>"
        }
      ]
    }
  ],
  "CSS Layout": [
    {
      "title": "CSS Layout - horizontal and vertical align",
      "description": "",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Center align elements: "
        },
        {
          "type": "paragraph",
          "text": "When you set an elements width less than 100% or the entire width available and you set its margin: auto; then the element is displayed in center by itself."
        },
        {
          "type": "textarea",
          "text": ".container {\n\ttext-align: center;  /* Center-aligns inline elements within the container */\n}\n\n.element {\n\tmargin: 0 auto;  /* Centers block-level elements */\n\twidth: 50%;  /* Set a width for block-level elements to center */\n}",
          "template": "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width,initial-scale=1' /><title>Center Align Elements Demo</title><style>.container {text-align: center;border: 2px solid #ccc;padding: 20px;margin: 20px;}.element {margin: 0 auto; width: 50%;background-color: #007BFF;color: white;padding: 15px;border-radius: 5px;font-size: 1.2rem;}</style></head><body><h1>CSS Center Align Elements Example</h1><div class='container'><span>This inline text is centered inside the container.</span><div class='element'>This block-level element is centered with <code>margin: 0 auto</code> and <code>width: 50%</code>.</div></div></body></html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Center Align text:"
        },
        {
          "type": "paragraph",
          "text": "To center the text inside an element, use text-align: center; property."
        },
        {
          "type": "textarea",
          "text": "h1, h2, h3, p {\n\ttext-align: center;  /* Center-aligns text for headers and paragraphs */\n}",
          "template": "<style>h1, h2, h3, p {text-align: center; /* Center-align text inside headers and paragraphs */}</style><h1>This is a centered H1 header</h1><h2>This is a centered H2 header</h2><h3>This is a centered H3 header</h3><p>This paragraph text is centered as well, using the CSS text-align property.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Center an image:"
        },
        {
          "type": "paragraph",
          "text": "To center an image make it a block element and set its width less than the entire width (100%) and set the margin left and right to auto."
        },
        {
          "type": "textarea",
          "text": "img {\n\tdisplay: block; /* Change display to block */\n\tmargin-left: auto; /* Automatically adjusts left margin */\n\tmargin-right: auto; /* Automatically adjusts right margin */\n}",
          "template": "<style>img {display: block;margin: 0 auto;max-width: 400px; /* optional size control */height: auto;}</style><h2 style='text-align:center;'>Centered Image</h2><img src='https://upload.wikimedia.org/wikipedia/commons/3/3f/Fronalpstock_big.jpg' alt='Mountain Landscape' />"
        }
      ]
    }
  ],
  "CSS Combinators": [
    {
      "title": "CSS Combinators",
      "description": "Combinators in CSS are used to define relationship between two selectors. A combinator is used between selectors.",
      "sub_description": "There are four types of combinators:",
      "additional_info": "",
      "content": [
        {
          "type": "list",
          "items": [
            "Descendant combinator (space)",
            "Child combinator (>)",
            "Next sibling combinator (+)",
            "Subsequent-sibling combinator (~)"
          ]
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Descendant combinator:"
        },
        {
          "type": "paragraph",
          "text": "The descendant combinatory (space) selects all the elements which are descendants of a specified element."
        },
        {
          "type": "textarea",
          "text": "div p {\n\tcolor: blue; /* Selects all <p> elements inside <div> elements */\n}",
          "template": "<style>div {border: 2px solid black;padding: 20px;}div p {color: blue;font-size: 20px;}</style><h2>CSS Descendant Selector Example</h2><div><p>This paragraph is INSIDE the div (should be blue).</p></div><p>This paragraph is OUTSIDE the div (should be normal black).</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Child combinator:"
        },
        {
          "type": "paragraph",
          "text": "The child combinator (>) selects all the elements that are children of the specified element."
        },
        {
          "type": "textarea",
          "text": "ul > li {\n\tfont-weight: bold; /* Selects only <li> elements that are direct children of <ul> */\n}",
          "template": " <style>ul {border: 2px solid black;padding: 15px;}ul > li {color: blue;font-weight: bold;}li {margin: 5px 0;}</style><h2>Child Combinator ( > ) Example</h2><ul><li>Direct Child 1 (Blue)</li><li>Direct Child 2 (Blue)</li><li>Parent Item<ol><li>Nested Child (NOT Blue)</li></ol></li></ul>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Next sibling combinator:"
        },
        {
          "type": "paragraph",
          "text": "The next sibling combinator(+) selects all the elements that are immediately preceded by or is directly after a specified element."
        },
        {
          "type": "textarea",
          "text": "h2 + p {\n\tcolor: blue; /* Selects the first <p> that is immediately after an <h2> */\n}",
          "template": " <style>h2 {border: 2px solid black;padding: 10px;}h2 + p {color: blue;font-weight: bold;font-size: 20px;}p {margin: 5px 0;}</style><h2>This is a heading</h2><p>✔ This paragraph is immediately after h2 (Blue)</p><p>✘ This paragraph is NOT immediately after h2 (Black)</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Subsequent-sibling combinator:"
        },
        {
          "type": "paragraph",
          "text": "The Subsequent-sibling combinator(~) selects all the elements that are siblings of a specified element and appear after it."
        },
        {
          "type": "textarea",
          "text": "h2 ~ p {\n\tcolor: green; /* This will apply to all <p> elements that follow an <h2> */\n}",
          "template": "<style>h2 {border: 2px solid black;padding: 10px;}h2 ~ p {color: green;font-weight: bold;font-size: 20px;}p {margin: 5px 0;}</style><h2>This is a heading</h2><p>✔ This paragraph comes after h2 (Green)</p><p>✔ This paragraph also comes after h2 (Green)</p><p>✘ This paragraph is BEFORE h2 (Black)</p><h2>Another Heading</h2><p>✔ This paragraph comes after second h2 (Green)</p>"
        }
      ]
    }
  ],
  "CSS Pseudo-classes": [
    {
      "title": "CSS Pseudo-classes",
      "description": "Pseudo-classes are keywords that can be combined with selectors to specify a special state of a selected element.",
      "sub_description": "These allow users to add styling to elements based on user interactions, position in the document and other conditions.",
      "additional_info": "Syntax:<br>selector:pseudo-class{ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property: value;<br> }",
      "content": [
        {
          "type": "textarea",
          "text": "a:hover {\n\tcolor: red; /* Changes the link color when hovered over */\n}",
          "template": " <style>a {color: blue;text-decoration: none;font-size: 18px;}a:hover {color: red; /* Changes link color when hovered */cursor: pointer;}</style><h1>CSS Pseudo-Class :hover Demo</h1><p>Move your mouse over the links below to see the color change:</p><a href='#'>First Link</a><br /><a href='#'>Second Link</a><br /><a href='#'>Third Link</a>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Anchor pseudo-classes:"
        },
        {
          "type": "list",
          "items": [
            ":link pseudo class is used to change styling of a link in its unvisited state.",
            ":visited pseudo class is used to change styling of a link if its already visited.",
            ":hover pseudo class is used to change styling of a link when user hovers over it.",
            ":active pseudo class is used to change styling of a link when it is active or being clicked on."
          ]
        },
        {
          "type": "heading",
          "level": "4",
          "text": ":first-child pseudo class:"
        },
        {
          "type": "paragraph",
          "text": "This is used to select the first child of a specified parent element."
        },
        {
          "type": "textarea",
          "text": "p:first-child {\n\tfont-weight: bold; /* Makes the first paragraph child bold */\n}",
          "template": "<style>/* Make the first paragraph inside the body bold and red */p:first-child {font-weight: bold;color: red;}  </style><p>This is the first paragraph. It will be bold and red because it is the first child of the body.</p><p>This is the second paragraph. It will stay normal.</p><p>This is the third paragraph. It will also stay normal.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": ":nth-child() pseudo class:"
        },
        {
          "type": "paragraph",
          "text": "This selects elements based on their position in a group of siblings. Values it takes are numbers, formulas or keywords."
        },
        {
          "type": "textarea",
          "text": "li:nth-child(2) {\n\tcolor: red; /* Changes the color of the second list item */\n}",
          "template": "<style>/* Make the second list item red */li:nth-child(2) {color: red;font-weight: bold;}</style><h2>Fruit List</h2><ul><li>Apple</li><li>Banana</li> <!-- This will be red and bold --><li>Cherry</li><li>Orange</li></ul>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": ":nth-of-type() pseudo class:"
        },
        {
          "type": "paragraph",
          "text": "the :nth-of-type() pseudo-class lets you choose elements in CSS by their position among siblings of the same type (i.e., the same tag name)."
        },
        {
          "type": "textarea",
          "text": "p:nth-of-type(3) {\n\tfont-weight: bold; /* Makes the third paragraph bold */\n}",
          "template": "<style>/* Make the third paragraph bold */p:nth-of-type(3) {font-weight: bold;color: blue;}</style><p>Paragraph 1 – normal</p><p>Paragraph 2 – normal</p><p>Paragraph 3 – bold and blue</p><p>Paragraph 4 – normal</p>"
        }
      ]
    }
  ],
  "CSS Pseudo-elements": [
    {
      "title": "CSS Pseudo-elements",
      "description": ":The pseudo elements are keywords that are used to style a specific part of selected elements.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "The ::first-line pseudo-element:"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": "p::first-line {\n    font-weight: bold;\n    color: green;\n}",
          "template": "<style>/* Style the first line of every paragraph */p: :first-line {font-weight: bold;color: green;font-size: 20px;}</style><p>This is a paragraph. Only the first line of this paragraph will appear bold, green, and slightly larger. The rest of the text remains normal.</p><p>Another paragraph here. Again, just the first line will get the special style applied.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The ::first-letter pseudo-element:"
        },
        {
          "type": "paragraph",
          "text": "The ::first-letter pseudo-element is used to add style to the first letter of selected element. Only a few properties can be applied to ::first-letter pseudo-element such as color properties, font properties, background properties, letter-spacing, word-spacing, text-decoration, text-transform, vertical-align(only if float is none), line-height, clear, etc."
        },
        {
          "type": "textarea",
          "text": "p::first-letter {\n    font-weight: bold;\n    color: green;\n}",
          "template": "<style>/* Style the first letter of every paragraph */p: :first-letter {font-weight: bold;color: green;font-size: 30px; /* Makes it bigger for effect */}</style><p>This is a paragraph. Only the first letter 'T' will be bold, green, and larger. The rest of the text remains normal.</p><p>Another paragraph example. The first letter 'A' will also be styled the same way.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Using pseudo-element and html classes together:"
        },
        {
          "type": "paragraph",
          "text": "The pseudo-elements and html classes can be used together.<br>Syntax:<br>Selector.classname::pseudo-element { <br> &nbsp; &nbsp; &nbsp; &nbsp;property: value;<br>}"
        },
        {
          "type": "textarea",
          "text": ".highlighted-text::after {\n    content: ' - Webcooks';\n    color: green;\n    font-weight: bold;\n}\n\n<p class=\"highlighted-text\">Welcome to the course</p>",
          "template": "<style>/* Add content after elements with class 'highlighted-text' */.highlighted-text: :after {content: ' - Webcooks';color: green;font-weight: bold;}</style><p class='highlighted-text'>Welcome to the course</p><p>Another paragraph without the pseudo-element.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The ::before pseudo-element:"
        },
        {
          "type": "paragraph",
          "text": "The ::before pseudo-element allows us to add some content before the content of selected element."
        },
        {
          "type": "textarea",
          "text": ".welcome-message::before {\n    content: '🎉 ';\n    font-size: 20px;\n    color: orange;\n}\n\n<p class=\"welcome-message\">Welcome to Webcooks!</p>",
          "template": " <style>/* Add content before elements with class 'welcome-message' */.welcome-message: :before {content: '🎉 '; /* Emoji added before the text */font-size: 20px;color: orange;}/* Optional: style the paragraph itself */.welcome-message {font-size: 18px;font-weight: bold;}</style><p class='welcome-message'>Welcome to Webcooks!</p><p>This paragraph has no : :before element.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The ::after pseudo-element:"
        },
        {
          "type": "paragraph",
          "text": "The ::after pseudo-element allows us to add some content just after the content of selected element."
        },
        {
          "type": "textarea",
          "text": ".notice::after {\n    content: ' Thank you for visiting!';\n    font-size: 14px;\n    color: green;\n}\n\n<p class=\"notice\">We hope you enjoyed the experience.</p>",
          "template": "<style>/* Add content after elements with class 'notice' */.notice: :after {content: ' Thank you for visiting!';font-size: 14px;color: green;font-weight: bold;}/* Optional: style the original paragraph */.notice {font-size: 16px;}</style><p class='notice'>We hope you enjoyed the experience.</p><p>This paragraph has no extra message after it.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The ::marker pseudo-element:"
        },
        {
          "type": "paragraph",
          "text": "The ::marker pseudo-element is used to add style to the markers of lists."
        },
        {
          "type": "textarea",
          "text": "ul::marker {\n    color: red;\n    font-size: 20px;\n}\n\n<ul>\n    <li>First item</li>\n    <li>Second item</li>\n    <li>Third item</li>\n</ul>",
          "template": "<style>/* Style the bullets of list items directly */li: :marker {color: red; /* Bullet color */font-size: 20px; /* Bullet size */}li {font-size: 18px; /* Text size */}</style><h2>My Favorite Fruits</h2><ul><li>Apple</li><li>Banana</li><li>Cherry</li></ul>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The ::selection pseudo-element:"
        },
        {
          "type": "paragraph",
          "text": "This adds style to portion of element in the document that is currently selected or highlighted by the user by activity such as clicking and dragging the mouse across the text."
        },
        {
          "type": "textarea",
          "text": "::selection {\n    background-color: yellow;\n    color: black;\n}\n\n<p>Select this text to see the selection effect.</p>",
          "template": "<style>/* Style selected text */: :selection {background-color: yellow; /* Highlight color */color: black; /* Text color when selected */}/* Optional: style paragraph text */p {font-size: 18px;}</style><p>Select this text with your mouse to see the yellow highlight effect.</p><p>Try selecting this line too – it will have the same styling.</p>"
        }
      ]
    }
  ],
  "CSS Opacity": [
    {
      "title": "CSS Opacity",
      "description": "Opacity is used to set opacity or transparency of an element. Its value ranges from 0.0 (being fully transparent) to 1.0 (being fully opaque).",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Transparent Box:"
        },
        {
          "type": "paragraph",
          "text": "When applying opacity to a box element, it also gets inherited automatically to all the children of the box element. This can make text inside the box hard to read if opacity is too low."
        },
        {
          "type": "textarea",
          "text": ".transparent-box {\n    width: 300px;\n    height: 200px;\n    background-color: rgba(255, 255, 255, 0.5);\n    border: 2px solid #000;\n    padding: 20px;\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n}\n\n<div class=\"transparent-box\">\n    This is a transparent box.\n</div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Opacity Demo</title>\n<style>\n.transparent-box{width:300px;height:200px;background-color:rgba(255,255,255,0.5);border:2px solid #000;padding:20px;box-shadow:0 4px 8px rgba(0,0,0,0.2);}\n</style>\n</head>\n<body>\n<div class=\"transparent-box\">\n    This is a transparent box.\n</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Transparency using RGBA:"
        },
        {
          "type": "paragraph",
          "text": "If you want to apply transparency only to the box but not the text or other elements inside it then you can use RGBA color values as in it alpha is used to add opacity to color. RGBA also specified as rgba(red, green, blue, alpha) has alpha values ranging from 0.0 (fully transparent) to 1.0 (fully opaque)."
        },
        {
          "type": "textarea",
          "text": ".transparent-bg {\n    width: 100%;\n    height: 100vh;\n    background-color: rgba(0, 123, 255, 0.5); /* Blue background with 50% transparency */\n}\n\n<div class=\"transparent-bg\">\n    This div has a transparent background.\n</div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Opacity Demo</title>\n<style>\n.transparent-bg{width:100%;height:100vh;background-color:rgba(0,123,255,0.5);}\n</style>\n</head>\n<body>\n<div class=\"transparent-bg\">\n    This div has a transparent background.\n</div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Units": [
    {
      "title": "CSS Units",
      "description": "CSS has many different units for expressing length such as px, pt, rem etc.Several CSS properties take length values such as margin, padding, width, font-size etc.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Absolute lengths:"
        },
        {
          "type": "paragraph",
          "text": "These are fixed units of measurement and are independent of surrounding context."
        },
        {
          "type": "textarea",
          "text": ".absolute-lengths {\n    width: 300px; /* Absolute width in pixels */\n    height: 200pt; /* Absolute height in points */\n    margin: 20cm; /* Margin in centimeters */\n    font-size: 16px; /* Font size in pixels */\n}\n\n<div class=\"absolute-lengths\">\n    This div uses absolute lengths.\n</div>",
          "template": " <style>.absolute-lengths {width: 10cm; /* Absolute width */height: 5cm; /* Absolute height */margin: 2cm; /* Margin from edges */padding: 10pt; /* Padding inside the div */font-size: 12pt; /* Font size in points */background-color: lightblue;border: 2px solid blue;}</style><div class='absolute-lengths'>This div uses absolute lengths like cm and pt.</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Relative lengths:"
        },
        {
          "type": "paragraph",
          "text": "This type of length is dependent on surrounding context such as parent element, viewport or the font size of the element."
        },
        {
          "type": "textarea",
          "text": ".relative-lengths {\n    width: 50%; /* Width is 50% of the parent element */\n    height: 10em; /* Height is 10 times the font size */\n    margin: 2rem; /* Margin is 2 times the root font size */\n    font-size: 1.5rem; /* Font size is 1.5 times the root font size */\n}\n\n<div class=\"relative-lengths\">\n    This div uses relative lengths.\n</div>",
          "template": "<style>body {font-family: Arial, sans-serif;display: flex;justify-content: space-around;align-items: flex-start;padding: 20px;background-color: #f9f9f9;}/* Absolute units container */.absolute-lengths {width: 10cm; /* Absolute width */height: 5cm; /* Absolute height */margin: 1cm;padding: 10pt; /* Absolute padding */font-size: 12pt; /* Absolute font size */background-color: #add8e6;border: 2px solid #0000ff;text-align: center;}/* Relative units container */.relative-lengths {width: 50%; /* 50% of parent width */height: 10em; /* 10 times current font size */margin: 2rem; /* 2 times root font size */padding: 1.5em; /* 1.5 times current font size */font-size: 1.5rem; /* 1.5 times root font size */background-color: #90ee90;border: 2px solid #008000;text-align: center;}h2 {text-align: center;width: 100%;}</style><div class='absolute-lengths'><h2>Absolute Units</h2><p>This box uses absolute lengths like cm and pt. It does not scale with screen size.</p></div><div class='relative-lengths'><h2>Relative Units</h2><p>This box uses relative lengths like %, em, and rem. It adapts to font size and screen width.</p></div>"
        }
      ]
    }
  ],
  "CSS Forms": [
    {
      "title": "CSS Forms",
      "description": "The look of forms can be greatly enhanced by applying CSS to it.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Styling Input Fields:"
        },
        {
          "type": "paragraph",
          "text": "You can use width property to set the width for an input element. If you want to apply style to a specific input type then you can use attribute selectors such as input[type=”text”], input[type=”password”], input[type=”email”] etc."
        },
        {
          "type": "textarea",
          "text": "input {\n    padding: 10px; /* Adds padding inside the input */\n    border: 2px solid #ccc; /* Sets the border color */\n    border-radius: 5px; /* Rounds the corners of the input */\n    width: 100%; /* Makes the input take full width */\n    font-size: 16px; /* Sets the font size */\n    transition: border-color 0.3s; /* Smooth transition for border color */\n}\n\ninput:focus {\n    border-color: #66afe9; /* Changes border color when focused */\n    outline: none; /* Removes the default outline */\n}",
          "template": "<style>/* Style all input fields */input {padding: 10px; /* Space inside the input */border: 2px solid #ccc; /* Default border color */border-radius: 5px; /* Rounded corners */width: 100%; /* Full width */font-size: 16px; /* Text size */transition: border-color 0.3s; /* Smooth transition for focus */}/* Change border when input is focused */input:focus {border-color: #66afe9; /* Highlight border */outline: none; /* Remove default outline */}</style><input type='text' placeholder='Enter your name'><br><br><input type='email' placeholder='Enter your email'><br><br><input type='password' placeholder='Enter your password'>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Padded inputs:"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": "input {\n    padding: 15px; /* Adds padding to the input field */\n    border: 1px solid #ccc; /* Sets the border color */\n    border-radius: 4px; /* Rounds the corners */\n    width: 100%; /* Makes the input take full width */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\ninput:focus {\n    border-color: #66afe9; /* Changes border color on focus */\n    outline: none; /* Removes default outline */\n}",
          "template": "<style>/* Style input fields with padding */input {padding: 15px; /* Adds space inside the input */border: 2px solid #ccc; /* Light gray border */border-radius: 5px; /* Rounded corners */width: 100%; /* Full width */font-size: 16px; /* Text size */}/* Optional: change border color on focus */input:focus {border-color: #66afe9;outline: none;}</style><input type='text' placeholder='Enter your name'><br><br><input type='email' placeholder='Enter your email'><br><br><input type='password' placeholder='Enter your password'>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Bordered Inputs:"
        },
        {
          "type": "paragraph",
          "text": "The border property can be used to change border size, color and style for an input element. Also border-radius can be used to add rounded borders to input elements."
        },
        {
          "type": "textarea",
          "text": "input {\n    border: 2px solid #4CAF50; /* Sets the border color and width */\n    padding: 10px; /* Adds padding inside the input field */\n    border-radius: 4px; /* Rounds the corners */\n    width: 100%; /* Makes the input take full width */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\ninput:focus {\n    border-color: #3e8e41; /* Changes border color on focus */\n    outline: none; /* Removes default outline */\n}",
          "template": "<style>input {border: 2px solid #4CAF50;padding: 10px;border-radius: 4px;width: 100%;box-sizing: border-box;font-size: 16px;}input:focus {border-color: #3e8e41;outline: none;}</style><input type='text' placeholder='Enter your name'><br><br><input type='email' placeholder='Enter your email'><br><br><input type='password' placeholder='Enter your password'></body>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Colored Inputs:"
        },
        {
          "type": "paragraph",
          "text": "Background color can be added to input elements using background-color property and text color can be styled using color property."
        },
        {
          "type": "textarea",
          "text": "input {\n    background-color: #f0f8ff; /* Sets the background color */\n    color: #333; /* Sets the text color */\n    border: 2px solid #add8e6; /* Sets the border color and width */\n    padding: 10px; /* Adds padding inside the input field */\n    border-radius: 4px; /* Rounds the corners */\n    width: 100%; /* Makes the input take full width */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\ninput:focus {\n    background-color: #e6f7ff; /* Changes background color on focus */\n    border-color: #87ceeb; /* Changes border color on focus */\n    outline: none; /* Removes default outline */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Forms Demo</title>\n<style>\ninput {\n    background-color: #f0f8ff; /* Sets the background color */\n    color: #333; /* Sets the text color */\n    border: 2px solid #add8e6; /* Sets the border color and width */\n    padding: 10px; /* Adds padding inside the input field */\n    border-radius: 4px; /* Rounds the corners */\n    width: 100%; /* Makes the input take full width */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\ninput:focus {\n    background-color: #e6f7ff; /* Changes background color on focus */\n    border-color: #87ceeb; /* Changes border color on focus */\n    outline: none; /* Removes default outline */\n}\n</style>\n</head>\n<body>\n<input type=\"text\" placeholder=\"Enter your name\">\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Focused Inputs::focus pseudo-class :"
        },
        {
          "type": "paragraph",
          "text": "Focused Inputs::focus pseudo-class can be used to add styling to input element when it gets focused or clicked on."
        },
        {
          "type": "textarea",
          "text": "input {\n    background-color: #ffffff; /* Default background color */\n    color: #333; /* Default text color */\n    border: 2px solid #ccc; /* Default border color */\n    padding: 10px; /* Adds padding inside the input field */\n    border-radius: 4px; /* Rounds the corners */\n    width: 100%; /* Makes the input take full width */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\ninput:focus {\n    background-color: #e0f7fa; /* Changes background color on focus */\n    border-color: #009688; /* Changes border color on focus */\n    outline: none; /* Removes default outline */\n    box-shadow: 0 0 5px rgba(0, 150, 136, 0.5); /* Adds shadow effect */\n}",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Forms Demo</title>\n<style>\ninput {\n    background-color: #ffffff; /* Default background color */\n    color: #333; /* Default text color */\n    border: 2px solid #ccc; /* Default border color */\n    padding: 10px; /* Adds padding inside the input field */\n    border-radius: 4px; /* Rounds the corners */\n    width: 100%; /* Makes the input take full width */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\ninput:focus {\n    background-color: #e0f7fa; /* Changes background color on focus */\n    border-color: #009688; /* Changes border color on focus */\n    outline: none; /* Removes default outline */\n    box-shadow: 0 0 5px rgba(0, 150, 136, 0.5); /* Adds shadow effect */\n}\n</style>\n</head>\n<body>\n<input type=\"text\" placeholder=\"Enter your name\">\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Input with icon/image:"
        },
        {
          "type": "paragraph",
          "text": "You can add an image inside of an input element using background-image property and you can adjust its position inside the input element using background-position property."
        },
        {
          "type": "textarea",
          "text": "/* Container for the input and icon */\n.input-icon {\n    position: relative; /* Allows absolute positioning of the icon */\n    width: 300px; /* Set a width for the input */\n}\n\n/* Input field styles */\n.input-icon input {\n    width: 100%; /* Makes input take full width of the container */\n    padding: 10px 40px 10px 40px; /* Adds padding to the input */\n    border: 2px solid #ccc; /* Default border color */\n    border-radius: 4px; /* Rounds the corners */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\n/* Icon styles */\n.input-icon img {\n    position: absolute; /* Positions icon relative to the container */\n    left: 10px; /* Positions icon inside the left padding of the input */\n    top: 50%; /* Centers the icon vertically */\n    transform: translateY(-50%); /* Adjusts vertical alignment */\n    width: 20px; /* Sets icon width */\n    height: 20px; /* Sets icon height */\n}\n",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Forms Demo</title>\n<style>\n/* Container for the input and icon */\n.input-icon {\n    position: relative; /* Allows absolute positioning of the icon */\n    width: 300px; /* Set a width for the input */\n}\n\n/* Input field styles */\n.input-icon input {\n    width: 100%; /* Makes input take full width of the container */\n    padding: 10px 40px 10px 40px; /* Adds padding to the input */\n    border: 2px solid #ccc; /* Default border color */\n    border-radius: 4px; /* Rounds the corners */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n\n/* Icon styles */\n.input-icon img {\n    position: absolute; /* Positions icon relative to the container */\n    left: 10px; /* Positions icon inside the left padding of the input */\n    top: 50%; /* Centers the icon vertically */\n    transform: translateY(-50%); /* Adjusts vertical alignment */\n    width: 20px; /* Sets icon width */\n    height: 20px; /* Sets icon height */\n}\n}\n</style>\n</head>\n<body>\n<div class=\"input-icon\">\n<input type=\"text\" placeholder=\"Enter your name\">\n<img src=\"https://www.webcooks.in/assets/images/webcooks-logo.webp\" alt=\"Webcooks Logo\">\n</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Styling Textareas:"
        },
        {
          "type": "paragraph",
          "text": "After styling textarea you can use resize: none; property to disable resizing of textreas."
        },
        {
          "type": "textarea",
          "text": "/* Styling the textarea */\ntextarea {\n    width: 100%; /* Makes the textarea take the full width of the container */\n    height: 150px; /* Sets a specific height for the textarea */\n    padding: 10px; /* Adds padding inside the textarea */\n    border: 2px solid #ccc; /* Default border color */\n    border-radius: 4px; /* Rounds the corners */\n    resize: none; /* Disables resizing of the textarea */\n    font-family: Arial, sans-serif; /* Sets the font family */\n    font-size: 16px; /* Sets the font size */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Forms Demo</title>\n<style>\n/* Styling the textarea */\ntextarea {\n    width: 100%; /* Makes the textarea take the full width of the container */\n    height: 150px; /* Sets a specific height for the textarea */\n    padding: 10px; /* Adds padding inside the textarea */\n    border: 2px solid #ccc; /* Default border color */\n    border-radius: 4px; /* Rounds the corners */\n    resize: none; /* Disables resizing of the textarea */\n    font-family: Arial, sans-serif; /* Sets the font family */\n    font-size: 16px; /* Sets the font size */\n    box-sizing: border-box; /* Ensures padding is included in total width */\n}\n}\n</style>\n</head>\n<body>\n<textarea placeholder=\"Enter your message\"></textarea>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Specificity": [
    {
      "title": "CSS Specificity",
      "description": "If there is more than one CSS rule applied to an element then the selector with highest specificity will be “win” over others and will be applied to the element.You can imagine specificity as a score/rank system which decides which style declaration is applied to the element.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "2",
          "text": "Specificity Hierarchy:"
        },
        {
          "type": "paragraph",
          "text": "In the hierarchy of specificity, each CSS selector has a defined spot. The specificity level of a selector is defined by four categories:"
        },
        {
          "type": "list",
          "items": [
            "Inline styles - Example: <div style=\"color: red;\">",
            "IDs - Example: #nav",
            "pseudo-classes, attribute selectors - Example: .dropdown, :hover, [type]",
            "Elements and pseudo-elements - Example: p, ::after"
          ]
        },
        {
          "type": "heading",
          "level": "4",
          "text": "How to calculate specificity:"
        },
        {
          "type": "paragraph",
          "text": "Take first value as 0 then:"
        },
        {
          "type": "list",
          "items": [
            "Add 100 for each ID.",
            "Add 10 for every class or pseudo-class or attribute selector.",
            "Add 1 for each element selector or pseudo-element."
          ]
        },
        {
          "type": "paragraph",
          "text": "Inline style has a specificity of 1000 and is always highest priority. And if !important is used then it will override even inline style."
        },
        {
          "type": "textarea",
          "text": "/* Example of inline style and !important */\n\n<p style=\"color: red;\">This text is red (inline style).</p>\n<p style=\"color: blue !important;\">This text will be blue (inline style with !important).</p>",
          "template": "<style>/* Example of CSS */p {color: green;}</style><p style='color: red;'>This text is red (inline style).</p><p style='color: blue !important;'>This text will be blue (inline style with !important).</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "!important flag:"
        },
        {
          "type": "paragraph",
          "text": "A style rule can be given greater specificity or priority in CSS by adding the special flag !important, which guarantees that the rule is enforced even in the event that it conflicts with other rules. Unless those rules also use !important, it takes precedence above any other conflicting rules."
        },
        {
          "type": "textarea",
          "text": "/* Example of the !important flag */\n\n<style>\n  .text {\n    color: green;\n  }\n  .override {\n    color: red !important;\n  }\n</style>\n\n<p class=\"text\">This text is green.</p>\n<p class=\"override\">This text will be red due to !important.</p>",
          "template": "<style>/* Example of the !important flag */.text {color: green;}.override {color: red !important;}</style><p class='text'>This text is green.</p><p class='override'>This text will be red due to !important.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "More specificity rules examples:"
        },
        {
          "type": "paragraph",
          "text": "If a same rule is written twice then it means they have equal specificity in that case the latest rule wins and its CSS rule will be applied."
        },
        {
          "type": "textarea",
          "text": "/* Example of specificity rules */\n\n<style>\n  .text {\n    color: blue;\n  }\n  .text {\n    color: orange;\n  }\n</style>\n\n<p class=\"text\">This text will be orange because the latest rule is applied.</p>",
          "template": "<style>/* Example of specificity rules */.text {color: blue;}.text {color: orange;}</style><p class='text'>This text will be orange because the latest rule is applied.</p>"
        },
        {
          "type": "paragraph",
          "text": "ID selectors have a higher specificity than attribute selectors."
        },
        {
          "type": "textarea",
          "text": "/* Example of ID selector vs. attribute selector */\n\n<style>\n  #unique {\n    color: red;\n  }\n  [type='text'] {\n    color: green;\n  }\n</style>\n\n<input id=\"unique\" type=\"text\" value=\"This text will be red due to the ID selector.\" />",
          "template": "<style>/* Example of ID selector vs. attribute selector */#unique {color: red;}[type='text'] {color: green;}</style><input id='unique' type='text'value='This text will be red due to the ID selector.' />"
        },
        {
          "type": "paragraph",
          "text": "Internal CSS rule will be closer to the HTML code than external sheet so CSS rule of internal CSS will be applied."
        },
        {
          "type": "textarea",
          "text": "/* Example of Internal CSS vs. External CSS */\n\n<head>\n  <style>\n    .example {\n      color: blue; /* Internal CSS */\n    }\n  </style>\n  <link rel=\"stylesheet\" href=\"styles.css\"> <!-- External CSS -->\n</head>\n\n<body>\n  <div class=\"example\">This text will be blue due to the internal CSS.</div>\n</body>",
          "template": "<style>/* Example of Internal CSS */.example {color: blue;}</style><link rel='stylesheet' href='styles.css'> <!-- External CSS --><div class='example'>This text will be blue due to the internal CSS.</div>"
        },
        {
          "type": "paragraph",
          "text": "A class selector wins over any element selectors."
        },
        {
          "type": "textarea",
          "text": "/* Example of Class Selector vs. Element Selector */\n\n<head>\n  <style>\n    p {\n      color: red; /* Element selector */\n    }\n    .example {\n      color: blue; /* Class selector */\n    }\n  </style>\n</head>\n\n<body>\n  <p class=\"example\">This text will be blue because the class selector has higher specificity.</p>\n</body>",
          "template": "<style>/* Example of Class Selector vs. Element Selector */p {color: red;/* Element selector */}.example {color: blue;/* Class selector */}</style><p class='example'>This text will be blue because the class selector has higher specificity.</p>"
        }
      ]
    }
  ],
  "CSS Shadow": [
    {
      "title": "CSS Shadow effects",
      "description": "In CSS a shadow can be applied to text or element. ",
      "sub_description": " The basic way to use it is to add horizontal shadow value and vertical shadow value to text-shadow property.",
      "additional_info": "You can also change the color of shadow by specifying color value after horizontal and vertical shadow value.",
      "content": [
        {
          "type": "textarea",
          "text": "/* Example of CSS Shadow Effects */\n\n.box {\n  width: 200px;\n  height: 200px;\n  background-color: lightblue;\n  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5); /* Adds a shadow effect */\n  border-radius: 10px;\n}\n\n.text {\n  font-size: 24px;\n  color: darkblue;\n  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Text shadow effect */\n}",
          "template": "<style>/* Example of CSS Shadow Effects */.box {width: 200px;height: 200px;background-color: lightblue;box-shadow: 5px 5px 15px rgba(0,0,0,0.5);/* Adds a shadow effect */border-radius: 10px;padding: 20px; /* Adds space inside the box */}.text {font-size: 24px;color: darkblue;text-shadow: 2px 2px 4px rgba(0,0,0,0.3);/* Text shadow effect */padding: 10px; /* Adds space inside the text element */}</style><div class='box'><p class='text'>This text will have a shadow effect.</p></div>"
        },
        {
          "type": "paragraph",
          "text": "You can also add blur value to the shadow. "
        },
        {
          "type": "textarea",
          "text": "/* Example of CSS Shadow Effects with Blur Value */\n\n.box {\n  width: 200px;\n  height: 200px;\n  background-color: lightblue;\n  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5); /* Horizontal offset, Vertical offset, Blur radius, Color */\n  border-radius: 10px;\n}\n\n.text {\n  font-size: 24px;\n  color: darkblue;\n  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3); /* Horizontal offset, Vertical offset, Blur radius, Color */\n}",
          "template": "<style>/* Example of CSS Shadow Effects with Blur Value */.box {width: 200px;height: 200px;background-color: lightblue;box-shadow: 5px 5px 15px rgba(0,0,0,0.5);/* Horizontal offset, Vertical offset, Blur radius, Color */border-radius: 10px;padding: 20px; /* Adds space inside the box */}.text {font-size: 24px;color: darkblue;text-shadow: 2px 2px 8px rgba(0,0,0,0.3);/* Horizontal offset, Vertical offset, Blur radius, Color */padding: 10px; /* Adds space inside the text element */}</style><div class='box'><p class='text'>This text will have a shadow effect.</p></div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Multiple shadow:"
        },
        {
          "type": "paragraph",
          "text": "To add multiple shadows just add the shadow values separated by comma to the text-shadow property."
        },
        {
          "type": "textarea",
          "text": "/* Example of CSS Multiple Shadow Effects */\n\n.box {\n  width: 300px;\n  height: 300px;\n  background-color: lightcoral;\n  box-shadow: \n    2px 2px 5px rgba(0, 0, 0, 0.3), /* First shadow */\n    5px 5px 15px rgba(0, 0, 0, 0.5); /* Second shadow */\n  border-radius: 15px;\n}\n\n.text {\n  font-size: 32px;\n  color: white;\n  text-shadow: \n    1px 1px 2px rgba(0, 0, 0, 0.4), /* First text shadow */\n    2px 2px 5px rgba(0, 0, 0, 0.6); /* Second text shadow */\n}",
          "template": "<style>/* Example of CSS Multiple Shadow Effects */.box {width: 300px;height: 300px;background-color: lightcoral;box-shadow: 2px 2px 5px rgba(0,0,0,0.3), /* First shadow */5px 5px 15px rgba(0,0,0,0.5); /* Second shadow */border-radius: 15px;padding: 20px; /* Adds padding inside the box */}.text {font-size: 32px;color: white;text-shadow: 1px 1px 2px rgba(0,0,0,0.4), /* First text shadow */2px 2px 5px rgba(0,0,0,0.6); /* Second text shadow */padding: 10px; /* Adds padding inside the text element */}</style><div class='box'><p class='text'>This text will have a shadow effect.</p></div>"
        },
        {
          "type": "paragraph",
          "text": "Additionally, you can utilize the text-shadow property to surround certain text with a plain border devoid of shadows."
        },
        {
          "type": "textarea",
          "text": "/* Example of Text Shadow for Border Effect */\n\n.text-border {\n  font-size: 48px;\n  color: white;\n  text-shadow: \n    -1px -1px 0 rgba(0, 0, 0, 1), /* Top left */\n    1px -1px 0 rgba(0, 0, 0, 1), /* Top right */\n    -1px 1px 0 rgba(0, 0, 0, 1), /* Bottom left */\n    1px 1px 0 rgba(0, 0, 0, 1); /* Bottom right */\n}\n\n/* Usage */\n<h1 class='text-border'>Hello, Webcooks!</h1>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Shadow Effects Demo</title>\n<style>\n/* Example of Text Shadow for Border Effect */\n\n.text-border {\n  font-size: 48px;\n  color: white;\n  text-shadow: \n    -1px -1px 0 rgba(0, 0, 0, 1), /* Top left */\n    1px -1px 0 rgba(0, 0, 0, 1), /* Top right */\n    -1px 1px 0 rgba(0, 0, 0, 1), /* Bottom left */\n    1px 1px 0 rgba(0, 0, 0, 1); /* Bottom right */\n}\n\n/* Usage */\n<h1 class='text-border'>Hello, Webcooks!</h1>\n</style>\n</head>\n<body>\n<h1 class=\"text-border\">Hello, Webcooks!</h1>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "box-shadow property:"
        },
        {
          "type": "paragraph",
          "text": "The box-shadow property allows us to add one or more shadow to an element.The most basic use of this property is with horizontal and vertical value. "
        },
        {
          "type": "textarea",
          "text": "/* Example of Box Shadow Property */\n\n.box-shadow-example {\n  width: 200px;\n  height: 100px;\n  background-color: #ffffff;\n  box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.5); /* Horizontal, Vertical, Blur, Color */\n}\n\n/* Usage */\n<div class='box-shadow-example'>Box Shadow Example</div>",
          "template": "<style>/* Improved Box Shadow Styling */.box-shadow-example {width: 300px;height: 150px;background-color: #ffffff;box-shadow: 10px 10px 20px rgba(0,0,0,0.3); /* Larger and softer shadow */border-radius: 15px; /* Rounded corners */padding: 20px;text-align: center;font-size: 20px;color: #333333;font-family: Arial, sans-serif;transition: box-shadow 0.3s ease, transform 0.3s ease; /* Smooth transition effect */}/* Hover Effect for Interaction */.box-shadow-example:hover {box-shadow: 15px 15px 30px rgba(0,0,0,0.4); /* Darker and bigger shadow on hover */transform: translateY(-5px); /* Slightly lift the box */}</style><div class='box-shadow-example'>Box Shadow Example</div>"
        },
        {
          "type": "paragraph",
          "text": "The color parameter can be used to specify color for the shadow in box-shadow property."
        },
        {
          "type": "textarea",
          "text": "/* Example of Box Shadow Color Parameter */\n\n.box-shadow-color {\n  width: 200px;\n  height: 100px;\n  background-color: #ffffff;\n  box-shadow: 5px 5px 10px red; /* Horizontal, Vertical, Blur, Color */\n}\n\n/* Usage */\n<div class='box-shadow-color'>Shadow with Red Color</div>",
          "template": "<style>.box-shadow-color {width: 250px;height: 150px;background-color: #ffffff;box-shadow: 5px 5px 10px red; border-radius: 10px; padding: 20px;text-align: center;font-size: 18px;color: #333333;font-family: Arial, sans-serif;transition: box-shadow 0.3s ease, transform 0.3s ease;}.box-shadow-color:hover {box-shadow: 8px 8px 20px red;transform: translateY(-5px);}</style><div class='box-shadow-color'>Shadow with Red Color</div>"
        },
        {
          "type": "paragraph",
          "text": "The blur parameter is used to specify the blur radius. The more the blur radius, the more blur the shadow is.Example of how to add blur to a box shadow:"
        },
        {
          "type": "textarea",
          "text": "/* Example of Box Shadow Blur Parameter */\n\n.box-shadow-blur {\n  width: 200px;\n  height: 100px;\n  background-color: #ffffff;\n  box-shadow: 5px 5px 20px gray; /* Horizontal, Vertical, Blur, Color */\n}\n\n/* Usage */\n<div class='box-shadow-blur'>Shadow with Blur</div>",
          "template": "<style>.box-shadow-blur {width: 250px;height: 150px;background-color: #ffffff;box-shadow: 5px 5px 20px gray; border-radius: 10px; padding: 20px;text-align: center;font-size: 18px;color: #333333;font-family: Arial, sans-serif;transition: box-shadow 0.3s ease, transform 0.3s ease; }.box-shadow-blur:hover {box-shadow: 10px 10px 30px gray; transform: translateY(-5px); }</style><div class='box-shadow-blur'>Shadow with Blur</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Setting spread radius of box shadow:"
        },
        {
          "type": "paragraph",
          "text": "The spread parameter is used to specify the spread radius of the box shadow. If it’s positive the size of shadow increases and if it’s negative, the size of shadow decreases."
        },
        {
          "type": "textarea",
          "text": "/* Example of Box Shadow Spread Radius */\n\n.box-shadow-spread {\n  width: 200px;\n  height: 100px;\n  background-color: #ffffff;\n  box-shadow: 5px 5px 10px 5px gray; /* Horizontal, Vertical, Blur, Spread, Color */\n}\n\n/* Usage */\n<div class='box-shadow-spread'>Shadow with Spread Radius</div>",
          "template": "<style>.box-shadow-spread {width: 250px;height: 150px;background-color: #ffffff;box-shadow: 5px 5px 10px 5px gray; /* Horizontal, Vertical, Blur, Spread, Color */border-radius: 10px; /* Rounded corners */padding: 20px;text-align: center;font-size: 18px;color: #333333;font-family: Arial, sans-serif;transition: box-shadow 0.3s ease, transform 0.3s ease; /* Smooth transition */}/* Hover effect for interactivity */.box-shadow-spread:hover {box-shadow: 10px 10px 20px 10px gray; /* Larger spread and blur on hover */transform: translateY(-5px); /* Lift effect on hover */}</style><div class='box-shadow-spread'>Shadow with Spread Radius</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The inset parameter:"
        },
        {
          "type": "paragraph",
          "text": "The inset parameter sets the shadow from being an outer shadow to being a inner shadow."
        },
        {
          "type": "textarea",
          "text": "/* Example of Box Shadow with Inset */\n\n.box-shadow-inset {\n  width: 200px;\n  height: 100px;\n  background-color: #ffffff;\n  box-shadow: inset 5px 5px 10px gray; /* Inset, Horizontal, Vertical, Blur, Color */\n}\n\n/* Usage */\n<div class='box-shadow-inset'>Inset Shadow</div>",
          "template": "<style>/* Example of Box Shadow with Inset */.box-shadow-inset {width: 250px;height: 150px;background-color: #ffffff;box-shadow: inset 5px 5px 10px gray; /* Inset shadow, Horizontal, Vertical, Blur, Color */border-radius: 10px; /* Rounded corners */padding: 20px;text-align: center;font-size: 18px;color: #333333;font-family: Arial, sans-serif;transition: box-shadow 0.3s ease, transform 0.3s ease; /* Smooth transition */}/* Hover effect for interactivity */.box-shadow-inset:hover {box-shadow: inset 10px 10px 20px gray; /* Darker and larger inset shadow on hover */transform: translateY(-5px); /* Lift effect on hover */}</style><div class='box-shadow-inset'>Inset Shadow</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Adding multiple shadows:"
        },
        {
          "type": "paragraph",
          "text": "You can add multiple box shadows to an element by separating the values by a coma(“,”)."
        },
        {
          "type": "textarea",
          "text": "/* Example of Box Shadow with Multiple Shadows */\n\n.multiple-shadows {\n  width: 200px;\n  height: 100px;\n  background-color: #ffffff;\n  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3),\n  -2px -2px 5px rgba(255, 0, 0, 0.5); /* Multiple shadows with different colors */\n}\n\n/* Usage */\n<div class='multiple-shadows'>Multiple Shadows</div>",
          "template": "<style>/* Example of Box Shadow with Multiple Shadows */.multiple-shadows {width: 250px;height: 150px;background-color: #ffffff;box-shadow: 2px 2px 5px rgba(0,0,0,0.3),-2px -2px 5px rgba(255,0,0,0.5); /* Multiple shadows with different colors */border-radius: 10px; /* Rounded corners */padding: 20px;text-align: center;font-size: 18px;color: #333333;font-family: Arial, sans-serif;transition: box-shadow 0.3s ease, transform 0.3s ease; /* Smooth transition */}/* Hover effect for interactivity */.multiple-shadows:hover {box-shadow: 4px 4px 10px rgba(0,0,0,0.4),-4px -4px 10px rgba(255,0,0,0.6); /* Larger shadows on hover */transform: translateY(-5px); /* Lift effect on hover */}</style><div class='multiple-shadows'>Multiple Shadows</div>"
        }
      ]
    }
  ],
  "CSS Transition": [
    {
      "title": "CSS Transition",
      "description": "CSS transition is used to control the smooth transition between two states of an element.transition property:To add transition using transition property, first specify the CSS property to add effect to and specify duration of the effect. ",
      "sub_description": "If duration is not specified, it will default to 0 and transition will have no effect.",
      "additional_info": "",
      "content": [
        {
          "type": "textarea",
          "text": "/* Example of CSS Transition */\n\n.transition-example {\n  width: 200px;\n  height: 100px;\n  background-color: blue;\n  transition: background-color 0.5s ease, transform 0.5s ease; /* Transition for background color and transform properties */\n}\n\n.transition-example:hover {\n  background-color: green; /* Changes background color on hover */\n  transform: scale(1.1); /* Scales the element on hover */\n}\n\n/* Usage */\n<div class='transition-example'>Hover me!</div>",
          "template": "<style>.transition-example {width: 200px;height: 100px;background-color: blue;color: white;text-align: center;line-height: 100px;border-radius: 10px;font-size: 18px;font-family: Arial, sans-serif;transition: background-color 0.5s ease, transform 0.5s ease;}.transition-example:hover {background-color: green;transform: scale(1.1);}</style><div class='transition-example'>Hover me!</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Changing multiple property values:"
        },
        {
          "type": "paragraph",
          "text": "You can add effect to multiple CSS properties using transition property just by separating them by a coma (“,”) and also adding duration of effect for each of the property."
        },
        {
          "type": "textarea",
          "text": "/* Example of Changing Multiple Property Values with CSS Transition */\n\n.transition-multiple {\n  width: 200px;\n  height: 100px;\n  background-color: blue;\n  color: white;\n  font-size: 16px;\n  transition: background-color 0.5s ease, color 0.5s ease, font-size 0.5s ease; /* Transition for multiple properties */\n}\n\n.transition-multiple:hover {\n  background-color: green; /* Changes background color on hover */\n  color: yellow; /* Changes text color on hover */\n  font-size: 20px; /* Increases font size on hover */\n}\n\n/* Usage */\n<div class='transition-multiple'>Hover over me!</div>",
          "template": "<style>.transition-multiple {width: 200px;height: 100px;background-color: blue;color: white;font-size: 16px;display: flex;align-items: center;justify-content: center;cursor: pointer;transition: background-color 0.5s ease, color 0.5s ease, font-size 0.5s ease;border-radius: 10px; /* Rounded corners for a smoother look */}.transition-multiple:hover {background-color: green;color: yellow;font-size: 20px;}</style><div class='transition-multiple'>Hover over me!</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Specify the Speed Curve of the Transition:"
        },
        {
          "type": "paragraph",
          "text": "The transition-timing-function is used to speed and manner of change during a transition."
        },
        {
          "type": "paragraph",
          "text": "This property can have the following values:"
        },
        {
          "type": "list",
          "items": [
            "ease – this defines a transition effect which starts slowly, then becomes fast, then ends slowly (this is default).",
            "linear – this defines a transition effect which has constant speed from start to end.",
            "ease-in – this defines a transition effect which starts slowly.",
            "ease-out – this defines a transition effect which ends slowly.",
            "ease-in-out – this defines a transition effect whichs starts slowly and ends slowly as well.",
            "cubic-bezier(n,n,n,n) - allows you to define your own values in a cubic-bezier function."
          ]
        },
        {
          "type": "textarea",
          "text": "/* Example of Specifying the Speed Curve of the Transition */\n\n.speed-curve {\n  width: 200px;\n  height: 100px;\n  background-color: blue;\n  color: white;\n  transition: background-color 1s ease-in-out; /* Ease-in-out for speed curve */\n}\n\n.speed-curve:hover {\n  background-color: green; /* Changes background color on hover */\n}\n\n/* Usage */\n<div class='speed-curve'>Hover over me!</div>",
          "template": "<style>.speed-curve {width: 200px;height: 100px;background-color: blue;color: white;display: flex;align-items: center;justify-content: center;cursor: pointer;border-radius: 10px; /* Rounded corners */padding: 20px;font-size: 16px;font-family: Arial, sans-serif;transition: background-color 1s ease-in-out, transform 0.3s ease; /* Transition for background and scale */}.speed-curve:hover {background-color: green; /* Change to green on hover */transform: scale(1.1); /* Slightly scale up on hover */}</style><div class='speed-curve'>Hover over me!</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Delay the transition effect:"
        },
        {
          "type": "paragraph",
          "text": "The transition-delay property is used to add a delay to transition effect. The delay is in seconds."
        },
        {
          "type": "textarea",
          "text": "/* Example of Delaying the Transition Effect */\n\n.delay-transition {\n  width: 200px;\n  height: 100px;\n  background-color: blue;\n  color: white;\n  transition: background-color 1s ease-in-out 0.5s; /* Delay of 0.5s before starting the transition */\n}\n\ndelay-transition:hover {\n  background-color: green; /* Changes background color on hover */\n}\n\n/* Usage */\n<div class='delay-transition'>Join the Webcooks journey!</div>",
          "template": "<style>/* Example of Delaying the Transition Effect */.delay-transition {width: 250px;height: 100px;background-color: blue;color: white;display: flex;align-items: center;justify-content: center;border-radius: 10px; /* Rounded corners */font-size: 16px;font-family: Arial, sans-serif;transition: background-color 1s ease-in-out 0.5s;/* Delay of 0.5s before starting the transition */cursor: pointer;}/* Hover state with color change */.delay-transition:hover {background-color: green;/* Changes background color on hover */}</style><div class='delay-transition'>Join the Webcooks journey!</div>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Transition shorthand property:"
        },
        {
          "type": "paragraph",
          "text": "The transition property is the shorthand for several transition properties.<br>Syntax:transition: [property-name] [duration] [timing-function] [delay];"
        },
        {
          "type": "textarea",
          "text": "/* Example of using the transition shorthand property */\n.transition-example {\n  width: 100px;\n  height: 100px;\n  background-color: blue;\n  transition: background-color 0.5s ease-in-out, transform 0.3s ease;\n}\n\n.transition-example:hover {\n  background-color: green;\n  transform: scale(1.1);\n}\n\n/* Usage */\n<div class=\"transition-example\">Join Webcooks!</div>",
          "template": "<style>.transition-example {width: 200px;height: 100px;background-color: blue;color: white;display: flex;align-items: center;justify-content: center;cursor: pointer;border-radius: 10px; /* Rounded corners */padding: 20px;font-size: 18px;font-family: Arial, sans-serif;transition: background-color 0.5s ease-in-out, transform 0.3s ease;/* Combined shorthand transition for both properties */}.transition-example:hover {background-color: green;transform: scale(1.1);/* Scale effect on hover */}</style><div class='transition-example'>Join Webcooks!</div>"
        }
      ]
    }
  ],
  "CSS Animations": [
    {
      "title": "CSS Animation",
      "description": "You can do animations in CSS to HTML elements without the use of javascript.",
      "sub_description": "The following properties will be discussed in this chapter:",
      "additional_info": "",
      "content": [
        {
          "type": "list",
          "items": [
            "@keyframes",
            "animation-name",
            "animation-duration",
            "animation-delay",
            "animation-iteration-count",
            "animation-direction",
            "animation-timing-function",
            "animation-fill-mode",
            "animation"
          ]
        },
        {
          "type": "paragraph",
          "text": "An element can transition subtly between styles with the use of animation.You must first define a few keyframes for the animation before you can utilize CSS animation."
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes */\n@keyframes exampleAnimation {\n  0% { transform: translateX(0); }\n  50% { transform: translateX(100px); }\n  100% { transform: translateX(0); }\n}\n\n/* Apply the animation to an element */\n.animated-box {\n  width: 100px;\n  height: 100px;\n  background-color: blue;\n  animation-name: exampleAnimation;\n  animation-duration: 2s;\n  animation-delay: 0s;\n  animation-iteration-count: infinite;\n  animation-direction: alternate;\n}\n\n/* Usage */\n<div class='animated-box'>Welcome to Webcooks Community</div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes exampleAnimation{0%{transform:translateX(0);}50%{transform:translateX(100px);}100%{transform:translateX(0);}}\n.animated-box{width:100px;height:100px;background-color:blue;color:white;display:flex;align-items:center;justify-content:center;animation-name:exampleAnimation;animation-duration:2s;animation-delay:0s;animation-iteration-count:infinite;animation-direction:alternate;}\n</style>\n</head>\n<body>\n<div class=\"animated-box\">Welcome to Webcooks Community</div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The @keyframes Rule:"
        },
        {
          "type": "paragraph",
          "text": "By specifying styles inside of @keyframes rule, at some time the animation will change gradually from current style to the new style inside of @keyframes."
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for the fade animation */\n@keyframes fade {\n  0% { opacity: 0; }\n  50% { opacity: 0.5; }\n  100% { opacity: 1; }\n}\n\n/* Apply the animation to an element */\n.fade-in {\n  width: 200px;\n  height: 200px;\n  background-color: coral;\n  animation-name: fade;\n  animation-duration: 3s;\n  animation-fill-mode: forwards;\n}\n\n/* Usage */\n<div class='fade-in'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes fade{0%{opacity:0;}50%{opacity:0.5;}100%{opacity:1;}}\n.fade-in{width:200px;height:200px;background-color:coral;animation-name:fade;animation-duration:3s;animation-fill-mode:forwards;}\n</style>\n</head>\n<body>\n<div class=\"fade-in\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The animation-duration property:"
        },
        {
          "type": "paragraph",
          "text": "The animation-duration property defines the time duration an animation takes. If this property is not specified then animation will not occur as by default it is set to 0s (seconds)In @keyframes you can specify change in animation using:to and from:"
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for the slide animation */\n@keyframes slide {\n  0% { transform: translateX(0); }\n  100% { transform: translateX(100px); }\n}\n\n/* Apply the animation to an element with a specific duration */\n.slide-in {\n  width: 200px;\n  height: 200px;\n  background-color: teal;\n  animation-name: slide;\n  animation-duration: 2s; /* Animation lasts for 2 seconds */\n  animation-fill-mode: forwards;\n}\n\n/* Usage */\n<div class='slide-in'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes slide{0%{transform:translateX(0);}100%{transform:translateX(100px);}}\n.slide-in{width:200px;height:200px;background-color:teal;animation-name:slide;animation-duration:2s;animation-fill-mode:forwards;}\n</style>\n</head>\n<body>\n<div class=\"slide-in\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Delay an animation:"
        },
        {
          "type": "paragraph",
          "text": "The animation-delay property is used to set delay time in start of an animation. It is specified in seconds. It can also be specified in negative time and in that case it will play as if it had already been playing for the specified seconds."
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for the fade-in animation */\n@keyframes fadeIn {\n  0% { opacity: 0; }\n  100% { opacity: 1; }\n}\n\n/* Apply the animation with a delay */\n.fade-in {\n  width: 200px;\n  height: 200px;\n  background-color: coral;\n  animation-name: fadeIn;\n  animation-duration: 3s; /* Animation lasts for 3 seconds */\n  animation-delay: 1s; /* Animation starts after a delay of 1 second */\n  animation-fill-mode: forwards;\n}\n\n/* Usage */\n<div class='fade-in'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes fadeIn{0%{opacity:0;}100%{opacity:1;}}\n.fade-in{width:200px;height:200px;background-color:coral;animation-name:fadeIn;animation-duration:3s;animation-delay:1s;animation-fill-mode:forwards;}\n</style>\n</head>\n<body>\n<div class=\"fade-in\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Set How Many Times an Animation Should Run:"
        },
        {
          "type": "paragraph",
          "text": ""
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for the bounce animation */\n@keyframes bounce {\n  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }\n  40% { transform: translateY(-30px); }\n  60% { transform: translateY(-15px); }\n}\n\n/* Apply the animation with iteration count */\n.bounce {\n  width: 100px;\n  height: 100px;\n  background-color: goldenrod;\n  animation-name: bounce;\n  animation-duration: 2s; /* Animation lasts for 2 seconds */\n  animation-iteration-count: 5; /* Animation will run 5 times */\n  animation-fill-mode: forwards;\n}\n\n/* Usage */\n<div class='bounce'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0);}40%{transform:translateY(-30px);}60%{transform:translateY(-15px);}}\n.bounce{width:100px;height:100px;background-color:goldenrod;animation-name:bounce;animation-duration:2s;animation-iteration-count:5;animation-fill-mode:forwards;}\n</style>\n</head>\n<body>\n<div class=\"bounce\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Run Animation in Reverse Direction or Alternate Cycles:"
        },
        {
          "type": "paragraph",
          "text": "The animation-direction property defines in which direction the animation should run, forwards, backwards or in alternate cycles. This property can have the following values:"
        },
        {
          "type": "list",
          "items": [
            "normal: this plays the animation in its normal flow is forwards and this is by default.",
            "reverse: this plays the animation backwards or in reverse direction.",
            "alternate: this plays the animation first in forward direction then in backward direction.",
            "alternate-reverse: this plays animation in backward direction first and then forwards."
          ]
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for a simple scale animation */\n@keyframes scale {\n  from { transform: scale(1); }\n  to { transform: scale(1.5); }\n}\n\n/* Apply the animation with alternate direction */\n.scale-animation {\n  width: 200px;\n  height: 200px;\n  background-color: teal;\n  animation-name: scale;\n  animation-duration: 2s;\n  animation-direction: alternate; /* Animation will run forward and then backward */\n  animation-iteration-count: infinite; /* Animation will repeat indefinitely */\n}\n\n/* Usage */\n<div class='scale-animation'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes scale{from{transform:scale(1);}to{transform:scale(1.5);}}\n.scale-animation{width:200px;height:200px;background-color:teal;animation-name:scale;animation-duration:2s;animation-direction:alternate;animation-iteration-count:infinite;}\n</style>\n</head>\n<body>\n<div class=\"scale-animation\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Specify the Speed Curve of the Animation:"
        },
        {
          "type": "paragraph",
          "text": "The animation-timing-function property in CSS controls how an animation moves forward over time by defining its speed curve. Because it controls the animation's tempo, more dynamic and eye-catching effects are possible. "
        },
        {
          "type": "list",
          "items": [
            " ease: (default) Defines an animation that begins slowly, accelerates, and ends slowly.",
            "linear:",
            "ease-in: defines a slow-starting animation.",
            " ease-out – defines a slow-ending animation.",
            "ease-in-out – this defines an animation which has a slow start and a slow end.",
            "cubic-bezier(n,n,n,n) – this lets you define your own values in a cubic-bezier function."
          ]
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for a simple move animation */\n@keyframes move {\n  from { transform: translateX(0); }\n  to { transform: translateX(100px); }\n}\n\n/* Apply the animation with a custom timing function */\n.move-animation {\n  width: 100px;\n  height: 100px;\n  background-color: coral;\n  animation-name: move;\n  animation-duration: 2s;\n  animation-timing-function: ease-in-out; /* Specify the speed curve of the animation */\n}\n\n/* Usage */\n<div class='move-animation'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes move{from{transform:translateX(0);}to{transform:translateX(100px);}}\n.move-animation{width:100px;height:100px;background-color:coral;animation-name:move;animation-duration:2s;animation-timing-function:ease-in-out;}\n</style>\n</head>\n<body>\n<div class=\"move-animation\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Specify the fill-mode For an Animation:"
        },
        {
          "type": "paragraph",
          "text": "Neither before nor after the first keyframe is played do CSS animations have an impact on an element. The animation-fill-mode property has the ability to overrule this action.The animation-fill-mode property can take up the following values: "
        },
        {
          "type": "list",
          "items": [
            "none: It is the default setting. ",
            "forwards: (Depends on animation-direction and animation-iteration-count) the element will maintain the style settings established by the previous keyframe.",
            "backwards: ",
            "both: The animation will follow properties of both forwards and backwards and will extend animation properties in both directions."
          ]
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for a simple fade animation */\n@keyframes fade {\n  from { opacity: 0; }\n  to { opacity: 1; }\n}\n\n/* Apply the animation with a fill-mode */\n.fade-animation {\n  width: 100px;\n  height: 100px;\n  background-color: teal;\n  animation-name: fade;\n  animation-duration: 3s;\n  animation-fill-mode: forwards; /* Specifies that the animation will maintain the final state */\n}\n\n/* Usage */\n<div class='fade-animation'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes fade{from{opacity:0;}to{opacity:1;}}\n.fade-animation{width:100px;height:100px;background-color:teal;animation-name:fade;animation-duration:3s;animation-fill-mode:forwards;}\n</style>\n</head>\n<body>\n<div class=\"fade-animation\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "Animation shorthand property:"
        },
        {
          "type": "paragraph",
          "text": "You may set several animation-related properties in a single line using CSS's animation shorthand property.<br>Syntax:animation: [animation-name] [animation-duration] [animation-timing-function] [animation-delay] [animation-iteration-count] [animation-direction] [animation-fill-mode] [animation-play-state];"
        },
        {
          "type": "textarea",
          "text": "/* Define the keyframes for a simple bounce animation */\n@keyframes bounce {\n  0%, 20%, 50%, 80%, 100% {\n    transform: translateY(0);\n  }\n  40% {\n    transform: translateY(-30px);\n  }\n  60% {\n    transform: translateY(-15px);\n  }\n}\n\n/* Apply the animation using shorthand property */\n.bounce-animation {\n  width: 100px;\n  height: 100px;\n  background-color: orange;\n  animation: bounce 2s ease infinite; /* Shorthand for all animation properties */\n}\n\n/* Usage */\n<div class='bounce-animation'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Animation Demo</title>\n<style>\n@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0);}40%{transform:translateY(-30px);}60%{transform:translateY(-15px);}}\n.bounce-animation{width:100px;height:100px;background-color:orange;animation:bounce 2s ease infinite;}\n</style>\n</head>\n<body>\n<div class=\"bounce-animation\"></div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Transformations": [
    {
      "title": "CSS Transformations",
      "description": "2D transforms:You can skew, scale, rotate, and move elements using CSS 2D transforms. The transformation in this are done along the X-axis and Y-axis.",
      "sub_description": "",
      "additional_info": "",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "The translate() method:"
        },
        {
          "type": "paragraph",
          "text": "An element is moved from its present position using the translate() method (based on the X-axis and Y-axis parameters)."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the translate() method in CSS */\n.translate-example {\n  width: 100px;\n  height: 100px;\n  background-color: blue;\n  transform: translate(50px, 50px); /* Moves the element 50px to the right and 50px down */\n}\n\n/* Usage */\n<div class='translate-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.translate-example{width:100px;height:100px;background-color:blue;transform:translate(50px,50px);}\n</style>\n</head>\n<body>\n<div class=\"translate-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The rotate() method:"
        },
        {
          "type": "paragraph",
          "text": "An element can be rotated clockwise or counterclockwise using the rotate() method according to a given degree. Using positive values will rotate element clockwise and negative values will rotate element counter-clockwise."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the rotate() method in CSS */\n.rotate-example {\n  width: 100px;\n  height: 100px;\n  background-color: red;\n  transform: rotate(45deg); /* Rotates the element 45 degrees clockwise */\n}\n\n/* Usage */\n<div class='rotate-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.rotate-example{width:100px;height:100px;background-color:red;transform:rotate(45deg);}\n</style>\n</head>\n<body>\n<div class=\"rotate-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The scale() method:"
        },
        {
          "type": "paragraph",
          "text": "Depending on the values provided for the width and height, the scale() method alters the size of an element.An elements size can be halved by using scale(0.5,0.5)."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the scale() method in CSS */\n.scale-example {\n  width: 100px;\n  height: 100px;\n  background-color: blue;\n  transform: scale(1.5); /* Scales the element to 150% of its original size */\n}\n\n/* Usage */\n<div class='scale-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.scale-example{width:100px;height:100px;background-color:blue;transform:scale(1.5);}\n</style>\n</head>\n<body>\n<div class=\"scale-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "The scaleX() method:"
        },
        {
          "type": "paragraph",
          "text": "An element's width can be changed using the scaleX() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the scaleX() method in CSS */\n.scaleX-example {\n  width: 100px;\n  height: 100px;\n  background-color: green;\n  transform: scaleX(2); /* Scales the element's width to 200% of its original size */\n}\n\n/* Usage */\n<div class='scaleX-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.scaleX-example{width:100px;height:100px;background-color:green;transform:scaleX(2);}\n</style>\n</head>\n<body>\n<div class=\"scaleX-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "The scaleY() method:"
        },
        {
          "type": "paragraph",
          "text": "An element's height can be changed using the scaleY() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the scaleY() method in CSS */\n.scaleY-example {\n  width: 100px;\n  height: 100px;\n  background-color: blue;\n  transform: scaleY(1.5); /* Scales the element's height to 150% of its original size */\n}\n\n/* Usage */\n<div class='scaleY-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.scaleY-example{width:100px;height:100px;background-color:blue;transform:scaleY(1.5);}\n</style>\n</head>\n<body>\n<div class=\"scaleY-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The skew() Method:"
        },
        {
          "type": "paragraph",
          "text": "An element is skewed along the X-axis and the Y-axis by a specified angle using skew() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the skew() method in CSS */\n.skew-example {\n  width: 100px;\n  height: 100px;\n  background-color: orange;\n  transform: skew(20deg, 10deg); /* Skews the element by 20 degrees on the X-axis and 10 degrees on the Y-axis */\n}\n\n/* Usage */\n<div class='skew-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.skew-example{width:100px;height:100px;background-color:orange;transform:skew(20deg,10deg);}\n</style>\n</head>\n<body>\n<div class=\"skew-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "The skewX() method:"
        },
        {
          "type": "paragraph",
          "text": "An element is skewed along the X-axis by the specified angle using the skewX() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the skewX() method in CSS */\n.skewX-example {\n  width: 100px;\n  height: 100px;\n  background-color: teal;\n  transform: skewX(30deg); /* Skews the element by 30 degrees on the X-axis */\n}\n\n/* Usage */\n<div class='skewX-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.skewX-example{width:100px;height:100px;background-color:teal;transform:skewX(30deg);}\n</style>\n</head>\n<body>\n<div class=\"skewX-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "5",
          "text": "The skewY() Method:"
        },
        {
          "type": "paragraph",
          "text": "An element is skewed along the Y-axis by the specified angle using skewY() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of using the skewY() method in CSS */\n.skewY-example {\n  width: 100px;\n  height: 100px;\n  background-color: coral;\n  transform: skewY(30deg); /* Skews the element by 30 degrees on the Y-axis */\n}\n\n/* Usage */\n<div class='skewY-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.skewY-example{width:100px;height:100px;background-color:coral;transform:skewY(30deg);}\n</style>\n</head>\n<body>\n<div class=\"skewY-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The matrix() method:"
        },
        {
          "type": "paragraph",
          "text": "In the matrix() method all the 2D transform properties are combined into one.<br>Syntax:Transform: matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY());"
        },
        {
          "type": "textarea",
          "text": "/* Example of using the matrix() method in CSS */\n.matrix-example {\n  width: 100px;\n  height: 100px;\n  background-color: lightblue;\n  transform: matrix(1, 0.5, 0.5, 1, 0, 0); /* Applies a 2D transformation with matrix values */\n}\n\n/* Usage */\n<div class='matrix-example'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.matrix-example{width:100px;height:100px;background-color:lightblue;transform:matrix(1,0.5,0.5,1,0,0);}\n</style>\n</head>\n<body>\n<div class=\"matrix-example\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "2",
          "text": "3D transforms in CSS:"
        },
        {
          "type": "paragraph",
          "text": "Using CSS you can also perform 3D transformations. These transformation differ from 2D transformation as these also have a Z-axis along with X-axis and Y-axis."
        },
        {
          "type": "textarea",
          "text": "/* Example of 3D transforms in CSS */\n.three-d-transform {\n  width: 100px;\n  height: 100px;\n  background-color: coral;\n  transform: rotateY(30deg) rotateX(20deg) translateZ(50px); /* Applies 3D transformations */\n  transform-style: preserve-3d; /* Enables 3D transformations */\n}\n\n/* Usage */\n<div class='three-d-transform'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.three-d-transform{width:100px;height:100px;background-color:coral;transform:rotateY(30deg) rotateX(20deg) translateZ(50px);transform-style:preserve-3d;}\n</style>\n</head>\n<body>\n<div class=\"three-d-transform\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The rotateX() Method:"
        },
        {
          "type": "paragraph",
          "text": "An element is rotated by a specified degree along the X-axis using rotateX() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of rotateX() method in CSS */\n.rotate-x {\n  width: 100px;\n  height: 100px;\n  background-color: lightblue;\n  transform: rotateX(45deg); /* Rotates the element 45 degrees around the X-axis */\n  transition: transform 0.5s; /* Adds a transition effect */\n}\n\n/* Usage */\n<div class='rotate-x'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.rotate-x{width:100px;height:100px;background-color:lightblue;transform:rotateX(45deg);transition:transform 0.5s;}\n</style>\n</head>\n<body>\n<div class=\"rotate-x\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The rotateY() method:"
        },
        {
          "type": "paragraph",
          "text": "An element is rotated by a specified degree along the Y-axis using rotateY() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of rotateY() method in CSS */\n.rotate-y {\n  width: 100px;\n  height: 100px;\n  background-color: lightgreen;\n  transform: rotateY(45deg); /* Rotates the element 45 degrees around the Y-axis */\n  transition: transform 0.5s; /* Adds a transition effect */\n}\n\n/* Usage */\n<div class='rotate-y'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.rotate-y{width:100px;height:100px;background-color:lightgreen;transform:rotateY(45deg);transition:transform 0.5s;}\n</style>\n</head>\n<body>\n<div class=\"rotate-y\"></div>\n</body>\n</html>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": "The rotateZ() method:"
        },
        {
          "type": "paragraph",
          "text": "An element is rotated by a specified degree along the Z-axis using rotateZ() method."
        },
        {
          "type": "textarea",
          "text": "/* Example of rotateZ() method in CSS */\n.rotate-z {\n  width: 100px;\n  height: 100px;\n  background-color: lightcoral;\n  transform: rotateZ(30deg); /* Rotates the element 30 degrees around the Z-axis */\n  transition: transform 0.5s; /* Adds a transition effect */\n}\n\n/* Usage */\n<div class='rotate-z'></div>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Transformations Demo</title>\n<style>\n.rotate-z{width:100px;height:100px;background-color:lightcoral;transform:rotateZ(30deg);transition:transform 0.5s;}\n</style>\n</head>\n<body>\n<div class=\"rotate-z\"></div>\n</body>\n</html>"
        }
      ]
    }
  ],
  "CSS Media Queries": [
    {
      "title": "CSS Media Queries",
      "description": "In CSS2, the @media rule was added, allowing for the definition of distinct style rules for various media types. The CSS3 media queries concept expanded on the CSS2 media type concept by examining the device's capabilities rather than its type.",
      "sub_description": "CSS media queries let you apply styles according on certain conditions, such as viewport size (height and width of viewport), screen resolution, or device orientation (orientation of viewport like landscape or portrait).",
      "additional_info": "Syntax:A media query is made up of a media type and one or more media features that can be true or false. The media-type is optional but is necessary when not or only is used.<br>@media not|only media-type and (media feature) and (media feature) { <br>&nbsp;&nbsp;&nbsp;&nbsp;/* CSS rules here */<br>&nbsp;&nbsp;&nbsp;&nbsp;}",
      "content": [
        {
          "type": "heading",
          "level": "4",
          "text": "Explanation:"
        },
        {
          "type": "list",
          "items": [
            "media-type: Defines the media type (e.g., screen, print). Using only restricts the styles to that media type.",
            "not: Excludes the defined media condition or type from the subsequent styles.",
            "media feature: This represents conditions such as min-width, min-resolution, max-width etc.",
            "and: More precise queries are made possible by combining a media type with one or more media features using the and keyword.",
            "only: To stop the styles within that media query from being applied by older browsers that do not support media queries, the only keyword is used. "
          ]
        },
        {
          "type": "paragraph",
          "text": "The media query is considered to be \"true\" if"
        },
        {
          "type": "list",
          "items": [
            "The media type matches the device type For example, if the device is a screen and the media type is screen, the two are compatible.",
            "All specified media features in media query evaluate to true (for example, if the viewport width is less than or equal to a specific value)."
          ]
        },
        {
          "type": "paragraph",
          "text": "Additionally, you can link to various stylesheets for various media and viewport (browser window) widths:"
        },
        {
          "type": "textarea",
          "text": "<link rel='stylesheet' href='style.css'>\n<link rel='stylesheet' href='style-mobile.css' media='(max-width: 600px)'>\n<link rel='stylesheet' href='style-tablet.css' media='(min-width: 601px) and (max-width: 1024px)'>\n<link rel='stylesheet' href='style-desktop.css' media='(min-width: 1025px)'>",
          "template": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>CSS Media Queries Demo</title>\n<style>\n<link rel='stylesheet' href='style.css'>\n<link rel='stylesheet' href='style-mobile.css' media='(max-width: 600px)'>\n<link rel='stylesheet' href='style-tablet.css' media='(min-width: 601px) and (max-width: 1024px)'>\n<link rel='stylesheet' href='style-desktop.css' media='(min-width: 1025px)'>\n</style>\n</head>\n<body>\n</body>\n</html>"
        },
        {
          "type": "paragraph",
          "text": "Having a differnet CSS section directly within your style sheet is one way to use media queries.For example:-"
        },
        {
          "type": "textarea",
          "text": "@media (max-width: 600px) {\n  body {\n    background-color: lightblue;\n  }\n}\n\n@media (min-width: 601px) and (max-width: 1024px) {\n  body {\n    background-color: lightgreen;\n  }\n}\n\n@media (min-width: 1025px) {\n  body {\n    background-color: lightcoral;\n  }\n}",
          "template": "<style>/* Default style */body{font-family: Arial, sans-serif;text-align: center;background-color: lightgray;}h1{margin-top: 100px;}/* Mobile devices */@media (max-width: 600px){body{background-color: red;}h1: :after{content: ' - Mobile View';}}/* Tablet devices */@media (min-width: 601px) and (max-width: 1024px){body{background-color: blue;}h1: :after{content: ' - Tablet View';}}/* Desktop devices */@media (min-width: 1025px){body{background-color: green;}h1: :after{content: ' - Desktop View';}}</style><h1>Media Query Demo</h1><p>Resize the browser window to see the background color change.</p>"
        },
        {
          "type": "heading",
          "level": "4",
          "text": ""
        }
      ]
    }
  ]
}