[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-701112-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-701112-en":130,"doc-similar-701112":196},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","understanding-flexbox-css-flexbox-basics-and-layout-building","Understanding Flexbox - CSS Flexbox Basics and Layout Building","","A practical introduction to the CSS Flexbox model, explaining why modern flex layouts matter and how they replace older float- and table-based hacks. The document walks through the learning path from fundamentals to flex-container and flex-item concepts, including alignment, absolute/relative behavior, and switching flex direction. It also demonstrates building a music app layout, emphasizing responsive design and concluding with key takeaways for using Flexbox effectively.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/understanding-flexbox-css-flexbox-basics-and-layout-building/701112/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/understanding-flexbox-css-flexbox-basics-and-layout-building/701112.png","ImageObject",300,407,{"name":42,"@type":43},"Nguyễn Văn Học","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-16","2026-11-12",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"Why do designers and developers choose Flexbox over older CSS layout techniques?","Question",{"text":62,"@type":63},"Flexbox provides a modern, cleaner syntax for intelligent layouts. It helps eliminate the heavy reliance on floats and table-cell display hacks, making layouts more consistent and maintainable.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How do you start using the Flexbox model in CSS?",{"text":67,"@type":63},"First define a parent element as a flex container by setting display: flex or display: inline-flex. This immediately initiates a Flexbox formatting context.",{"name":69,"@type":60,"acceptedAnswer":70},"What will you be able to build after learning the basics?",{"text":71,"@type":63},"You will progress from Flexbox fundamentals to applying them to real-world app layouts. A full example mentioned is building a music app layout with responsive design.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},701112,1794523515,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":145,"preview_urls":146},1374402739827,"https://ap-avatar.wpscdn.com/avatar/14000c97e7351f1a627?x-image-process=image/resize,m_fixed,w_180,h_180&k=1787885694763230660","Table of Contents  \nGetting Started  \nIntroduction  \nFlex-container properties  \nFlex-item Properties  \nAbsolute and Relative Flex  \nAuto-margin alignment  \nSwitching Flex Direction  \nFlexbox Solved That  \nBuilding a Music App Layout  \nResponsive Design  \nConclusion  \nGetting Started  \nStarting Off  \nNo one can fit everything there is to a subject within one book, and even if such person existed, it isn’t me.  \nStill, I’d take on the challenge to discuss “almost everything” you need to get good with the CSS Flexbox model. I hope you’re ready for it.  \nThe Learning Curve  \nHere is a tweet from Philip Roberts, a developer whom I respect very much:  \nLearning Flexbox may not be fun at first. It challenges what you know  \nabout layouts in CSS. But that’s fine. Everything worth learning begins that way.  \nFlexbox is certainly something you should take seriously. It paves the way for the modern style of laying out content, and it’s not going away anytime soon.  \nIt has emerged as a new standard. So with outstretched arms, embrace it!  \nWhat you will Learn  \nI’ll first walk you through the basics of Flexbox. I believe any attempt at understanding Flexbox must begin here.  \nFlexbox fundamentals  \nLearning the fundamentals is cool. What’s even cooler is applying these fundamentals to build real-world apps.  \nI will walk you through building a lot of “small things”. Afterwards, I will wrap things up with this music app completely laid out with Flexbox.  \nMusic app layout  \nDoesn’t that look pretty?  \nI’ll get into the inner workings of Flexbox while you learn to build the music app layout. You’ll also get a feel for the role Flexbox plays in responsive web design, too.  \nI’m pretty much excited to show all of this to you.  \nVery delighted :-)  \nBut before you get started building user interfaces, I’m going to walk you through some drills, first. This may seem boring, but it’s all part of the process of getting you adept at Flexbox.  \nLet’s get started.  \nIntroduction  \nLearning Flexbox can be a pain in the butt. For most persons, it’s not particularly fun at first. It challenges you to rethink how you’ve dealt with layouts in css.  \nDon’t fret. I will really walk you through all you need to know. That’s the aim of this book.  \nWhy Use Flexbox?  \nCSS has evolved a lot over the past few years. Designers loved the introduction of filters, transitions, and transforms. But something was missing. Something we all craved.  \nCrafting Intelligent page layouts with CSS seemed to have persisted for too long, and this got many of us writing hacky CSS.  \nWe always had to deal with floats, table display hacks, and the consequences they brought. If you’ve written CSS for sometime, you can probably relate to this. And if not, welcome to a better world!  \nIt seems like our prayers as designers and front-end developers have finally been heard. This time, in grand style.  \nNow we can all ditch those hacky CSS tricks. No more incessant use of floats, table-cell displays.  \nIt’s time to embrace a cleaner modern syntax for crafting intelligent layouts. Welcome the CSS Flexbox model.  \nWhat Is Flexbox?  \nAccording to the specification, the Flexbox model provides for an efficient way to layout, align, and distribute space among elements within your document-even when the viewport and the size of your elements is unknown and/or dynamic.  \nIf that sound too formal, I understand the feeling. In just a bit, I’ll explain what that means in “English”.  \nWhether you write CSS in your dreams or you’re just getting started, you’ll feel right at home.  \nHow do I start using the Flexbox model?  \nThis is the first question everyone asks, and the answer is much simpler than you may have expected.  \nTo start using the Flexbox model, all you need to do is first define aflex-container.  \nOkay, did I make you more confused there? Let me explain.  \nIn regular html, laying out a simple list of items takes this form:  \n\u003Cul> \u003C!--parent element-->  \n\u003Cli>\u003C/li> \u003C!--first child elemen","cbCaitRdCJ6JgjOW","https://ap.wps.com/l/cbCaitRdCJ6JgjOW","pdf",3915214,111,"English","# Getting Started\n## Introduction\n## Flex-container properties\n## Flex-item Properties\n## Absolute and Relative Flex\n## Auto-margin alignment\n## Switching Flex Direction\n## Flexbox Solved That\n## Building a Music App Layout\n## Responsive Design\n# Conclusion","[{\"question\":\"Why do designers and developers choose Flexbox over older CSS layout techniques?\",\"answer\":\"Flexbox provides a modern, cleaner syntax for intelligent layouts. It helps eliminate the heavy reliance on floats and table-cell display hacks, making layouts more consistent and maintainable.\"},{\"question\":\"How do you start using the Flexbox model in CSS?\",\"answer\":\"First define a parent element as a flex container by setting display: flex or display: inline-flex. This immediately initiates a Flexbox formatting context.\"},{\"question\":\"What will you be able to build after learning the basics?\",\"answer\":\"You will progress from Flexbox fundamentals to applying them to real-world app layouts. A full example mentioned is building a music app layout with responsive design.\"}]","Understanding Flexbox - CSS Flexbox Basics and Layout Building | PDF",280,12,[147,151,155,159,163,167,171,175,179,183,187,192],{"page_no":22,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/ddfbca4b30a4332977e0274e01338d50.webp",983,1390,{"page_no":26,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/4292afe267b3f8c97550078f675258cf.webp",982,1388,{"page_no":30,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/e6e7e28192eee43b24433b8b334e1735.webp",981,1387,{"page_no":33,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/2e1b832ef718741eb66c7df6f6a657c6.webp",980,1385,{"page_no":96,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/369ac8163ed012e53ee93362812cbe3e.webp",979,1384,{"page_no":101,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/7f24577d556eb077d395d629a4501eed.webp",978,1383,{"page_no":105,"url":172,"width":173,"height":174},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/7eefcddc67437c70da2122cd0a3da18c.webp",977,1381,{"page_no":110,"url":176,"width":177,"height":178},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/4b2fc9818c7525412015404bbbe59d1b.webp",976,1380,{"page_no":115,"url":180,"width":181,"height":182},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/04b659fdbc5efe5eafe1e8f7a286865a.webp",975,1378,{"page_no":123,"url":184,"width":185,"height":186},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/e766405a6b53ea27a3f828069ce9fe46.webp",974,1377,{"page_no":188,"url":189,"width":190,"height":191},11,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/ad73dd7ec241bb781b6f25771f959011.webp",973,1376,{"page_no":145,"url":193,"width":194,"height":195},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/00ca28cc2ad68f581303255c6deded6b.webp",972,1374,{"list":197,"token":11},[198,204,210,216,222,228,234,240,247,253],{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":30,"category_name":29,"create_tm":203},701114,"Introducing CSS Flexbox Layout - read online free","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012050525/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=OWoxLwwyBiQqnBHtszw9vqI%2F4g8%3D","introducing-css-flexbox-layout-read-online-free",1794523525,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":96,"category_name":29,"create_tm":209},701117,"Flexbox in CSS - O’Reilly Media Book","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011579048/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=jmyboSYtZxmJvY%2FrSa1tWOyEiT0%3D","flexbox-in-css-oreilly-media-book",1794523532,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":33,"category_name":29,"create_tm":215},701113,"A Complete Guide to Flexbox - CSS flexbox properties","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012050504/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=%2BZzYcQYcCfyBckepTJFAXnWtIMA%3D","a-complete-guide-to-flexbox-css-flexbox-properties",1794523516,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":30,"category_name":29,"create_tm":221},685713,"Bootstrap - Tutorial 7","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000181970/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=UA8qPr1CiaCZml6HoW81jrQNgZM%3D","bootstrap-tutorial-7",1794016942,{"doc_id":223,"doc_title":224,"file_type":137,"home_preview_img_url":225,"slug":226,"view_count":101,"category_name":29,"create_tm":227},703161,"Cascading Style Sheets (CSS) Course Syllabus","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013426121/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=2Vn3ns5i8km0absXfaNylK%2F%2B3Fk%3D","cascading-style-sheets-css-course-syllabus",1794561905,{"doc_id":229,"doc_title":230,"file_type":137,"home_preview_img_url":231,"slug":232,"view_count":96,"category_name":29,"create_tm":233},693034,"CSS Handbook","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005053838/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=7opr9xAeASXho78R5ySkBC1eakw%3D","css-handbook",1794246437,{"doc_id":235,"doc_title":236,"file_type":137,"home_preview_img_url":237,"slug":238,"view_count":105,"category_name":29,"create_tm":239},703160,"CSS in Depth - Second Edition - comprehensive CSS learning guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013426146/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=Wn%2BMknCXiWcJg2CzPYbhzo%2BvuIM%3D","css-in-depth-second-edition-comprehensive-css-learning-guide",1794561904,{"doc_id":241,"doc_title":242,"file_type":137,"home_preview_img_url":243,"slug":244,"view_count":245,"category_name":29,"create_tm":246},116284,"CSS Master - 3rd Edition - A guide to CSS mastery","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834220651/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=9u1d0VSIDrjP13f%2FmMoZEMFxxIg%3D","css-master-3rd-edition-a-guide-to-css-mastery",22,1785657984,{"doc_id":248,"doc_title":249,"file_type":137,"home_preview_img_url":250,"slug":251,"view_count":33,"category_name":29,"create_tm":252},701118,"CS193X: Web Programming Fundamentals - Lecture 5 - Spring 2017","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011579050/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=4C66mFfrmXQz2yjOdXVH98eLEdE%3D","cs193x-web-programming-fundamentals-lecture-5-spring-2017",1794523552,{"doc_id":254,"doc_title":255,"file_type":137,"home_preview_img_url":256,"slug":257,"view_count":96,"category_name":29,"create_tm":258},693042,"CSS - Quick Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005053987/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=yzT1KlNsZ1%2BYO39P8C8ZC2a%2B8Lo%3D","css-quick-guide",1794246459]