{"id":104,"date":"2026-04-07T01:27:09","date_gmt":"2026-04-07T01:27:09","guid":{"rendered":"https:\/\/gigz.pk\/css\/?post_type=lesson&#038;p=104"},"modified":"2026-04-07T01:27:10","modified_gmt":"2026-04-07T01:27:10","slug":"display-types-block-inline-inline-block","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/","title":{"rendered":"Display Types Block Inline Inline Block"},"content":{"rendered":"\n<p>Display Types in CSS<\/p>\n\n\n\n<p>In CSS, the display property controls how elements appear and behave on a web page. Understanding display types is essential for creating proper layouts and designing responsive websites.<\/p>\n\n\n\n<p>Block Display<\/p>\n\n\n\n<p>A block element takes up the full width available and always starts on a new line. This means each block element appears below the previous one.<\/p>\n\n\n\n<p>Common block elements include div, p, h1 to h6, and section.<\/p>\n\n\n\n<p>Key features of block elements<br>They take full width of the parent container<br>They always start on a new line<br>You can set width height margin and padding<\/p>\n\n\n\n<p>Example<br>div {<br>display: block;<br>}<\/p>\n\n\n\n<p>Inline Display<\/p>\n\n\n\n<p>Inline elements only take up as much width as their content requires. They do not start on a new line and appear side by side.<\/p>\n\n\n\n<p>Common inline elements include span, a, strong, and em.<\/p>\n\n\n\n<p>Key features of inline elements<br>They do not start on a new line<br>Width and height cannot be applied properly<br>Margin and padding work only horizontally<\/p>\n\n\n\n<p>Example<br>span {<br>display: inline;<br>}<\/p>\n\n\n\n<p>Inline Block Display<\/p>\n\n\n\n<p>Inline block is a combination of both block and inline. Elements stay in line but can have width height margin and padding like block elements.<\/p>\n\n\n\n<p>Key features of inline block elements<br>They do not start on a new line<br>You can set width and height<br>Margin and padding work on all sides<\/p>\n\n\n\n<p>Example<br>div {<br>display: inline-block;<br>width: 150px;<br>height: 100px;<br>}<\/p>\n\n\n\n<p>When to Use Each Display Type<\/p>\n\n\n\n<p>Use block when you want elements to stack vertically and take full width<\/p>\n\n\n\n<p>Use inline when you want elements to flow within text without breaking the line<\/p>\n\n\n\n<p>Use inline block when you need elements side by side but still want to control their size and spacing<\/p>\n\n\n\n<p>Conclusion<\/p>\n\n\n\n<p>Understanding block inline and inline block display types helps you control layout and structure in CSS. These concepts are the foundation of modern web design and are important for beginners to master before moving to advanced layout techniques like Flexbox and Grid.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"menu_order":0,"template":"","class_list":["post-104","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Display Types Block Inline Inline Block - CSS learning mastery<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Display Types Block Inline Inline Block - CSS learning mastery\" \/>\n<meta property=\"og:description\" content=\"Display Types in CSS In CSS, the display property controls how elements appear and behave on a web page. Understanding display types is essential for creating proper layouts and designing responsive websites. Block Display A block element takes up the full width available and always starts on a new line. This means each block element [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/\" \/>\n<meta property=\"og:site_name\" content=\"CSS learning mastery\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-07T01:27:10+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/display-types-block-inline-inline-block\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/display-types-block-inline-inline-block\\\/\",\"name\":\"Display Types Block Inline Inline Block - CSS learning mastery\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\"},\"datePublished\":\"2026-04-07T01:27:09+00:00\",\"dateModified\":\"2026-04-07T01:27:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/display-types-block-inline-inline-block\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/display-types-block-inline-inline-block\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/display-types-block-inline-inline-block\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Display Types Block Inline Inline Block\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\",\"name\":\"CSS learning mastery\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/css\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Display Types Block Inline Inline Block - CSS learning mastery","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/","og_locale":"en_US","og_type":"article","og_title":"Display Types Block Inline Inline Block - CSS learning mastery","og_description":"Display Types in CSS In CSS, the display property controls how elements appear and behave on a web page. Understanding display types is essential for creating proper layouts and designing responsive websites. Block Display A block element takes up the full width available and always starts on a new line. This means each block element [&hellip;]","og_url":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/","og_site_name":"CSS learning mastery","article_modified_time":"2026-04-07T01:27:10+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/","url":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/","name":"Display Types Block Inline Inline Block - CSS learning mastery","isPartOf":{"@id":"https:\/\/gigz.pk\/css\/#website"},"datePublished":"2026-04-07T01:27:09+00:00","dateModified":"2026-04-07T01:27:10+00:00","breadcrumb":{"@id":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/css\/lesson\/display-types-block-inline-inline-block\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/css\/"},{"@type":"ListItem","position":2,"name":"Display Types Block Inline Inline Block"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/css\/#website","url":"https:\/\/gigz.pk\/css\/","name":"CSS learning mastery","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/css\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/lesson\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/media?parent=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}