
1. Understanding CSS Units (Measurement System)
CSS units define how big or small something is. They are divided into absolute, relative, and viewport-based units.
1.1 Absolute Unit: px (Pixels)
Pixels are the most basic CSS unit.
Fixed size
Does not scale based on screen or parent element
Very precise but not flexible
Example:
font-size: 16px;
border: 1px solid black;
Use case:
Borders
Icons
Small UI details
1.2 Relative Unit: % (Percentage)
Percentage is relative to the parent element.
Flexible and responsive
Common in layout structures
Example:
width: 50%;
This means the element takes 50% of its parent container width.
Use case:
Layout containers
Responsive widths
1.3 Relative Unit: em
em is relative to the font size of the parent element.
Can compound (nested scaling effect)
Useful but sometimes unpredictable
Example:
padding: 1.5em;
Use case:
Component-based scaling
Buttons and UI elements
1.4 Root-Based Unit: rem
rem is relative to the root (html) font size.
More consistent than em
Recommended for design systems
Example:
font-size: 1.25rem;
Use case:
Typography system
Spacing scale
Global UI consistency
1.5 Viewport Units: vw and vh
These units are based on the size of the screen.
vw (Viewport Width)
1vw = 1% of screen width
width: 100vw;
vh (Viewport Height)
1vh = 1% of screen height
height: 100vh;
Use case:
Full-screen sections
Hero banners
Responsive typography
1.6 Advanced Viewport Units: vmin and vmax
vmin = smaller side of viewport
vmax = larger side of viewport
Example:
font-size: 5vmin;
Use case:
Responsive typography that adapts automatically
1.7 Grid Unit: fr (Fraction)
Used in CSS Grid to divide space.
Example:
grid-template-columns: 1fr 2fr;
This means:
First column = 1 part
Second column = 2 parts
Use case:
Layout grids
Dashboard UI
1.8 Typography Unit: ch
Based on character width (width of "0").
Example:
width: 60ch;
Use case:
Improving text readability
Blog/article layouts
2. Understanding Spacing in CSS (UI Layout System)
Spacing defines the distance between elements and inside elements. It is one of the most important parts of UI design.
2.1 Margin (External Spacing)
Margin creates space outside an element.
Example:
margin: 20px;
Use case:
Separating sections
Creating breathing space between components
2.2 Padding (Internal Spacing)
Padding creates space inside an element.
Example:
padding: 16px;
Use case:
Buttons
Cards
Containers
2.3 Gap (Modern Layout Spacing)
gap is used in Flexbox and Grid.
Example:
display: flex;
gap: 24px;
Advantages:
Cleaner than margin hacks
Automatically manages spacing between items
Use case:
Card layouts
Navigation menus
Grid systems
2.4 Column-gap and Row-gap
Used in grid layouts.
column-gap: 20px;
row-gap: 16px;
column-gap = horizontal spacing
row-gap = vertical spacing
2.5 Block Spacing (margin-block)
Controls vertical spacing (top and bottom).
margin-block: 24px;
Use case:
Article sections
Vertical rhythm in layouts
2.6 Inline Spacing (margin-inline)
Controls horizontal spacing (left and right).
margin-inline: 12px;
Use case:
Multi-language layouts (LTR/RTL support)
Modern responsive design
2.7 Logical Padding: padding-block & padding-inline
Modern replacement for directional padding.
padding-block: 20px;
padding-inline: 16px;
Instead of:
padding-top
padding-bottom
padding-left
padding-right
Use case:
Responsive UI systems
International layouts
3. Simple Mental Model (Easy Understanding)
Units = “Size”
px = fixed size
% = relative to parent
rem = relative to root
vw/vh = relative to screen
Spacing = “Distance”
margin = space outside
padding = space inside
gap = space between items
block/inline = modern logical spacing
learn to create a website footer using WordPress Gutenberg for a catering site, tailored for beginners, in this part i of the module.
Learn to build the our story section in WordPress Gutenberg for a catering site, using a two-column layout with a left image and right text, plus typography tweaks.
Create the home page 'what we offer' section with Gutenberg blocks and stacks, center the heading, adjust padding and margins, group elements, set background, and prepare a posts query loop.
Learn to create a work section with a responsive image gallery in WordPress Gutenberg, adjust background, padding, aspect ratio, and link styling for a view full gallery.
Duplicate the home page preview section, copy-paste content from notepad, change the background and title, and adjust typography by centering the heading, removing uppercase, increasing font size, and deleting columns.
Build and customize the about page for a catering website using WordPress Gutenberg by creating story, philosophy, and values sections; adjust layout, images, text, colors, padding, and typography.
Edit and customize the WordPress Gutenberg contact form for a catering site by adjusting fields, enabling required email and event options, and applying styling and layout updates.
Build a catering website services page in WordPress Gutenberg by arranging blocks with stacks and groups, styling backgrounds, padding, fonts (dm sans), and a responsive grid of full-width buttons.
Create a WordPress Gutenberg services page by duplicating and renaming a block to form a 'glimpse of work' gallery, adjusting alignment, padding, and background, then upload images for visual showcase.
Set up and edit the journal blog page with Gutenberg by configuring templates, grouping blocks, and styling the hero section with a gray full-width background, DM Sans font, and padding.
Construct a WordPress Gutenberg blog post layout for a catering site by adding title blocks, categories, content sections, icons, DM Sans typography, date, cover adjustments, and navigation between posts.
Visit the WordPress dashboard, open settings > reading, switch the homepage from posts to a static page, and save changes to update the homepage.
Learn to configure a 50/50 two-column home page in WordPress Gutenberg, set up a query loop in the first column, and tune featured images and typography for a catering site.
This course is designed for beginners who want to learn WordPress and Gutenberg while building a real small business catering website from scratch. Instead of only learning theory, you will directly create a complete catering business website step by step using the Gutenberg block editor in a simple and practical way.
You will understand how WordPress works, how to manage pages, and how to use Gutenberg blocks to design clean and professional layouts suitable for small business websites. This course focuses on practical implementation, making it perfect for beginners who want to build real-world projects.
By the end of this course, you will have a fully functional catering small business website that can be used for portfolio, freelance projects, or real business needs.
In this course, you will learn:
Introduction to WordPress and Gutenberg editor
Understanding WordPress dashboard and basic settings
Creating pages and website structure for catering business
Using Gutenberg blocks to build clean layouts
Designing menu, services, and contact pages
Building small business catering website step by step
Publishing and managing a WordPress website
Why take this course?
Beginner friendly and easy to follow
Focus on real small business website project
Practical learning with step by step guidance
No coding required
Suitable for freelancers and small business owners
This course is perfect for anyone who wants to start learning WordPress Gutenberg and build a small business catering website in a simple, structured, and practical way.