Automatically translated.View original post

css flex box

# Website Basics

# Flexbox

CSS Flexbox is a one-dimensional layout system of CSS that allows developers to place elements on web pages flexibly and efficiently, focusing on a single vertical or axial arrangement (rows or columns), making it easier to control the distribution, alignment, and scaling of sub-elements (Flex Items) to fit free space in a container (Flex Container), suitable for creating a Responsive website that modifies the screen size.

The main concept of Flexbox

Flex Containers:

is the main element that is the container for storing subelements. You will define this element as Flexbox with the display feature: flex;.

Flex Items:

The child elements inside the Flex Container. Flexbox controls the arrangement, scaling, and space distribution of these elements.

Main features and benefits of Flexbox

Single-dimensional arrangement:

Designed to sort items vertically or with a single major axis (main axis), which may be rows or columns.

Scaling flexibility:

Allows the sub-elements to automatically resize to fit the changing space.

Effective alignment:

The alignment of the sub-elements in both the main axis (main axis) and the cross axis (cross axis) is precisely controlled.

Free space management:

It has the property of helping to distribute free space between subelements in a balanced way.

Responsive website creation:

This makes the design of the modified layout of the devices (Responsive Design) easier and faster.

Simplify CSS:

It saves developers from requiring complex techniques such as floating or many positions to lay out the layout.

2025/8/25 Edited to

... Read moreเห็นบางคนเสิร์ชคำว่า “node.js vs flexbox” แล้วงงว่ามันเอามาเทียบกันได้ยังไง เราเคยงงเหมือนกัน เลยสรุปแบบเข้าใจง่ายจากมุมคนทำเว็บว่า จริงๆ แล้ว Node.js กับ CSS Flexbox “คนละชั้น” และ “คนละหน้าที่” กันเลย ไม่ได้เป็นคู่แข่งกัน แต่ทำงานร่วมกันได้ Node.js คือฝั่ง Back-end/Runtime สำหรับรัน JavaScript นอกเบราว์เซอร์ ใช้ทำเซิร์ฟเวอร์, API, จัดการฐานข้อมูล, ทำระบบล็อกอิน ฯลฯ ส่วน Flexbox คือเครื่องมือฝั่ง Front-end ใน CSS สำหรับ “จัดเลย์เอาต์” (layout) ขององค์ประกอบบนหน้าเว็บ เช่น จัดเมนูให้อยู่กลาง, ทำการ์ดเรียงเป็นแถวแล้วเว้นช่องให้เท่ากัน, หรือสลับเป็นคอลัมน์บนมือถือ ถ้าจะจำแบบเร็วๆ: Node.js = ทำให้เว็บ “ทำงาน” / Flexbox = ทำให้เว็บ “จัดวางสวยและยืดหยุ่น” ตัวอย่างสถานการณ์จริงที่เราเจอบ่อย - หน้าเว็บแสดงรายการสินค้า: Node.js ดึงข้อมูลสินค้าจากฐานข้อมูลแล้วส่งเป็น JSON/HTML มาให้หน้าเว็บ ส่วน Flexbox เอาข้อมูลนั้นมาจัดเป็นกริดการ์ด (เช่น item1 item2 item3) ให้เรียงสวย เว้นระยะพอดี - หน้าล็อกอิน: Node.js ตรวจสอบ user/password แต่ Flexbox ช่วยจัดกล่องฟอร์มให้อยู่กึ่งกลางจอทั้งแนวตั้งและแนวนอน ทริค Flexbox ที่ใช้งานแล้วช่วยมาก (โฟกัส Flex Container/Flex Items) 1) ต้องเริ่มที่ “Flex Container” ก่อน: ตั้งค่า container เป็น display: flex; แล้วลูกๆ ในกล่องนั้นจะเป็น Flex Items ทันที 2) เข้าใจแกนหลัก/แกนตัด (main axis / cross axis): ถ้า flex-direction: row; แกนหลักคือแนวนอน แต่ถ้าเป็น column; แกนหลักจะเป็นแนวตั้ง 3) จัดกึ่งกลางแบบเร็ว: ใช้ justify-content: center; (ตามแกนหลัก) + align-items: center; (ตามแกนตัด) 4) ทำให้ Responsive ง่ายขึ้น: ใช้ flex-wrap: wrap; เพื่อให้ items ตกบรรทัดได้ และกำหนดขนาดแต่ละ item ด้วย flex: 1; หรือ flex-basis เพื่อให้ปรับตามหน้าจอ สรุป: ถ้าโจทย์คือ “เลือกใช้ Node.js หรือ Flexbox ดี” คำตอบคือไม่ต้องเลือกอย่างใดอย่างหนึ่ง เพราะ Node.js ใช้ทำระบบหลังบ้าน ส่วน Flexbox ใช้จัดหน้าเว็บด้านหน้า โดยในโปรเจกต์จริงมักใช้ทั้งคู่ร่วมกัน: Node.js ส่งข้อมูล/เรนเดอร์หน้าเว็บ และ Flexbox จัด Flex Container + Flex Items ให้เลย์เอาต์ดูดีบนทุกหน้าจอ

