{"id":140,"date":"2026-04-07T04:36:17","date_gmt":"2026-04-07T04:36:17","guid":{"rendered":"https:\/\/gigz.pk\/css\/?post_type=lesson&#038;p=140"},"modified":"2026-04-07T04:36:18","modified_gmt":"2026-04-07T04:36:18","slug":"cards-and-containers","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/","title":{"rendered":"Cards and Containers"},"content":{"rendered":"\n<p>Introduction<br>Cards and containers are essential parts of modern web design. They help organize content, improve layout, and make websites visually appealing. Understanding how to use them properly is important for every beginner in CSS.<\/p>\n\n\n\n<p>What is a Container<br>A container is a layout element that holds other elements such as text, images, buttons, or cards. It helps control the width, alignment, and spacing of content on a webpage.<\/p>\n\n\n\n<p>Purpose of Containers<br>Containers keep content structured and centered on the page<br>They control the maximum width of content<br>They create consistent spacing and alignment<br>They improve readability on different screen sizes<\/p>\n\n\n\n<p>Basic Container Example<br>.container {<br>width: 80 percent<br>margin: auto<br>}<\/p>\n\n\n\n<p>What is a Card<br>A card is a small box used to display information in a clean and organized way. Cards are commonly used for products, profiles, blog posts, and services.<\/p>\n\n\n\n<p>Purpose of Cards<br>Cards group related information together<br>They make content easy to scan<br>They improve visual design and user experience<br>They can include images, text, and buttons<\/p>\n\n\n\n<p>Basic Card Example<br>.card {<br>border: 1px solid lightgray<br>padding: 20px<br>margin: 10px<br>border radius: 8px<br>}<\/p>\n\n\n\n<p>.card h3 {<br>margin bottom: 10px<br>}<\/p>\n\n\n\n<p>.card p {<br>font size: 14px<br>}<\/p>\n\n\n\n<p>Combining Cards with Containers<br>Containers are used to hold multiple cards in a structured layout. Cards can be arranged in rows using flexbox or grid.<\/p>\n\n\n\n<p>Example Layout<br>.container {<br>display: flex<br>gap: 20px<br>}<\/p>\n\n\n\n<p>.card {<br>width: 200px<br>}<\/p>\n\n\n\n<p>Best Practices<br>Keep card design simple and consistent<br>Use enough spacing between cards<br>Make cards responsive for mobile devices<br>Use clear headings and readable text<br>Avoid too much content inside a single card<\/p>\n\n\n\n<p>Conclusion<br>Cards and containers are powerful tools in web design. Containers manage layout while cards present content in a clean and structured way. Mastering both will help you build modern and professional websites.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"menu_order":0,"template":"","class_list":["post-140","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>Cards and Containers - 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\/cards-and-containers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cards and Containers - CSS learning mastery\" \/>\n<meta property=\"og:description\" content=\"IntroductionCards and containers are essential parts of modern web design. They help organize content, improve layout, and make websites visually appealing. Understanding how to use them properly is important for every beginner in CSS. What is a ContainerA container is a layout element that holds other elements such as text, images, buttons, or cards. It [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/\" \/>\n<meta property=\"og:site_name\" content=\"CSS learning mastery\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-07T04:36:18+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\\\/cards-and-containers\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/cards-and-containers\\\/\",\"name\":\"Cards and Containers - CSS learning mastery\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\"},\"datePublished\":\"2026-04-07T04:36:17+00:00\",\"dateModified\":\"2026-04-07T04:36:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/cards-and-containers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/cards-and-containers\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/cards-and-containers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cards and Containers\"}]},{\"@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":"Cards and Containers - 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\/cards-and-containers\/","og_locale":"en_US","og_type":"article","og_title":"Cards and Containers - CSS learning mastery","og_description":"IntroductionCards and containers are essential parts of modern web design. They help organize content, improve layout, and make websites visually appealing. Understanding how to use them properly is important for every beginner in CSS. What is a ContainerA container is a layout element that holds other elements such as text, images, buttons, or cards. It [&hellip;]","og_url":"https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/","og_site_name":"CSS learning mastery","article_modified_time":"2026-04-07T04:36:18+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\/cards-and-containers\/","url":"https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/","name":"Cards and Containers - CSS learning mastery","isPartOf":{"@id":"https:\/\/gigz.pk\/css\/#website"},"datePublished":"2026-04-07T04:36:17+00:00","dateModified":"2026-04-07T04:36:18+00:00","breadcrumb":{"@id":"https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/css\/lesson\/cards-and-containers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/css\/"},{"@type":"ListItem","position":2,"name":"Cards and Containers"}]},{"@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\/140","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=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}