Structure: pages, layout, and navigation¶
In this section, we'll create three pages, design a layout template with header and footer, and build navigation that works across all pages.
Creating pages¶
By default, Silex creates an index page (the homepage). Let's add two more.
In the Pages panel (left sidebar):
- Click the + button to add a new page
- Name it
about - Click + again and name the second new page
contact
You now have three pages: index, about, and contact.
(Silex automatically creates index.html, about.html, and contact.html when you publish.)
Building the layout template¶
All three pages will have the same header and footer. We'll build this once using Symbols so changes sync across all pages.
Start with the index page (make sure you're on it). The general structure is:
Step 1: Add the main page structure¶
- From the Blocks panel, drag a Container onto the page — this will be our main page container
- Set this Container to Display: Flex, Flex-direction: Column (stacks sections vertically)
- Set Width to
100%and add a Max-width (e.g.,1200px) and margin:autoto center it (see Flexbox for details)
Step 2: Create the header¶
Inside the main container:
- Add a Container — this will be the header. In the Element settings (gear icon at the top of the right panel), set its Tag name to
header - Give it a class: in the Style Manager (paint brush icon), click + in the selector area at the top, type
agency-headerand press Enter - Inside the header, add two elements side by side:
- Image — the logo (for now, use a placeholder or find an agency logo image)
-
Container with its Tag name set to
nav— for the navigation links -
Style the header:
- Display: Flex
- Justify-content: space-between (logo left, nav right)
- Align-items: center
- Add Padding (e.g.,
20px) - Add a Bottom border or Background color for visual separation
Step 3: Build the navigation¶
Inside the nav Container:
- Add a Container with the class
agency-nav-links - Set it to Display: Flex
- Add three Text elements inside, one for each page. Double-click each one and type the link text, then in the Element settings (gear icon) set Link Type to
URLand the URL to the page (each Text becomes an<a>): - "Home", URL:
./index.html(relative path) - "About", URL:
./about.html -
"Contact", URL:
./contact.html -
Add Column-gap to the
agency-nav-linksContainer (e.g.,24px) to space the links - Style the links: set Font-size, Font-weight, Color. Optionally add padding or margin
Step 4: Create the main content area¶
After the header, inside the page container:
- Add a Container with class
agency-content(oragency-main), and set its Tag name tomain - This is where page-specific content goes (hero section, cards, forms, etc.)
- Set it to Flex-grow: 1 so it expands to fill available space
- Add Padding (e.g.,
60px 20px) for breathing room
Step 5: Create the footer¶
After the main content:
- Add a Container with class
agency-footer, and set its Tag name tofooter - Inside, add a Text (for copyright text) or multiple elements for footer links
- Style the footer:
- Top border or background color for separation
- Add Padding
- Set a smaller Font-size (e.g.,
14px) - Center text with Text-align: center
Converting header and footer to Symbols¶
Now we'll convert the header and footer to Symbols so they stay the same on all pages.
Make the header a Symbol¶
- Select the header Container (with class
agency-header) - Open the Symbols panel (left sidebar,
Shift+S) and click + - Type
Headerand confirm
The header is now a Symbol. Any change you make to it updates everywhere it is used.
Make the footer a Symbol¶
- Select the footer Container
- In the Symbols panel, click +
- Type
Footerand confirm
Copy the layout to other pages¶
The index page is now complete. Let's add the header and footer to the about and contact pages.
- In the Pages panel, switch to
about - From the Symbols panel, drag the
Headersymbol onto the page, then theFootersymbol below it - Between them, add the main content area: a Container with its Tag name set to
main - Repeat for
contact
Changes to the Header or Footer symbol now apply on all three pages.
Starting a new page from an existing one
The Clone page button of the Pages panel copies a page with all its content. The copy keeps the symbols: the header and footer stay in sync.
Setting the homepage¶
The homepage must be named index. Silex does this automatically, so you're already set.
When you publish, index.html is your homepage and is served at the root of your domain (e.g., mysite.com/ loads index.html).
Testing internal links¶
Before moving on, test that internal navigation works:
- In the editor, click one of the navigation links
- In the Element settings (gear icon), verify that its Link URL starts with
./(relative path) - Publish the site to GitLab Pages (see Publish or Publish to GitLab)
- On the live site, click a link. You should navigate to that page
If links don't work, double-check:
- The URL uses relative paths (
./about.html, not/about.htmlor absolute URLs) - The text you click has a Link set in the Element settings (gear icon)
- The page names match exactly (case-sensitive:
about.htmlnotAbout.html)
Next steps¶
Your three pages are now connected with consistent header and footer. Head to Styling to build a design system with CSS variables and consistent spacing.
Related pages¶
- Pages — creating and managing pages
- Flexbox — layout with flex
- Symbols — synced reusable elements
- The editor — editor interface overview