Related posts

Capella University RN to BSN Flexpath
Overwhelmed by Capella University RN-to-BSN FlexPath 2026 courses? Let me help! #CapellaUniversity #FlexPath #RNtoBSN #NursingStudent #NurseTikTok
Capella University RN to BSN✅

Capella University RN to BSN✅

2 likes

A blue Amazon Flex card with a chip, set against a patterned background, with the overlay text "How I became an Amazon Flex Driver."
A screenshot of the Amazon Flex app page, showing the app icon, name, ratings (4.7 stars), and the 'Open' button, indicating the application process started via the app.
An email notification with the subject "Action Needed -> Start your Amazon Flex onboarding ASAP," received on Sep 4, 2024, prompting the user to complete paperwork to earn extra money.
How I became an Amazon Flex Driver
Being an Amazon Flex driver gives you the freedom to work when you want or need to. Here’s how I signed up, got approved, and hit the road. Flexible hours, extra cash, and freedom! #AmazonFlex #SideHustle #amazonflex #amazondriver #amazon
Lemon172545668310

Lemon172545668310

318 likes

Amazon Flex With Me!
#amazonflex #amazon #hustle #workingmom #WorkWithMe
LadyIsralite

LadyIsralite

34 likes

Powerful Websites
#fyplemon8 # #fypシ #websites #fy #websiteideas
Tha Smoke Websites

Tha Smoke Websites

238 likes

CSS Cheat Sheet
Essential CSS tricks every developer needs! 🔥 Save this for your next project - covers flexbox, grid, animations, and responsive design in one handy reference. Perfect for beginners and pros alike! 💻✨ #CSS #WebDevelopment #Coding #Programming #Developer
EM

EM

4 likes

Box Brownie Glow Up 🫶
From basic to bougie 🍫✨ Box brownie glow up level: chef’s kiss 💋 #BoxBrownieGlowUp #DessertVibes #fyp #BakingUpgrade #ChocolateObsessed #FromBasicToBougie #SweetFlex #GlowUpEats #FoodieMood #Lemon8Eats #SnackGoals
Kitty McTaco

Kitty McTaco

17 likes

4 Powerful Websites You’ll Wish You Knew Sooner
Always working smarter, not harder. These AI tools will help you code faster, automate tasks, and manage projects like a pro. Here’s what to try + prompts to get started: 1. Replit – Code, collaborate, and deploy directly in your browser. 👉 replit.com Prompt: Build a Python Flask API that ac
Deft Point Consulting

Deft Point Consulting

89 likes

#eggingon #costalkitchensimulator #hydroponicsfarmstoresimulator #roadfoodsimulator #tcgmulti #ranchfarmandstoresimulator
Eros Rose

Eros Rose

0 likes

Message me privately for more information.
THIS... is a 2019 Honda Civic Si Coupe, finished in Crystal Black Pearl with a black interior. This Civic Si is equipped with a 6-speed manual transmission. The attached Carfax history report indicates no accidents or mileage discrepancies in this Honda’s past; it also shows registration to one
JO THE CAR PLUG

