DRAG ME
5
min to read

Webflow Alignment Tutorial: Build a Responsive Hero with Flexbox

Educational
Web development
Explore all
November 3, 2025
Build a centred desktop hero that becomes left-aligned on mobile, with clear parent-level layout rules and a practical testing checklist.
In this article

Updated 12 September 2026.

In this guide

  • Let the content wrapper control the position of its direct children.
  • Set text alignment separately from the flex layout.
  • Use one deliberate mobile variation and test it with longer content.

Define the result and the element structure

In this exercise, you will build a hero with a heading, paragraph and two links styled as buttons. It is centred on desktop and left-aligned on a narrow screen. The class names and values below are illustrative, so adapt them to your existing conventions.

Create a section, an outer width-limited container and a content wrapper named tutorial-hero_content. Place the heading, paragraph and a button group inside that wrapper. Give the button group its own class. Keep the structure shallow enough that each parent has a clear job.

Set the desktop layout on the parent

Make the content wrapper a flex container with a column direction. Centre its direct children on the cross axis, set a useful gap between them and give the text a centred alignment. Constrain the paragraph to a readable width rather than letting it span the entire screen.

In a column, align-items controls the cross-axis alignment of the children. This is separate from text-align, which controls the lines inside the text elements. If the paragraph has a full-width box, its text can still require a separate alignment rule.

Settings for the example heroElementDesktopNarrow screenContent wrapperFlex column; children centredChildren aligned to startTextCentredStart-alignedParagraphMaximum width: 38remStill constrained by the viewportButton groupFlex row with wrap and gapWrap or stack as the content requiresOuter containerLimited width and auto side marginsConsistent page padding

Give the button group its own layout

Make the button group a flex row, allow wrapping and set a gap. Keep the primary and secondary destinations clear. Use links for navigation and buttons for actions; visual styling should not determine the HTML role.

Try longer button labels before proceeding. The group should wrap without overlap or horizontal scrolling. Avoid hardcoding a wrapper width just to make the two sample labels fit. The layout should support the words the real page needs.

Practical takeaway: One clear parent rule is easier to reuse than several compensating child overrides.

Add the narrow-screen change deliberately

At the relevant smaller breakpoint, align the content wrapper’s children to the start and change text alignment to the start. Decide whether the button group should wrap or stack. In the CSS equivalent below, the illustrative breakpoint is 767px.

Inspect the paragraph’s own margins and any child alignment override if it stays centred. Do not compensate with arbitrary left margins. Fix the rule that owns the position so the same pattern works in another section.

Understand the CSS equivalent

The code below demonstrates the intended behaviour with ordinary CSS. You can implement the corresponding settings in Webflow’s visual controls; do not paste a duplicate style block over an existing implementation without checking the cascade.

This is an alignment exercise, not a native string-variable mode setup. Webflow’s typed variables are useful for supported values such as spacing and colours, while the layout behaviour here is expressed through flex settings and breakpoint rules.

CSS example

.tutorial-hero_content {
display: flex;
flex-direction: column;
align-items: center;
gap: 1.5rem;
text-align: center;
}
.tutorial-hero_content > p {
max-width: 38rem;
margin: 0;
}
.tutorial-hero_actions {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}
@media (max-width: 767px) {
.tutorial-hero_content {
align-items: flex-start;
text-align: start;
}
}

Try the layout

Try the alignment change

Show the start-aligned layout

A clear message for your visitors

The parent moves these children. Text alignment is a separate rule that changes with the same demonstration control.

Primary actionSecondary action

Illustrative layout. The action labels are examples, not navigation buttons.

Test the reusable pattern

Duplicate the section on a test page and use a headline twice as long, a short paragraph and one missing secondary action. Check both the default layout and the mobile variation. Then navigate the actions with the keyboard.

If the layout survives only the original sample, revisit widths, wrapping and inherited styles. Document the supported variation so the next contributor can reuse the pattern without copying a collection of unexplained overrides.

A related YAVACADO project

The Fiscal Agency website shown in a desktop mockup
The Fiscal Agency: Figma to Webflow Build for a Fiscal Advisory Firm. A YAVACADO website project.

The Fiscal Agency required responsive Webflow pages translated from Figma Auto Layout. YAVACADO preserved typography and spacing while organising the build with Client-First. The hero in this tutorial is an instructional example, not a reproduction of that client’s page.

View project: The Fiscal Agency

Your next check

Mark each item as you check it. Ticks last for this page visit.

Confirm the parent is a flex column.Set text alignment separately.Test the longest realistic button label.Inspect mobile child overrides and margins.Test a second instance with different content.

Put it into practice

The paragraph stays centred on mobile. What should you inspect?

Check its own margins, text-align and any align-self override. A correct parent setting can be overridden by a child rule. Remove the conflicting rule only after identifying why it exists.

Continue with a related guide

Official references

Discuss your website

Build responsive Webflow sections with layout rules your team can reuse.

Explore Webflow development or tell us about your project.

FAQs

B2B Website Navigation: Help Buyers Find the Right Next Page

11/17/25
4
min to read

Content for AI Search: Make Your Answers Clear and Verifiable

3/9/26
4
min to read

Campaign Landing Pages: Keep the Promise from Ad to Enquiry

12/8/25
4
min to read

Shopify Metafields: Build Consistent Product Information Step by Step

3/29/24
4
min to read

Testimonials

What our clients say

A web design agency that cares about you and your brand, no matter the size or what industry your business is in.

YAVACADO turned our technical equipment catalog into a clear, professional website that our team can manage. The CMS and CRM integration make it easier to present products, process enquiries, and support clinics from the first contact.

YAVACADO turned a complex booking process into one clear platform. Our team can manage tours and content in Webflow, while parents can book and pay securely through WayForPay. The result is easy to operate and built around the needs of the Ukrainian market.

The website captures the premium feel of our brand perfectly. From the design to the multilingual functionality and payment integration, every detail was delivered to a very high standard.

Excellent implementation of our Figma design in Webflow. The final website feels fast, polished, and exactly aligned with the premium fintech experience we wanted.

The funnel feels significantly more polished than the original concepts and was delivered in a format our internal team could immediately continue working with. Smooth process and excellent execution.

Working with YAVACADO was a fantastic experience. They understood both the technical requirements and the business goals, delivering a fast, polished website that's easy to manage and built to generate qualified leads.

Impressive speed and quality. The landing page was delivered in just hours and looks clean, professional, and ready to use.

The turnaround was incredibly fast, and the result looks clean and professional. The site reflects our firm perfectly and was delivered exactly on time.

Contact us

Let's talk about your project.

For general enquiries, please fill out the form to get in touch. Alternatively, if you know your project details — head over to our project planner for a more refined step-by-step process.
Go to Project Planner
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.