[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-config":3,"topic:css-margin-and-margin-collapse":6,"blog-categories":168,"course-tree":192},{"data":4},{"google_site_verification":5,"ga4_measurement_id":5,"site_name":5,"default_og_image":5,"twitter_handle":5},null,{"data":7},{"id":8,"title":9,"slug":10,"content":11,"course":12,"subcategory":15,"author":18,"reading_time_minutes":24,"cornerstone":25,"schema_type":26,"faq_json":5,"video_url":5,"canonical_url":27,"meta_title":28,"meta_description":29,"og_image":5,"toc_json":30,"code_examples":109,"quiz":5,"exercises":143,"published_at":5,"updated_at":159,"prev":160,"next":164},103,"CSS Margin and Margin Collapse","css-margin-and-margin-collapse","\u003Ch2 id=\"css-margin-and-margin-collapse-complete-guide-with-examples\">CSS Margin and Margin Collapse: Complete Guide with Examples\u003C\u002Fh2>\u003Cp>The \u003Cstrong>CSS margin\u003C\u002Fstrong> property creates space outside an element border. It controls the distance between elements and is one of the most used properties in web design. But margin has a famous quirk called \u003Cstrong>margin collapse\u003C\u002Fstrong>, where vertical margins combine instead of adding up. Understanding CSS margin collapse saves hours of layout debugging and is a very common frontend interview question.\u003C\u002Fp>\u003Ch3 id=\"what-you-will-learn\">What You Will Learn\u003C\u002Fh3>\u003Cul>\u003Cli>Margin longhand and shorthand syntax (1, 2, 3 and 4 values)\u003C\u002Fli>\u003Cli>Centering with \u003Ccode>margin: 0 auto\u003C\u002Fcode>\u003C\u002Fli>\u003Cli>Negative and percentage margins\u003C\u002Fli>\u003Cli>Logical margin properties such as margin-inline and margin-block\u003C\u002Fli>\u003Cli>The three types of margin collapse and the exact calculation rules\u003C\u002Fli>\u003Cli>How to prevent collapse with flow-root, flex, grid, padding and gap\u003C\u002Fli>\u003C\u002Ful>\u003Ch3 id=\"margin-longhand-properties\">Margin Longhand Properties\u003C\u002Fh3>\u003Cp>Set each side separately with \u003Ccode>margin-top\u003C\u002Fcode>, \u003Ccode>margin-right\u003C\u002Fcode>, \u003Ccode>margin-bottom\u003C\u002Fcode> and \u003Ccode>margin-left\u003C\u002Fcode>.\u003C\u002Fp>\u003Ch3 id=\"margin-shorthand-1-2-3-and-4-values\">Margin Shorthand: 1, 2, 3 and 4 Values\u003C\u002Fh3>\u003Cul>\u003Cli>\u003Ccode>margin: 10px;\u003C\u002Fcode> all four sides\u003C\u002Fli>\u003Cli>\u003Ccode>margin: 10px 20px;\u003C\u002Fcode> vertical (top and bottom), horizontal (left and right)\u003C\u002Fli>\u003Cli>\u003Ccode>margin: 10px 20px 30px;\u003C\u002Fcode> top, horizontal, bottom\u003C\u002Fli>\u003Cli>\u003Ccode>margin: 10px 20px 30px 40px;\u003C\u002Fcode> top, right, bottom, left (clockwise, remember TRouBLe)\u003C\u002Fli>\u003C\u002Ful>\u003Ch3 id=\"centering-a-block-with-margin-auto\">Centering a Block with margin: auto\u003C\u002Fh3>\u003Cp>A block element with a set width can be horizontally centered using \u003Ccode>margin-inline: auto\u003C\u002Fcode> (or the classic \u003Ccode>margin: 0 auto\u003C\u002Fcode>). The browser splits the free horizontal space equally between the left and right margins. It does not work on inline elements, and \u003Ccode>margin: auto\u003C\u002Fcode> does not center vertically in normal block flow. In Flexbox and Grid, auto margins absorb free space in both directions, for example \u003Ccode>margin-left: auto\u003C\u002Fcode> pushes a nav button to the far end of the row.\u003C\u002Fp>\u003Ch3 id=\"negative-margins\">Negative Margins\u003C\u002Fh3>\u003Cp>Margins can be negative. A negative margin pulls an element toward or over its neighbours, or makes it extend outside its container. Use it sparingly for overlaps and optical alignment, and prefer transforms or Grid placement for complex overlaps.\u003C\u002Fp>\u003Ch3 id=\"percentage-margins\">Percentage Margins\u003C\u002Fh3>\u003Cp>Percentage margins, including top and bottom, are calculated from the \u003Cstrong>width\u003C\u002Fstrong> (inline size) of the containing block, not its height. So \u003Ccode>margin-top: 10%\u003C\u002Fcode> inside a 500px wide parent equals 50px.\u003C\u002Fp>\u003Ch3 id=\"margin-on-inline-elements\">Margin on Inline Elements\u003C\u002Fh3>\u003Cp>For inline elements such as span and a, only horizontal margin works. Top and bottom margins are ignored. Use \u003Ccode>display: inline-block\u003C\u002Fcode> or block when you need vertical margin.\u003C\u002Fp>\u003Ch3 id=\"logical-margin-properties\">Logical Margin Properties\u003C\u002Fh3>\u003Cp>Use \u003Ccode>margin-inline\u003C\u002Fcode>, \u003Ccode>margin-block\u003C\u002Fcode>, \u003Ccode>margin-inline-start\u003C\u002Fcode>, \u003Ccode>margin-inline-end\u003C\u002Fcode>, \u003Ccode>margin-block-start\u003C\u002Fcode> and \u003Ccode>margin-block-end\u003C\u002Fcode> for direction-aware spacing that works in right-to-left and vertical writing modes.\u003C\u002Fp>\u003Ch3 id=\"what-is-margin-collapse\">What Is Margin Collapse?\u003C\u002Fh3>\u003Cp>\u003Cstrong>Margin collapse\u003C\u002Fstrong> happens when the vertical margins of two or more block boxes touch. Instead of adding together, they merge into a single margin. Horizontal margins never collapse.\u003C\u002Fp>\u003Ch3 id=\"margin-collapse-calculation-rules\">Margin Collapse Calculation Rules\u003C\u002Fh3>\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Case\u003C\u002Fth>\u003Cth>Rule\u003C\u002Fth>\u003Cth>Example\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>Both positive\u003C\u002Ftd>\u003Ctd>The larger margin wins\u003C\u002Ftd>\u003Ctd>40px and 30px give 40px\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Both negative\u003C\u002Ftd>\u003Ctd>The most negative wins\u003C\u002Ftd>\u003Ctd>-20px and -10px give -20px\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>One positive, one negative\u003C\u002Ftd>\u003Ctd>They are added together\u003C\u002Ftd>\u003Ctd>40px and -10px give 30px\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003Ch3 id=\"the-three-types-of-margin-collapse\">The Three Types of Margin Collapse\u003C\u002Fh3>\u003Ch4 id=\"1-adjacent-siblings\">1. Adjacent Siblings\u003C\u002Fh4>\u003Cp>The bottom margin of one block and the top margin of the next block touch and collapse. A paragraph with \u003Ccode>margin-bottom: 40px\u003C\u002Fcode> followed by one with \u003Ccode>margin-top: 30px\u003C\u002Fcode> produces a 40px gap, not 70px.\u003C\u002Fp>\u003Ch4 id=\"2-parent-and-first-or-last-child\">2. Parent and First or Last Child\u003C\u002Fh4>\u003Cp>If a parent has no padding, no border, no inline content and no clearance between it and its first child, the child top margin collapses through the parent and appears outside it. The parent moves down instead of the child moving inside. The same happens with the last child bottom margin and the parent bottom margin when the parent height is auto.\u003C\u002Fp>\u003Ch4 id=\"3-empty-blocks\">3. Empty Blocks\u003C\u002Fh4>\u003Cp>If a block has no content, padding, border or height, its own top and bottom margins collapse together, and can then collapse with neighbouring margins.\u003C\u002Fp>\u003Ch3 id=\"when-margins-do-not-collapse\">When Margins Do NOT Collapse\u003C\u002Fh3>\u003Cul>\u003Cli>Inside Flexbox or CSS Grid containers (flex and grid items never collapse margins with each other)\u003C\u002Fli>\u003Cli>On floated, absolutely positioned and fixed elements\u003C\u002Fli>\u003Cli>On inline-block elements\u003C\u002Fli>\u003Cli>When a parent has padding, a border, or an overflow value other than visible\u003C\u002Fli>\u003Cli>When the parent creates a new block formatting context, for example with \u003Ccode>display: flow-root\u003C\u002Fcode>\u003C\u002Fli>\u003Cli>Between horizontal margins, always\u003C\u002Fli>\u003C\u002Ful>\u003Ch3 id=\"how-to-fix-or-prevent-margin-collapse\">How to Fix or Prevent Margin Collapse\u003C\u002Fh3>\u003Col>\u003Cli>\u003Ccode>display: flow-root\u003C\u002Fcode> on the parent: the modern, clean fix with no side effects.\u003C\u002Fli>\u003Cli>Add a small padding or border to the parent.\u003C\u002Fli>\u003Cli>Use \u003Ccode>overflow: auto\u003C\u002Fcode> or hidden (can clip content, so use carefully).\u003C\u002Fli>\u003Cli>Make the parent a flex or grid container.\u003C\u002Fli>\u003Cli>Use \u003Ccode>gap\u003C\u002Fcode> in Flexbox or Grid instead of margins between items.\u003C\u002Fli>\u003Cli>Use one-directional spacing: only \u003Ccode>margin-bottom\u003C\u002Fcode> (or only margin-top) on siblings.\u003C\u002Fli>\u003C\u002Fol>\u003Ch3 id=\"modern-spacing-patterns-gap-and-the-stack-layout\">Modern Spacing Patterns: gap and the Stack Layout\u003C\u002Fh3>\u003Cp>Many developers avoid margin collapse with \u003Ccode>gap\u003C\u002Fcode> in Flexbox and Grid, which adds space only between items. Another popular pattern is the stack (also called the lobotomized owl selector): \u003Ccode>.stack &gt; * + * { margin-block-start: 1rem; }\u003C\u002Fcode>. It adds space only between siblings, so there is no extra space at the start or end. Utility frameworks such as Tailwind CSS use similar ideas with space-y and gap utilities. The newer \u003Ccode>margin-trim\u003C\u002Fcode> property is designed to trim margins at container edges, but browser support is still limited, so check before relying on it.\u003C\u002Fp>\u003Ch3 id=\"margin-vs-padding-quick-decision-guide\">Margin vs Padding: Quick Decision Guide\u003C\u002Fh3>\u003Cul>\u003Cli>Space between two elements: use margin (or gap).\u003C\u002Fli>\u003Cli>Space inside an element between content and border: use padding.\u003C\u002Fli>\u003Cli>Background color behind the space: use padding, because margin is always transparent.\u003C\u002Fli>\u003C\u002Ful>\u003Ch3 id=\"common-mistakes\">Common Mistakes\u003C\u002Fh3>\u003Cul>\u003Cli>Expecting 40px plus 30px to equal 70px between siblings.\u003C\u002Fli>\u003Cli>Adding margin-top to the first child and wondering why the whole parent moves.\u003C\u002Fli>\u003Cli>Using negative margins for layout when Grid or Flexbox is cleaner.\u003C\u002Fli>\u003Cli>Using margin on inline elements to create vertical space.\u003C\u002Fli>\u003Cli>Setting both margin-top and margin-bottom on every element, creating confusing collapse behaviour.\u003C\u002Fli>\u003C\u002Ful>\u003Ch3 id=\"frequently-asked-questions\">Frequently Asked Questions\u003C\u002Fh3>\u003Ch4 id=\"why-is-my-margin-top-not-working\">Why is my margin-top not working?\u003C\u002Fh4>\u003Cp>Common causes: the element is inline, the margin is collapsing with its parent, or another rule overrides it. Inspect the element in DevTools.\u003C\u002Fp>\u003Ch4 id=\"do-left-and-right-margins-collapse\">Do left and right margins collapse?\u003C\u002Fh4>\u003Cp>No. Only vertical margins of block boxes in normal flow collapse.\u003C\u002Fp>\u003Ch4 id=\"does-margin-collapse-happen-in-flexbox\">Does margin collapse happen in Flexbox?\u003C\u002Fh4>\u003Cp>No. Flex items and grid items do not collapse margins.\u003C\u002Fp>\u003Ch4 id=\"what-is-the-best-way-to-stop-margin-collapse\">What is the best way to stop margin collapse?\u003C\u002Fh4>\u003Cp>Use \u003Ccode>display: flow-root\u003C\u002Fcode> on the parent, or use gap in flex and grid layouts.\u003C\u002Fp>\u003Ch3 id=\"key-takeaways\">Key Takeaways\u003C\u002Fh3>\u003Cul>\u003Cli>Margin is outside space and is always transparent.\u003C\u002Fli>\u003Cli>Vertical margins between blocks collapse: max for positives, most negative for negatives, sum for mixed.\u003C\u002Fli>\u003Cli>Flex and grid items, floats, absolutely positioned and inline-block elements do not collapse.\u003C\u002Fli>\u003Cli>\u003Ccode>display: flow-root\u003C\u002Fcode> and \u003Ccode>gap\u003C\u002Fcode> are the cleanest modern solutions.\u003C\u002Fli>\u003C\u002Ful>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.wrap { background: #f2f3f4; padding: 10px; font-family: sans-serif; }\n.b { background: #aed6f1; padding: 10px; }\n.m1 { margin: 10px; }\n.m2 { margin: 10px 40px; }\n.m3 { margin: 10px 40px 20px; }\n.m4 { margin: 5px 10px 20px 60px; }\n&lt;\u002Fstyle&gt;\n&lt;div class='wrap'&gt;\n  &lt;div class='b m1'&gt;margin: 10px&lt;\u002Fdiv&gt;\n  &lt;div class='b m2'&gt;margin: 10px 40px&lt;\u002Fdiv&gt;\n  &lt;div class='b m3'&gt;margin: 10px 40px 20px&lt;\u002Fdiv&gt;\n  &lt;div class='b m4'&gt;margin: 5px 10px 20px 60px&lt;\u002Fdiv&gt;\n&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.container {\n  width: 300px;\n  margin: 0 auto;\n  padding: 16px;\n  background: #d5f5e3;\n  text-align: center;\n  font-family: sans-serif;\n}\n&lt;\u002Fstyle&gt;\n&lt;div class='container'&gt;Centered with margin: 0 auto&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.nav { display: flex; align-items: center; gap: 12px; padding: 12px; background: #2c3e50; color: white; font-family: sans-serif; }\n.nav .push { margin-left: auto; background: #1abc9c; border: none; color: white; padding: 8px 16px; border-radius: 6px; }\n&lt;\u002Fstyle&gt;\n&lt;div class='nav'&gt;&lt;span&gt;Logo&lt;\u002Fspan&gt;&lt;span&gt;Home&lt;\u002Fspan&gt;&lt;span&gt;Blog&lt;\u002Fspan&gt;&lt;button class='push'&gt;Sign in&lt;\u002Fbutton&gt;&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.base { width: 200px; height: 80px; background: #aed6f1; padding: 10px; font-family: sans-serif; }\n.overlap { width: 200px; height: 80px; background: #f5b7b1; padding: 10px; margin-top: -40px; margin-left: 60px; font-family: sans-serif; }\n&lt;\u002Fstyle&gt;\n&lt;div class='base'&gt;First box&lt;\u002Fdiv&gt;\n&lt;div class='overlap'&gt;Second box pulled up with a negative margin&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.a { margin-bottom: 40px; background: #fadbd8; padding: 10px; font-family: sans-serif; }\n.b { margin-top: 30px; background: #d6eaf8; padding: 10px; font-family: sans-serif; }\n&lt;\u002Fstyle&gt;\n&lt;div class='a'&gt;Box A: margin-bottom 40px&lt;\u002Fdiv&gt;\n&lt;div class='b'&gt;Box B: margin-top 30px&lt;\u002Fdiv&gt;\n&lt;p style='font-family:sans-serif'&gt;The gap between A and B is 40px, not 70px.&lt;\u002Fp&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.row { display: flex; gap: 20px; font-family: sans-serif; }\n.col { flex: 1; }\n.parent { background: #fcf3cf; }\n.child { margin-top: 40px; background: #f9e79f; padding: 10px; }\n.fixed { display: flow-root; }\n&lt;\u002Fstyle&gt;\n&lt;div class='row'&gt;\n  &lt;div class='col'&gt;\n    &lt;p&gt;Collapsing: the margin escapes the parent&lt;\u002Fp&gt;\n    &lt;div class='parent'&gt;&lt;div class='child'&gt;Child margin-top: 40px&lt;\u002Fdiv&gt;&lt;\u002Fdiv&gt;\n  &lt;\u002Fdiv&gt;\n  &lt;div class='col'&gt;\n    &lt;p&gt;Fixed with display: flow-root&lt;\u002Fp&gt;\n    &lt;div class='parent fixed'&gt;&lt;div class='child'&gt;Child margin-top: 40px&lt;\u002Fdiv&gt;&lt;\u002Fdiv&gt;\n  &lt;\u002Fdiv&gt;\n&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.flex { display: flex; flex-direction: column; background: #f2f3f4; font-family: sans-serif; }\n.item { margin: 20px 0; background: #abebc6; padding: 10px; }\n&lt;\u002Fstyle&gt;\n&lt;div class='flex'&gt;\n  &lt;div class='item'&gt;Item 1 (margin 20px)&lt;\u002Fdiv&gt;\n  &lt;div class='item'&gt;Item 2 (margin 20px)&lt;\u002Fdiv&gt;\n&lt;\u002Fdiv&gt;\n&lt;p style='font-family:sans-serif'&gt;In flex, margins do NOT collapse, so the gap is 40px.&lt;\u002Fp&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.grid { display: grid; gap: 16px; padding: 16px; background: #eaf2f8; font-family: sans-serif; }\n.grid div { background: #85c1e9; padding: 12px; }\n&lt;\u002Fstyle&gt;\n&lt;div class='grid'&gt;\n  &lt;div&gt;Card 1&lt;\u002Fdiv&gt;\n  &lt;div&gt;Card 2&lt;\u002Fdiv&gt;\n  &lt;div&gt;Card 3&lt;\u002Fdiv&gt;\n&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-html\">\u003Cpre>\u003Ccode>&lt;style&gt;\n.stack &gt; * + * { margin-block-start: 1rem; }\n.stack &gt; * { background: #d2b4de; padding: 12px; font-family: sans-serif; }\n&lt;\u002Fstyle&gt;\n&lt;div class='stack'&gt;\n  &lt;div&gt;Item one&lt;\u002Fdiv&gt;\n  &lt;div&gt;Item two&lt;\u002Fdiv&gt;\n  &lt;div&gt;Item three&lt;\u002Fdiv&gt;\n&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cdiv class=\"try-it-yourself language-javascript\">\u003Cpre>\u003Ccode>const box = document.createElement('div');\nbox.style.padding = '1px';\nconst a = document.createElement('div');\na.style.cssText = 'height:50px;margin-bottom:40px;background:#ccc;';\nconst b = document.createElement('div');\nb.style.cssText = 'height:50px;margin-top:30px;background:#999;';\nbox.append(a, b);\ndocument.body.appendChild(box);\nconst gap = b.getBoundingClientRect().top - a.getBoundingClientRect().bottom;\nconsole.log('Gap between siblings:', gap);\nbox.remove();\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>",{"name":13,"slug":14},"CSS","css",{"name":16,"slug":17},"Box Model & Spacing","box-model-spacing",{"slug":19,"display_name":20,"job_title":5,"short_bio":5,"expertise_tags":21,"headshot":5,"long_bio":5,"credentials":5,"twitter_url":5,"linkedin_url":5,"github_url":5,"personal_website_url":5,"other_sameas_urls":5,"topics":22,"posts":23},"badar-khalil","Badar Khalil",[],[],[],7,false,"Article","https:\u002F\u002Fwpfsharp.com\u002Ftopics\u002Fcss-margin-and-margin-collapse","CSS Margin & Margin Collapse Explained with Examples","Master CSS margin and margin collapse: shorthand, auto centering, negative margins, collapse rules, and fixes using flow-root, flex and gap.",[31],{"id":32,"text":33,"level":34,"children":35},"css-margin-and-margin-collapse-complete-guide-with-examples","CSS Margin and Margin Collapse: Complete Guide with Examples",2,[36,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105],{"id":37,"text":38,"level":39,"children":40},"what-you-will-learn","What You Will Learn",3,[],{"id":42,"text":43,"level":39,"children":44},"margin-longhand-properties","Margin Longhand Properties",[],{"id":46,"text":47,"level":39,"children":48},"margin-shorthand-1-2-3-and-4-values","Margin Shorthand: 1, 2, 3 and 4 Values",[],{"id":50,"text":51,"level":39,"children":52},"centering-a-block-with-margin-auto","Centering a Block with margin: auto",[],{"id":54,"text":55,"level":39,"children":56},"negative-margins","Negative Margins",[],{"id":58,"text":59,"level":39,"children":60},"percentage-margins","Percentage Margins",[],{"id":62,"text":63,"level":39,"children":64},"margin-on-inline-elements","Margin on Inline Elements",[],{"id":66,"text":67,"level":39,"children":68},"logical-margin-properties","Logical Margin Properties",[],{"id":70,"text":71,"level":39,"children":72},"what-is-margin-collapse","What Is Margin Collapse?",[],{"id":74,"text":75,"level":39,"children":76},"margin-collapse-calculation-rules","Margin Collapse Calculation Rules",[],{"id":78,"text":79,"level":39,"children":80},"the-three-types-of-margin-collapse","The Three Types of Margin Collapse",[],{"id":82,"text":83,"level":39,"children":84},"when-margins-do-not-collapse","When Margins Do NOT Collapse",[],{"id":86,"text":87,"level":39,"children":88},"how-to-fix-or-prevent-margin-collapse","How to Fix or Prevent Margin Collapse",[],{"id":90,"text":91,"level":39,"children":92},"modern-spacing-patterns-gap-and-the-stack-layout","Modern Spacing Patterns: gap and the Stack Layout",[],{"id":94,"text":95,"level":39,"children":96},"margin-vs-padding-quick-decision-guide","Margin vs Padding: Quick Decision Guide",[],{"id":98,"text":99,"level":39,"children":100},"common-mistakes","Common Mistakes",[],{"id":102,"text":103,"level":39,"children":104},"frequently-asked-questions","Frequently Asked Questions",[],{"id":106,"text":107,"level":39,"children":108},"key-takeaways","Key Takeaways",[],[110,115,118,121,124,127,130,133,136,139],{"id":111,"language":112,"code":113,"is_editable":114},297,"html","\u003Cstyle>\n.wrap { background: #f2f3f4; padding: 10px; font-family: sans-serif; }\n.b { background: #aed6f1; padding: 10px; }\n.m1 { margin: 10px; }\n.m2 { margin: 10px 40px; }\n.m3 { margin: 10px 40px 20px; }\n.m4 { margin: 5px 10px 20px 60px; }\n\u003C\u002Fstyle>\n\u003Cdiv class='wrap'>\n  \u003Cdiv class='b m1'>margin: 10px\u003C\u002Fdiv>\n  \u003Cdiv class='b m2'>margin: 10px 40px\u003C\u002Fdiv>\n  \u003Cdiv class='b m3'>margin: 10px 40px 20px\u003C\u002Fdiv>\n  \u003Cdiv class='b m4'>margin: 5px 10px 20px 60px\u003C\u002Fdiv>\n\u003C\u002Fdiv>",true,{"id":116,"language":112,"code":117,"is_editable":114},298,"\u003Cstyle>\n.container {\n  width: 300px;\n  margin: 0 auto;\n  padding: 16px;\n  background: #d5f5e3;\n  text-align: center;\n  font-family: sans-serif;\n}\n\u003C\u002Fstyle>\n\u003Cdiv class='container'>Centered with margin: 0 auto\u003C\u002Fdiv>",{"id":119,"language":112,"code":120,"is_editable":114},299,"\u003Cstyle>\n.nav { display: flex; align-items: center; gap: 12px; padding: 12px; background: #2c3e50; color: white; font-family: sans-serif; }\n.nav .push { margin-left: auto; background: #1abc9c; border: none; color: white; padding: 8px 16px; border-radius: 6px; }\n\u003C\u002Fstyle>\n\u003Cdiv class='nav'>\u003Cspan>Logo\u003C\u002Fspan>\u003Cspan>Home\u003C\u002Fspan>\u003Cspan>Blog\u003C\u002Fspan>\u003Cbutton class='push'>Sign in\u003C\u002Fbutton>\u003C\u002Fdiv>",{"id":122,"language":112,"code":123,"is_editable":114},300,"\u003Cstyle>\n.base { width: 200px; height: 80px; background: #aed6f1; padding: 10px; font-family: sans-serif; }\n.overlap { width: 200px; height: 80px; background: #f5b7b1; padding: 10px; margin-top: -40px; margin-left: 60px; font-family: sans-serif; }\n\u003C\u002Fstyle>\n\u003Cdiv class='base'>First box\u003C\u002Fdiv>\n\u003Cdiv class='overlap'>Second box pulled up with a negative margin\u003C\u002Fdiv>",{"id":125,"language":112,"code":126,"is_editable":114},301,"\u003Cstyle>\n.a { margin-bottom: 40px; background: #fadbd8; padding: 10px; font-family: sans-serif; }\n.b { margin-top: 30px; background: #d6eaf8; padding: 10px; font-family: sans-serif; }\n\u003C\u002Fstyle>\n\u003Cdiv class='a'>Box A: margin-bottom 40px\u003C\u002Fdiv>\n\u003Cdiv class='b'>Box B: margin-top 30px\u003C\u002Fdiv>\n\u003Cp style='font-family:sans-serif'>The gap between A and B is 40px, not 70px.\u003C\u002Fp>",{"id":128,"language":112,"code":129,"is_editable":114},302,"\u003Cstyle>\n.row { display: flex; gap: 20px; font-family: sans-serif; }\n.col { flex: 1; }\n.parent { background: #fcf3cf; }\n.child { margin-top: 40px; background: #f9e79f; padding: 10px; }\n.fixed { display: flow-root; }\n\u003C\u002Fstyle>\n\u003Cdiv class='row'>\n  \u003Cdiv class='col'>\n    \u003Cp>Collapsing: the margin escapes the parent\u003C\u002Fp>\n    \u003Cdiv class='parent'>\u003Cdiv class='child'>Child margin-top: 40px\u003C\u002Fdiv>\u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n  \u003Cdiv class='col'>\n    \u003Cp>Fixed with display: flow-root\u003C\u002Fp>\n    \u003Cdiv class='parent fixed'>\u003Cdiv class='child'>Child margin-top: 40px\u003C\u002Fdiv>\u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>",{"id":131,"language":112,"code":132,"is_editable":114},303,"\u003Cstyle>\n.flex { display: flex; flex-direction: column; background: #f2f3f4; font-family: sans-serif; }\n.item { margin: 20px 0; background: #abebc6; padding: 10px; }\n\u003C\u002Fstyle>\n\u003Cdiv class='flex'>\n  \u003Cdiv class='item'>Item 1 (margin 20px)\u003C\u002Fdiv>\n  \u003Cdiv class='item'>Item 2 (margin 20px)\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cp style='font-family:sans-serif'>In flex, margins do NOT collapse, so the gap is 40px.\u003C\u002Fp>",{"id":134,"language":112,"code":135,"is_editable":114},304,"\u003Cstyle>\n.grid { display: grid; gap: 16px; padding: 16px; background: #eaf2f8; font-family: sans-serif; }\n.grid div { background: #85c1e9; padding: 12px; }\n\u003C\u002Fstyle>\n\u003Cdiv class='grid'>\n  \u003Cdiv>Card 1\u003C\u002Fdiv>\n  \u003Cdiv>Card 2\u003C\u002Fdiv>\n  \u003Cdiv>Card 3\u003C\u002Fdiv>\n\u003C\u002Fdiv>",{"id":137,"language":112,"code":138,"is_editable":114},305,"\u003Cstyle>\n.stack > * + * { margin-block-start: 1rem; }\n.stack > * { background: #d2b4de; padding: 12px; font-family: sans-serif; }\n\u003C\u002Fstyle>\n\u003Cdiv class='stack'>\n  \u003Cdiv>Item one\u003C\u002Fdiv>\n  \u003Cdiv>Item two\u003C\u002Fdiv>\n  \u003Cdiv>Item three\u003C\u002Fdiv>\n\u003C\u002Fdiv>",{"id":140,"language":141,"code":142,"is_editable":114},306,"javascript","const box = document.createElement('div');\nbox.style.padding = '1px';\nconst a = document.createElement('div');\na.style.cssText = 'height:50px;margin-bottom:40px;background:#ccc;';\nconst b = document.createElement('div');\nb.style.cssText = 'height:50px;margin-top:30px;background:#999;';\nbox.append(a, b);\ndocument.body.appendChild(box);\nconst gap = b.getBoundingClientRect().top - a.getBoundingClientRect().bottom;\nconsole.log('Gap between siblings:', gap);\nbox.remove();",[144,152],{"id":145,"title":146,"slug":147,"prompt":148,"starter_code":149,"expected_output":150,"language":141,"order_index":151},121,"Compute the Collapsed Margin","compute-collapsed-margin","Write a function collapsedMargin(a, b) that returns the final vertical gap between two adjacent block siblings with margins a and b. Both positive: return the larger. Both negative: return the most negative. Mixed: return the sum.","function collapsedMargin(a, b) {\n  \u002F\u002F TODO: implement\n}\n\nconsole.log(collapsedMargin(40, 30));\nconsole.log(collapsedMargin(-20, -10));\nconsole.log(collapsedMargin(40, -10));","40\n-20\n30",1,{"id":153,"title":154,"slug":155,"prompt":156,"starter_code":157,"expected_output":158,"language":112,"order_index":34},122,"Stop the Parent from Moving","stop-parent-margin-collapse","The child margin-top escapes the parent, so the yellow parent moves down instead of the child moving inside it. Fix it with one modern CSS property on the parent. Do not add padding or border.","\u003Cstyle>\n.parent { background: #f9e79f; }\n.child { margin-top: 40px; background: #f4d03f; padding: 10px; }\n\u003C\u002Fstyle>\n\u003Cdiv class='parent'>\n  \u003Cdiv class='child'>My margin should stay inside the parent.\u003C\u002Fdiv>\n\u003C\u002Fdiv>","Add display: flow-root to .parent; the yellow background now contains the 40px space.","2026-09-30T16:55:40+00:00",{"id":161,"slug":162,"title":163},102,"css-box-model","The CSS Box Model: Content, Padding, Border and Margin",{"id":165,"slug":166,"title":167},104,"css-padding","CSS Padding: Shorthand, Percentages and Best Practices",{"data":169},[170,173,177,182,187],{"name":13,"slug":14,"description":171,"post_count":34,"subcategories":172},"Learn CSS with practical tutorials and examples covering layouts, Flexbox, Grid, responsive design, typography, positioning, animations, and more.",[],{"name":174,"slug":112,"description":175,"post_count":34,"subcategories":176},"HTML","Learn HTML with practical tutorials and examples for beginners. Explore HTML tags, elements, attributes, links, images, forms, semantic HTML, and more with clear explanations and real code examples.",[],{"name":178,"slug":179,"description":180,"post_count":151,"subcategories":181},"WPF","wpf","Learn WPF with practical tutorials and examples covering XAML, windows, controls, layouts, data binding, MVVM, commands, styles, templates, debugging, and modern WPF UI development.",[],{"name":183,"slug":184,"description":185,"post_count":151,"subcategories":186},"Python","python","Learn Python with practical tutorials covering strings, lists, functions, exceptions, files, packages, virtual environments, modules, classes, and beginner programming concepts.",[],{"name":188,"slug":189,"description":190,"post_count":151,"subcategories":191},"Java","java","Learn Java with practical tutorials and examples for beginners. Explore Java syntax, variables, data types, classes, objects, methods, inheritance, exceptions, collections, and more with clear explanations and real code examples.",[],{"data":193},[194,514],{"id":151,"name":174,"slug":195,"icon":5,"icon_url":5,"short_description":196,"meta_title":197,"meta_description":198,"og_image":199,"locale":200,"subcategories":201},"html-tutorial","Welcome to our HTML Tutorial for Beginners, a complete guide designed to help you learn HTML from the ground up.\n\nHTML, which stands for HyperText Markup Language, is the standard language used to structure content on the web. Whether you want to become a web developer, build your own website, or continue learning CSS and JavaScript, understanding HTML is an essential first step.\n\nThis HTML course takes you through the fundamentals step by step, using simple explanations and practical examples. ","HTML Tutorial for Beginners - Learn HTML Step by Step","Learn HTML from scratch with our beginner-friendly HTML tutorial. Understand HTML tags, elements, forms, tables, links, images, semantic HTML and more with practical examples.","https:\u002F\u002Fwpfsharp.com\u002Fstorage\u002Fcourses\u002Fog\u002F01M2GK0XN45C0B937NF9XFAD4S.webp","en",[202,227,262,286,362,396,410,438,462,478],{"id":151,"name":203,"slug":204,"order_index":151,"topics":205},"HTML Fundamentals & Setup","html-fundamentals-setup",[206,209,212,215,219,223],{"id":34,"title":207,"slug":208,"order_index":151,"cornerstone":25,"reading_time_minutes":34},"HTML Editors & Environment Setup","html-editors-and-environment-setup",{"id":151,"title":210,"slug":211,"order_index":151,"cornerstone":25,"reading_time_minutes":151},"HTML Introduction & History","html-introduction-and-history",{"id":39,"title":213,"slug":214,"order_index":39,"cornerstone":25,"reading_time_minutes":34},"HTML Basic Syntax & Document Structure","html-basic-syntax-document-structure",{"id":216,"title":217,"slug":218,"order_index":216,"cornerstone":25,"reading_time_minutes":34},4,"HTML Elements & Tags Explained","html-elements-tags-explained",{"id":220,"title":221,"slug":222,"order_index":220,"cornerstone":25,"reading_time_minutes":34},5,"HTML Attributes (Global & Standard)","html-attributes-global-standard",{"id":224,"title":225,"slug":226,"order_index":224,"cornerstone":25,"reading_time_minutes":34},6,"Understanding the DOCTYPE & HTML5 Boilerplate","understanding-doctype-html5-boilerplate",{"id":34,"name":228,"slug":229,"order_index":34,"topics":230},"Text & Content Basics","text-content-basics",[231,234,238,242,246,250,254,258],{"id":24,"title":232,"slug":233,"order_index":24,"cornerstone":25,"reading_time_minutes":34},"HTML Headings (H1–H6) & SEO Best Practices","html-headings-h1-h6-seo-best-practices",{"id":235,"title":236,"slug":237,"order_index":235,"cornerstone":25,"reading_time_minutes":34},8,"HTML Paragraphs & Line Breaks","html-paragraphs-line-breaks",{"id":239,"title":240,"slug":241,"order_index":239,"cornerstone":25,"reading_time_minutes":151},9,"HTML Text Formatting (Bold, Italic, Mark, etc.)","html-text-formatting-bold-italic-mark",{"id":243,"title":244,"slug":245,"order_index":243,"cornerstone":25,"reading_time_minutes":34},10,"HTML Styles (Inline CSS Basics)","html-styles-inline-css-basics",{"id":247,"title":248,"slug":249,"order_index":247,"cornerstone":25,"reading_time_minutes":34},11,"HTML Quotations & Citations (blockquote, q, cite)","html-quotations-citations-blockquote-q-cite",{"id":251,"title":252,"slug":253,"order_index":251,"cornerstone":25,"reading_time_minutes":34},12,"HTML Comments (Best Practices)","html-comments-best-practices",{"id":255,"title":256,"slug":257,"order_index":255,"cornerstone":25,"reading_time_minutes":34},13,"HTML Colors (Names, HEX, RGB, HSL)","html-colors-names-hex-rgb-hsl",{"id":259,"title":260,"slug":261,"order_index":259,"cornerstone":25,"reading_time_minutes":34},14,"HTML & CSS Integration (Inline, Internal, External)","html-css-integration-inline-internal-external",{"id":39,"name":263,"slug":264,"order_index":39,"topics":265},"Links, Media & Navigation","links-media-navigation",[266,270,274,278,282],{"id":267,"title":268,"slug":269,"order_index":267,"cornerstone":25,"reading_time_minutes":34},15,"HTML Links (Anchor Tags & Hyperlinks)","html-links-anchor-tags-hyperlinks",{"id":271,"title":272,"slug":273,"order_index":271,"cornerstone":25,"reading_time_minutes":34},16,"HTML Images (Alt Text, Lazy Loading, Formats)","html-images-alt-text-lazy-loading-formats",{"id":275,"title":276,"slug":277,"order_index":275,"cornerstone":25,"reading_time_minutes":151},17,"HTML Favicon Setup","html-favicon-setup",{"id":279,"title":280,"slug":281,"order_index":279,"cornerstone":25,"reading_time_minutes":34},18,"HTML Page Title & Meta Tags (SEO Essentials)","html-page-title-meta-tags-seo-essentials",{"id":283,"title":284,"slug":285,"order_index":283,"cornerstone":25,"reading_time_minutes":34},19,"HTML File Paths (Absolute vs Relative)","html-file-paths-absolute-vs-relative",{"id":216,"name":287,"slug":288,"order_index":216,"topics":289},"Structuring Content","structuring-content",[290,295,300,305,310,314,318,322,326,330,334,338,342,346,350,354,358],{"id":291,"title":292,"slug":293,"order_index":294,"cornerstone":25,"reading_time_minutes":34},24,"HTML Tables Explained: Rows, Columns & Merging Cells","html-tables-rows-columns-merging-cells",20,{"id":296,"title":297,"slug":298,"order_index":299,"cornerstone":25,"reading_time_minutes":34},25,"HTML Lists: Ordered, Unordered & Description Lists","html-lists-ordered-unordered-description",21,{"id":301,"title":302,"slug":303,"order_index":304,"cornerstone":25,"reading_time_minutes":34},26,"HTML Block vs Inline Elements Explained","html-block-vs-inline-elements",22,{"id":306,"title":307,"slug":308,"order_index":309,"cornerstone":25,"reading_time_minutes":151},27,"HTML Div & Span: Generic Containers Explained","html-div-and-span-containers",23,{"id":311,"title":312,"slug":313,"order_index":291,"cornerstone":25,"reading_time_minutes":34},28,"HTML Classes vs ID: Selectors Explained","html-classes-vs-id-selectors-explained",{"id":315,"title":316,"slug":317,"order_index":296,"cornerstone":25,"reading_time_minutes":151},29,"HTML Iframes: Embedding External Content","html-iframes-embedding-content",{"id":319,"title":320,"slug":321,"order_index":301,"cornerstone":25,"reading_time_minutes":34},30,"HTML Head Element Deep Dive","html-head-element-deep-dive",{"id":323,"title":324,"slug":325,"order_index":306,"cornerstone":25,"reading_time_minutes":34},31,"HTML Layout Techniques: Header, Nav & Footer","html-layout-techniques-header-nav-footer",{"id":327,"title":328,"slug":329,"order_index":311,"cornerstone":25,"reading_time_minutes":34},32,"Responsive HTML Design: Mobile-First Approach","responsive-html-design-mobile-first-approach",{"id":331,"title":332,"slug":333,"order_index":315,"cornerstone":25,"reading_time_minutes":39},74,"HTML Semantic Elements (article, section, aside, nav)","html-semantic-elements-article-section-aside-nav",{"id":335,"title":336,"slug":337,"order_index":319,"cornerstone":25,"reading_time_minutes":34},75,"HTML Style Guide & Coding Conventions","html-style-guide-coding-conventions",{"id":339,"title":340,"slug":341,"order_index":323,"cornerstone":25,"reading_time_minutes":34},76,"HTML Entities & Special Characters","html-entities-special-characters",{"id":343,"title":344,"slug":345,"order_index":327,"cornerstone":25,"reading_time_minutes":151},77,"HTML Symbols","html-symbols",{"id":347,"title":348,"slug":349,"order_index":347,"cornerstone":25,"reading_time_minutes":151},33,"HTML Emojis 😀: How to Use Them in Web Pages","html-emojis-trending-guide",{"id":351,"title":352,"slug":353,"order_index":351,"cornerstone":25,"reading_time_minutes":34},34,"HTML Character Sets: UTF-8 & Encoding Explained","html-character-sets-utf-8-encoding",{"id":355,"title":356,"slug":357,"order_index":355,"cornerstone":25,"reading_time_minutes":151},35,"HTML URL Encoding Explained","html-url-encoding-explained",{"id":359,"title":360,"slug":361,"order_index":359,"cornerstone":25,"reading_time_minutes":151},36,"HTML vs XHTML: Key Differences","html-vs-xhtml-key-differences",{"id":24,"name":363,"slug":364,"order_index":220,"topics":365},"Forms & User Input","forms-user-input",[366,371,376,381,386,391],{"id":367,"title":368,"slug":369,"order_index":370,"cornerstone":25,"reading_time_minutes":34},49,"HTML Forms Introduction","html-forms-introduction",37,{"id":372,"title":373,"slug":374,"order_index":375,"cornerstone":25,"reading_time_minutes":151},50,"HTML Form Attributes (action, method, etc.)","html-form-attributes-action-method",38,{"id":377,"title":378,"slug":379,"order_index":380,"cornerstone":25,"reading_time_minutes":151},51,"HTML Form Elements (input, select, textarea, button)","html-form-elements-input-select-textarea-button",39,{"id":382,"title":383,"slug":384,"order_index":385,"cornerstone":25,"reading_time_minutes":34},52,"HTML Input Types (Modern Types: email, date, color, range)","html-input-types-modern-email-date-color-range",40,{"id":387,"title":388,"slug":389,"order_index":390,"cornerstone":25,"reading_time_minutes":34},53,"HTML Input Attributes (required, placeholder, pattern)","html-input-attributes-required-placeholder-pattern",41,{"id":392,"title":393,"slug":394,"order_index":395,"cornerstone":25,"reading_time_minutes":34},54,"HTML Form Validation (Client-Side)","html-form-validation-client-side",42,{"id":235,"name":397,"slug":398,"order_index":224,"topics":399},"Graphics & Visuals","graphics-visuals",[400,405],{"id":401,"title":402,"slug":403,"order_index":404,"cornerstone":25,"reading_time_minutes":39},55,"HTML Canvas (2D Drawing API) 🔥","html-canvas-2d-drawing-api",43,{"id":406,"title":407,"slug":408,"order_index":409,"cornerstone":25,"reading_time_minutes":39},56,"HTML SVG (Scalable Vector Graphics)","html-svg-scalable-vector-graphics",44,{"id":239,"name":411,"slug":412,"order_index":24,"topics":413},"Multimedia","multimedia",[414,419,424,429,434],{"id":415,"title":416,"slug":417,"order_index":418,"cornerstone":25,"reading_time_minutes":34},57,"HTML Media Overview","html-media-overview",45,{"id":420,"title":421,"slug":422,"order_index":423,"cornerstone":25,"reading_time_minutes":34},58,"HTML Video Embedding (Native Player)","html-video-embedding-native-player",46,{"id":425,"title":426,"slug":427,"order_index":428,"cornerstone":25,"reading_time_minutes":34},59,"HTML Audio Embedding","html-audio-embedding",47,{"id":430,"title":431,"slug":432,"order_index":433,"cornerstone":25,"reading_time_minutes":34},60,"HTML Plug-ins (Object & Embed Tags)","html-plugins-object-embed-tags",48,{"id":435,"title":436,"slug":437,"order_index":367,"cornerstone":25,"reading_time_minutes":34},61,"Embedding YouTube Videos in HTML","embedding-youtube-videos-in-html",{"id":243,"name":439,"slug":440,"order_index":235,"topics":441},"HTML5 Web APIs (Advanced\u002FTrending)","html5-web-apis-advancedtrending",[442,446,450,454,458],{"id":443,"title":444,"slug":445,"order_index":372,"cornerstone":25,"reading_time_minutes":34},62,"HTML Geolocation API","html-geolocation-api",{"id":447,"title":448,"slug":449,"order_index":377,"cornerstone":25,"reading_time_minutes":34},63,"HTML Drag & Drop API","html-drag-and-drop-api",{"id":451,"title":452,"slug":453,"order_index":382,"cornerstone":25,"reading_time_minutes":34},64,"HTML Web Storage (localStorage & sessionStorage)","html-web-storage-localstorage-sessionstorage",{"id":455,"title":456,"slug":457,"order_index":387,"cornerstone":25,"reading_time_minutes":34},65,"HTML Web Workers (Background Processing)","html-web-workers-background-processing",{"id":459,"title":460,"slug":461,"order_index":392,"cornerstone":25,"reading_time_minutes":34},66,"HTML Server-Sent Events (SSE)","html-server-sent-events-sse",{"id":247,"name":463,"slug":464,"order_index":239,"topics":465},"Accessibility & Best Practices (High-Demand  Skill) �","accessibility-best-practices-high-demand-skill",[466,470,474],{"id":467,"title":468,"slug":469,"order_index":401,"cornerstone":25,"reading_time_minutes":34},67,"HTML Accessibility (ARIA, Screen Readers)","html-accessibility-aria-screen-readers",{"id":471,"title":472,"slug":473,"order_index":406,"cornerstone":25,"reading_time_minutes":34},68,"Writing Semantic & SEO-Friendly HTML","writing-semantic-and-seo-friendly-html",{"id":475,"title":476,"slug":477,"order_index":415,"cornerstone":25,"reading_time_minutes":34},69,"HTML Performance Optimization Basics","html-performance-optimization-basics",{"id":251,"name":479,"slug":480,"order_index":243,"topics":481},"Reference & Practice","reference-practice",[482,486,490,494,498,502,506,510],{"id":483,"title":484,"slug":485,"order_index":151,"cornerstone":25,"reading_time_minutes":34},70,"HTML Tag List (Full Reference)","html-tag-list-full-reference",{"id":487,"title":488,"slug":489,"order_index":34,"cornerstone":25,"reading_time_minutes":34},71,"HTML Global Attributes Reference","html-global-attributes-reference",{"id":491,"title":492,"slug":493,"order_index":39,"cornerstone":25,"reading_time_minutes":34},72,"HTML Events Reference","html-events-reference",{"id":495,"title":496,"slug":497,"order_index":216,"cornerstone":25,"reading_time_minutes":34},73,"HTML Browser Support & Compatibility","html-browser-support-compatibility",{"id":499,"title":500,"slug":501,"order_index":220,"cornerstone":25,"reading_time_minutes":34},78,"HTML Doctypes Reference","html-doctypes-reference",{"id":503,"title":504,"slug":505,"order_index":224,"cornerstone":25,"reading_time_minutes":34},79,"HTTP Methods & Messages (Basics for Forms\u002FAPIs)","http-methods-messages-basics",{"id":507,"title":508,"slug":509,"order_index":24,"cornerstone":25,"reading_time_minutes":39},80,"HTML Interview Preparation (Top Q&A)","html-interview-preparation-top-qa",{"id":511,"title":512,"slug":513,"order_index":235,"cornerstone":25,"reading_time_minutes":151},81,"HTML Quiz & Practice Exercises","html-quiz-practice-exercises",{"id":34,"name":13,"slug":14,"icon":5,"icon_url":5,"short_description":515,"meta_title":516,"meta_description":517,"og_image":5,"locale":200,"subcategories":518},"Master CSS from basics to advanced. Learn styling, layouts, Flexbox, Grid, and responsive design with practical examples.","CSS Course - Learn CSS from Scratch to Advanced","Learn CSS (Cascading Style Sheets) step by step. Master selectors, layouts, Flexbox, Grid, animations, and responsive web design with hands-on examples.",[519,548,572,608,640,661,693,723,751,779],{"id":309,"name":520,"slug":521,"order_index":522,"topics":523},"UI Components","ui-components",0,[524,528,532,536,540,544],{"id":525,"title":526,"slug":527,"order_index":435,"cornerstone":25,"reading_time_minutes":224},148,"CSS Buttons: Variants, States, Sizes and Accessible Button Design","css-buttons",{"id":529,"title":530,"slug":531,"order_index":443,"cornerstone":25,"reading_time_minutes":224},149,"CSS Card Component: Layouts with Flexbox, Grid, Container Queries and Subgrid","css-cards",{"id":533,"title":534,"slug":535,"order_index":447,"cornerstone":25,"reading_time_minutes":24},150,"CSS Navbar and Dropdown Menus: Responsive, Sticky and Accessible Navigation","css-navbar-dropdowns",{"id":537,"title":538,"slug":539,"order_index":451,"cornerstone":25,"reading_time_minutes":224},151,"HTML and CSS Forms and Inputs: Styled, Accessible and Validated Form Controls","css-forms-inputs",{"id":541,"title":542,"slug":543,"order_index":455,"cornerstone":25,"reading_time_minutes":224},152,"CSS Tooltips and Popovers: Popover API, Anchor Positioning and Accessible Overlays","css-tooltips-popovers",{"id":545,"title":546,"slug":547,"order_index":459,"cornerstone":25,"reading_time_minutes":224},153,"Pagination and Breadcrumbs: Accessible Navigation Patterns with HTML, CSS and Schema","pagination-breadcrumbs",{"id":255,"name":549,"slug":550,"order_index":522,"topics":551},"CSS Fundamentals & Setup","css-fundamentals-setup",[552,556,560,564,568],{"id":553,"title":554,"slug":555,"order_index":151,"cornerstone":25,"reading_time_minutes":216},82,"CSS Introduction & History: What Is CSS and Why It Matters","css-introduction-and-history",{"id":557,"title":558,"slug":559,"order_index":34,"cornerstone":25,"reading_time_minutes":216},83,"CSS Syntax & How Browsers Apply Styles","css-syntax-how-browsers-apply-styles",{"id":561,"title":562,"slug":563,"order_index":39,"cornerstone":25,"reading_time_minutes":39},84,"Setting Up Your CSS Workspace: Linking Files & Live Server","setting-up-css-workspace-linking-files-live-server",{"id":565,"title":566,"slug":567,"order_index":216,"cornerstone":25,"reading_time_minutes":39},85,"CSS Comments & Code Formatting Best Practices","css-comments-and-code-formatting",{"id":569,"title":570,"slug":571,"order_index":220,"cornerstone":25,"reading_time_minutes":220},86,"Browser DevTools for CSS: Inspect, Debug & Edit Styles Live","browser-devtools-for-css",{"id":259,"name":573,"slug":574,"order_index":522,"topics":575},"Selectors & the Cascade","selectors-the-cascade",[576,580,584,588,592,596,600,604],{"id":577,"title":578,"slug":579,"order_index":224,"cornerstone":25,"reading_time_minutes":216},87,"CSS Basic Selectors: Type, Class, ID, Universal & Grouping","css-basic-selectors",{"id":581,"title":582,"slug":583,"order_index":24,"cornerstone":25,"reading_time_minutes":216},88,"CSS Combinators: Descendant, Child, Adjacent & General Sibling","css-combinators",{"id":585,"title":586,"slug":587,"order_index":235,"cornerstone":25,"reading_time_minutes":216},89,"CSS Attribute Selectors: [attr], ^=, $=, *= and More","css-attribute-selectors",{"id":589,"title":590,"slug":591,"order_index":239,"cornerstone":25,"reading_time_minutes":224},90,"CSS Pseudo-classes: :hover, :focus, :nth-child & Modern Selectors","css-pseudo-classes",{"id":593,"title":594,"slug":595,"order_index":243,"cornerstone":25,"reading_time_minutes":220},91,"CSS Pseudo-elements (::before, ::after)","css-pseudo-elements-before-after",{"id":597,"title":598,"slug":599,"order_index":247,"cornerstone":25,"reading_time_minutes":220},92,"Modern CSS Selectors: :is(), :where(), :has()","modern-css-selectors-is-where-has",{"id":601,"title":602,"slug":603,"order_index":251,"cornerstone":25,"reading_time_minutes":216},93,"CSS Specificity Explained","css-specificity-explained",{"id":605,"title":606,"slug":607,"order_index":255,"cornerstone":25,"reading_time_minutes":220},94,"Cascade, Inheritance & !important","css-cascade-inheritance-important",{"id":267,"name":609,"slug":610,"order_index":522,"topics":611},"Colors, Backgrounds & Effects","colors-backgrounds-effects",[612,616,620,624,628,632,636],{"id":613,"title":614,"slug":615,"order_index":259,"cornerstone":25,"reading_time_minutes":220},95,"CSS Colors (HEX, RGB, HSL, OKLCH)","css-colors-hex-rgb-hsl-oklch",{"id":617,"title":618,"slug":619,"order_index":267,"cornerstone":25,"reading_time_minutes":216},96,"CSS Backgrounds","css-backgrounds",{"id":621,"title":622,"slug":623,"order_index":271,"cornerstone":25,"reading_time_minutes":220},97,"CSS Gradients (Linear, Radial, Conic)","css-gradients-linear-radial-conic",{"id":625,"title":626,"slug":627,"order_index":275,"cornerstone":25,"reading_time_minutes":220},98,"CSS Borders, Outlines & Rounded Corners","css-borders-outlines-rounded-corners",{"id":629,"title":630,"slug":631,"order_index":279,"cornerstone":25,"reading_time_minutes":224},99,"CSS Box Shadow & Text Shadow","css-box-shadow-text-shadow",{"id":633,"title":634,"slug":635,"order_index":283,"cornerstone":25,"reading_time_minutes":220},100,"CSS Opacity & Blend Modes","css-opacity-blend-modes",{"id":637,"title":638,"slug":639,"order_index":294,"cornerstone":25,"reading_time_minutes":224},101,"CSS Filters & backdrop-filter (Glassmorphism)","css-filters-backdrop-filter-glassmorphism",{"id":271,"name":16,"slug":17,"order_index":522,"topics":641},[642,643,644,645,649,653,657],{"id":161,"title":163,"slug":162,"order_index":299,"cornerstone":25,"reading_time_minutes":24},{"id":8,"title":9,"slug":10,"order_index":304,"cornerstone":25,"reading_time_minutes":24},{"id":165,"title":167,"slug":166,"order_index":309,"cornerstone":25,"reading_time_minutes":224},{"id":646,"title":647,"slug":648,"order_index":291,"cornerstone":25,"reading_time_minutes":239},105,"CSS Width, Height, Min-Width, Max-Width, Min-Height & Max-Height","css-width-height-min-max",{"id":650,"title":651,"slug":652,"order_index":296,"cornerstone":25,"reading_time_minutes":220},106,"CSS box-sizing: content-box vs border-box","css-box-sizing",{"id":654,"title":655,"slug":656,"order_index":301,"cornerstone":25,"reading_time_minutes":24},107,"CSS Overflow: hidden, scroll, auto, clip and Text Truncation","css-overflow",{"id":658,"title":659,"slug":660,"order_index":306,"cornerstone":25,"reading_time_minutes":24},108,"CSS Units: px, rem, em, %, vw, vh and dvh","css-units",{"id":275,"name":662,"slug":663,"order_index":522,"topics":664},"Typography & Text","typography-text",[665,669,673,677,681,685,689],{"id":666,"title":667,"slug":668,"order_index":311,"cornerstone":25,"reading_time_minutes":24},109,"CSS Text Properties: Alignment, Spacing, Decoration and Wrapping","css-text-properties",{"id":670,"title":671,"slug":672,"order_index":315,"cornerstone":25,"reading_time_minutes":24},110,"CSS Fonts and font-family: Font Stacks, Weights and System Fonts","css-fonts-font-family",{"id":674,"title":675,"slug":676,"order_index":319,"cornerstone":25,"reading_time_minutes":24},111,"Web Fonts: Google Fonts, @font-face and Variable Fonts","web-fonts",{"id":678,"title":679,"slug":680,"order_index":323,"cornerstone":25,"reading_time_minutes":24},112,"CSS Text Effects: text-wrap balance, line-clamp, Ellipsis and More","css-text-effects",{"id":682,"title":683,"slug":684,"order_index":327,"cornerstone":25,"reading_time_minutes":235},113,"Styling Links","styling-links-css",{"id":686,"title":687,"slug":688,"order_index":347,"cornerstone":25,"reading_time_minutes":24},114,"Styling Lists & Tables","styling-lists-and-tables-css",{"id":690,"title":691,"slug":692,"order_index":351,"cornerstone":25,"reading_time_minutes":243},115,"Icons (SVG & Icon Fonts)","icons-svg-and-icon-fonts",{"id":279,"name":694,"slug":695,"order_index":522,"topics":696},"Display, Position & Layout Basics","display-position-layout-basics",[697,701,705,709,713,717,720],{"id":698,"title":699,"slug":700,"order_index":355,"cornerstone":25,"reading_time_minutes":24},116,"Display & Inline-block","display-and-inline-block",{"id":702,"title":703,"slug":704,"order_index":359,"cornerstone":25,"reading_time_minutes":224},117,"Position (relative, absolute, fixed, sticky)","position-relative-absolute-fixed-sticky",{"id":706,"title":707,"slug":708,"order_index":370,"cornerstone":25,"reading_time_minutes":224},118,"Z-index & Stacking Contexts","z-index-and-stacking-contexts",{"id":710,"title":711,"slug":712,"order_index":375,"cornerstone":25,"reading_time_minutes":220},119,"Float & Clear (Legacy, and Why to Avoid It)","float-and-clear",{"id":714,"title":715,"slug":716,"order_index":380,"cornerstone":25,"reading_time_minutes":224},120,"Centering Techniques","centering-techniques",{"id":145,"title":718,"slug":719,"order_index":385,"cornerstone":25,"reading_time_minutes":24},"aspect-ratio & object-fit","aspect-ratio-and-object-fit",{"id":153,"title":721,"slug":722,"order_index":390,"cornerstone":25,"reading_time_minutes":235},"Website Layout Basics","website-layout-basics",{"id":294,"name":724,"slug":725,"order_index":522,"topics":726},"The Modern CSS Toolkit","the-modern-css-toolkit",[727,731,735,739,743,747],{"id":728,"title":729,"slug":730,"order_index":395,"cornerstone":25,"reading_time_minutes":235},129,"CSS Variables (Custom Properties)","css-variables-custom-properties",{"id":732,"title":733,"slug":734,"order_index":404,"cornerstone":25,"reading_time_minutes":235},130,"Math Functions (calc, min, max, clamp)","math-functions-calc-min-max-clamp",{"id":736,"title":737,"slug":738,"order_index":409,"cornerstone":25,"reading_time_minutes":24},131,"Native CSS Nesting","native-css-nesting",{"id":740,"title":741,"slug":742,"order_index":418,"cornerstone":25,"reading_time_minutes":24},132,"Cascade Layers (@layer)","cascade-layers-at-layer",{"id":744,"title":745,"slug":746,"order_index":423,"cornerstone":25,"reading_time_minutes":239},133,"Dark Mode (prefers-color-scheme, light-dark())","dark-mode-prefers-color-scheme-light-dark",{"id":748,"title":749,"slug":750,"order_index":428,"cornerstone":25,"reading_time_minutes":235},134,"CSS Reset & Normalize","css-reset-and-normalize",{"id":299,"name":752,"slug":753,"order_index":522,"topics":754},"Responsive Design","responsive-design",[755,759,763,767,771,775],{"id":756,"title":757,"slug":758,"order_index":433,"cornerstone":25,"reading_time_minutes":239},135,"Mobile-First & the Viewport","mobile-first-and-the-viewport",{"id":760,"title":761,"slug":762,"order_index":367,"cornerstone":25,"reading_time_minutes":235},136,"Media Queries","media-queries",{"id":764,"title":765,"slug":766,"order_index":372,"cornerstone":25,"reading_time_minutes":235},137,"Responsive Images & Video","responsive-images-and-video",{"id":768,"title":769,"slug":770,"order_index":377,"cornerstone":25,"reading_time_minutes":239},138,"Fluid Typography with clamp()","fluid-typography-with-clamp",{"id":772,"title":773,"slug":774,"order_index":382,"cornerstone":25,"reading_time_minutes":239},139,"Container Queries","container-queries",{"id":776,"title":777,"slug":778,"order_index":387,"cornerstone":25,"reading_time_minutes":251},140,"Responsive Navigation Pattern","responsive-navigation-pattern",{"id":304,"name":780,"slug":781,"order_index":522,"topics":782},"Transitions & Animation","transitions-animation",[783,787,791,795,799,803,807],{"id":784,"title":785,"slug":786,"order_index":392,"cornerstone":25,"reading_time_minutes":220},141,"CSS Transitions: Smooth State Changes with transition, @starting-style and allow-discrete","css-transitions",{"id":788,"title":789,"slug":790,"order_index":401,"cornerstone":25,"reading_time_minutes":216},142,"CSS 2D Transforms: translate, rotate, scale, skew and transform-origin","css-2d-transforms",{"id":792,"title":793,"slug":794,"order_index":406,"cornerstone":25,"reading_time_minutes":220},143,"CSS 3D Transforms: perspective, preserve-3d, rotateX\u002FY and backface-visibility","css-3d-transforms",{"id":796,"title":797,"slug":798,"order_index":415,"cornerstone":25,"reading_time_minutes":220},144,"CSS Keyframe Animations: @keyframes, animation shorthand, fill-mode and @property","css-keyframe-animations",{"id":800,"title":801,"slug":802,"order_index":420,"cornerstone":25,"reading_time_minutes":220},145,"CSS Scroll-Driven Animations: animation-timeline, scroll() and view()","css-scroll-driven-animations",{"id":804,"title":805,"slug":806,"order_index":425,"cornerstone":25,"reading_time_minutes":220},146,"CSS View Transitions API: Progressive Enhancement for Page and State Animations","css-view-transitions",{"id":808,"title":809,"slug":810,"order_index":430,"cornerstone":25,"reading_time_minutes":224},147,"Motion Accessibility and Performance: prefers-reduced-motion, will-change and Smooth 60fps Animations","motion-accessibility-prefers-reduced-motion-performance"]