JO THE CAR PLUG

8 likes

A cover image for an HTML + CSS project titled 'Parallax Sunset Mountains', featuring a stylized sunset with dark mountains and trees, highlighting it as 'Day 27' of mini-projects by Code With Aysha.
An explanation of the parallax effect, defining it as layers moving at different speeds during scrolling to create depth, motion, and a realistic 3D look using pure CSS, with an example of mountains.
An illustration detailing the anatomy of a parallax scene, showing sun/sky as the back layer, distant mountains as the mid layer, trees as the front layer, and birds as foreground animation.
Parallax Sunset Mountains (HTML + CSS Project)
In this mini-project, we create a beautiful parallax landscape using pure HTML + CSS — no JavaScript needed. The scene includes: 🌞 glowing sunset ⛰️ layered mountains 🌲 dark forest silhouette #HTMLCSS #Parallax #WebDesign #codewithaysha
Aysha

Aysha

4 likes

The image introduces "HTML + CSS IN ACTION: 30 Days of Mini Projects Modal Popup," showcasing a modal example with text "This is a Modal" and an "Open Modal" button. It highlights "Pop up power—no JavaScript needed" for Day 23, by Code With Aysha.
This image defines a modal popup as a small overlay that captures user attention and "locks" the screen. It displays a side panel with "Quick Settings" including Dark Mode, Font Size, Accent Color, Animations, Notifications, and Quick Links.
The image explains why building modals with HTML + CSS matters, demonstrating a "Page" and an "Overlay + Centered Card" modal. It emphasizes learning CSS selectors, visibility control, layering, transitions, and responsive centering without JavaScript.
Build a Sleek Slide-in Side Panel with HTML CSS
Build a modern slide-in side panel using only HTML and CSS! Perfect for quick settings, theme controls, and navigation links. Fully responsive and beginner-friendly — no JavaScript required. #HTMLCSS #WebDesign #FrontendDevelopment #codewithaysha
Aysha

Aysha

5 likes

WOLFBOX Compressed Air Duster
USA https://amzn.to/4r52yMP CAN https://amzn.to/4aS2pYt #amazonflexdrivers #amazonfinds #amazonmusthaves #amazonhome #amazonhomefinds Atlanta North America
EssentialFind

EssentialFind

12 likes

The image is a title slide for "HTML + CSS IN ACTION: 30 Days of Mini Projects Resume Layout," featuring a preview of a clean resume design for "Aysha Sanyang Frontend Developer" with sections for profile, contact, and skills. It highlights "Day 26" and "Code With Aysha."
This image defines "What Is a Resume?" and showcases a detailed resume layout for "Aysha Sanyang Frontend Developer," including sections for profile, contact, skills, experience, and education. It explains that a resume is a professional overview highlighting skills, experience, education, and achievements.
The image explains "Why This Matters" for a resume layout, reiterating the definition of a resume and showing a simplified layout. It emphasizes that a good resume layout is easy to scan, professionally structured, clean, modern, and ideal for portfolios and personal websites.
Build a Clean Resume Layout (HTML + CSS Only)
Every great resume focuses on 3 things: 💼 Experience – what you’ve done 🎓 Education – what you’ve learned 🛠 Skills – what you can do In Day 26 of our HTML + CSS series, we’re turning these core sections into a clean, modern resume layout UI. Perfect for portfolios, personal sites, or frontend
Aysha

Aysha

3 likes

FLEX HOẠT ĐỘNG NGOẠI KHOÁ 📋
Ít ai biết, năm 2022 tớ mới bước chân vào thế giới của “Hoạt động ngoại khoá” Bản thân tớ lúc ấy rất mông lung vì chưa biết đâu là lựa chọn thích hợp với mình. Thế rồi tớ cứ apply và cho phép mình được “thử” được trải nghiệm những hoạt động khác nhau. Năm 2023, tớ ngồi đây và gõ lách cách nhữ
Hồn Văn Chương

Hồn Văn Chương

18 likes

A desk setup with a computer monitor displaying code, a microphone, headphones, and a PC tower with blue lighting. The text overlay reads "GETTING IT DONE" and "Lemons8 @pastorcarlosamorales."
Getting it done
Day In My Life 📅 Date: 11-21-24 🌅Morning Routine: Prayer & Devotional, set the tone. 🌤Afternoon Routine: FOLLOW-UP, Carry Through, and Focus. 🌃Night Routine: Bible Study, Prayer, and planning Activities to-do: 🚶🏽‍♀️ Lots of walking #letgowork #doingthelittlethings
Pastor Carlos

Pastor Carlos

3 likes

A dark blue background with the title 'CSS KNOWLEDGE TEST!' and a purple lightbulb icon. Text asks 'How many can you get right? comment your score below!' with a Lemon8 logo and username.
A dark blue background with a white box containing 'Q1: What does the CSS property justify-content: space-between; do?' and four multiple-choice options (A-D).
A dark blue background with a white box containing 'Q2: Which unit is relative to the parent element's font size?' and four multiple-choice options (A-D).
💡 Think you know CSS? Let’s find out!
💡 Think you know CSS? Let’s find out! Take this short quiz and see how many you get right 😎 Comment your score below 👇 #CodeWithAysha #CSSQuiz #LearnToCode
Aysha

Aysha

3 likes

This is what I got today from My Tactical Promos ULTIMATE TACTICAL BOX
Nicole Renee West

Nicole Renee West

1 like

$25 TARTE BOX 💋
Tarte was recently having a promotion where you could get 4 minis for only $25. Given tarte’s prices, I thought this was a great deal and a great way to try the products 💌 What products I got: 💋Maracuja Juicy Lip Plump 💋Blush Tape Liquid Blush 💋Base Tape Hydrating Primer 💋Power Flex Conceale
Hadley

Hadley

26 likes

Ivy Beauty Box
I just unboxed the fabulous IVY BEAUTY Box! 🎁✨ rubykissescosmetics hooked me up with their travel-friendly 2-in-1 Makeup Palette—9 vivid colors for eyes and face, ranging from matte to shimmer. Blendable, buildable, and simply gorgeous! 🎨💄 ienvylashes_official brought the magic with Super F
Maritza B

Maritza B

2 likes

This image introduces "HTML + CSS IN ACTION: 30 Days of Mini Projects," focusing on Day 14: "Two-Column Layout (Sidebar + Main Content)." It highlights organizing webpages with a clean two-column design, presented by Code With Aysha.
This image defines a two-column layout, showcasing an example with a sidebar for navigation and a main content area. It explains that the sidebar is for navigation/extra info, and the main content is for articles/posts, built using HTML and CSS.
This image explains the benefits of a two-column layout, including organization, scannability, structuring real-world websites, and responsive design. A diagram illustrates sidebar and content alignment within the layout.
How to Build a Two-Column Layout with HTML + CSS
Learn how to create a clean, responsive two-column layout using only HTML and CSS! This project shows you how to combine a sidebar and main content area using Flexbox — perfect for dashboards, blogs, and portfolios. #HTML #CSS #Flexbox #WebDesign #codewithaysha
Aysha

Aysha

5 likes

Taco Bell Lux Discovery Box: The Ultimate Flex! ✨🌮
Yasss girl, Taco Bell really did that! The user just secured the new Lux Discovery Box and it is giving everything it needs to give. For only $9, this box is a literal steal. Look at the material: • Chipotle Chicken nugget thing (that grilled finish? iconic) • Cheesy Gordita Crunch (a classic fo
Brown Sugar 🧸

Brown Sugar 🧸

11 likes

A collection of items from an Ultimate Tactical Box displayed on a grey couch. Visible items include a Powersnip Pro electric scissors box, a flashlight box, a Blade Mystery Box, a Handy Hero Pen box, and orange-handled scissors in a bag, alongside the main 'TACTICAL' box.
This is what I got today from My Tactical Promos ULTIMATE TACTICAL BOX
Nicole Renee West

Nicole Renee West

1 like

Several new DynaFlex product boxes, some marked #LIVETHESHOW, are stacked on warehouse shelves alongside other truck parts, indicating a kit for a Peterbilt 379.
A stack of new DynaFlex product boxes with blue labels are stored on metal shelving, surrounded by various truck components, suggesting a kit for a semi-truck.
Cardboard boxes containing DynaFlex parts are neatly stacked on warehouse shelves, with other truck accessories like headlights visible, implying a new kit for truck modifications.
DynaFlex 7” Stack Kit-NEW IN BOX FOR 379 $1,000
Full kit of Dynaflex 7” Slash Tip stacks for a 379. Kit includes 2 elbows, 2 spools, and 2 top pipes. Come steal these tomorrow! #BigRig #SemiTruck #dynaflexusa #TruckMods #Peterbilt379
Peterbilt Parts Hub

Peterbilt Parts Hub

2 likes

A title slide for 'HTML + CSS IN ACTION: Portfolio Flip Cards,' showing a conceptual flip card with front and back details, indicating it's Day 29 of mini-projects by Code With Aysha.
An illustration of 'What Are Flip Cards?' showcasing six example portfolio projects like Product Card, Media Player, and Modal Component, explaining their use for portfolios, product previews, and feature highlights.
A visual explanation of 'How Flip Cards Work,' demonstrating a card rotating from 0° to 180° and listing CSS properties like `transform-style: preserve-3d;` and `rotateY(180deg);` for the 3D flip effect.
Portfolio Flip Cards (HTML + CSS Mini Project)
Day 29 — Portfolio Flip Cards (HTML + CSS) Today we’re building interactive flip cards you can use in any portfolio or web project. No JavaScript needed! These cards flip smoothly on hover to reveal more information — perfect for showcasing your projects, skills, team members, or services. Wha
Aysha

Aysha

2 likes

My biggest flex
#fyp #dunkin @Dunkin' @Philadelphia Eagles 🦅🦅
RACHEL

RACHEL

2 likes

Lemonade braids 6824149591 #goldbraid #hairtok #hairstyle #braid #fyp @Hypeman Morgan
Goldbraid

Goldbraid

2 likes

Cute beauty finds at Dollarama 👀
#fyp #dollarama #shopping #montreal
Amel 🇨🇦🍁

Amel 🇨🇦🍁

23 likes

What I Avoid at Michael's (as a Former Employee!)
In a previous TikTok video I show my Michael's haul - and a lot of them are stone, and that's the thing I think Michaels does sooo well. These however, are some spots where I think they kind of missed the mark. What do you guys think? Just a heads up though - they are having a sale and
Always Jaded Creations 🌿

Always Jaded Creations 🌿

84 likes

🔥 Twilight Masquerade ETB Showcase! 🔥
Today’s lineup is all about that masked-up mystique, clean accessories, and some seriously fire pulls from the Twilight Masquerade era 👀👇 ✨ Twilight Masquerade Elite Trainer Box — stunning teal-and-emerald mask design ✨ Matching deck sleeves — sealed, crisp, and ready to flex ✨ Aqua damage cou
Pokemasta710

Pokemasta710

3 likes

A stylish woman in a black off-shoulder dress and sunglasses stands against a blue ocean and sky backdrop. Text overlays read "STAY MYSTERIOUS" and "Psychology of 'The Quiet Ones'", with "Lemon8 @emily.mindset" at the bottom.
A white graphic with black text titled "The 'Oversharing' Trap". It explains that information is power, advising to be a "Black Box" by giving vague answers to create curiosity.
A white graphic with black text titled "The 'Pregnant Pause'". It describes using a 3-second silence after someone speaks to create tension and appear confident and thoughtful.
3 Psychology Hacks to be "Mysteriously" Attractive
Psychology Series: Part 8 🖤 (The art of saying less.) In a world where everyone is loud, Silence is the ultimate flex. You don't need to shout to be noticed. You just need to be Mysterious. The most magnetic people are like trailers, not full movies. They give you a glimpse, but make you pay
Emily | Mindset & Growth

Emily | Mindset & Growth

56 likes

Chevron-Style Breadcrumb Navigation in CSS
#webdesign #codinglife #studytips #codingforbeginners #breadcrumbs
Aysha

Aysha

5 likes

See more