You're trying to create a responsive heading with a clickable link inside it using flex text techniques, but encountering formatting issues when resizing or using spans. Here's how to do it properly in Webflow to maintain styling and responsiveness.
1. Use Inline Elements Correctly
- Ensure the link is inside the heading as an inline element, such as a Text Span.
- Do not convert the whole heading to a Link Block—that changes it to a block-level element and breaks text flow.
- Use the Rich Text element or a Heading element (H1–H6) with inner Spans for segmenting parts of the text.
2. Avoid Full-Flex on Text Elements
- Do not set a heading or text element to display: flex just to move text to a new line. That typically causes wrapping and alignment issues.
- Instead, use line breaks (Shift + Enter) inside the heading in the text editor if manual control of line breaks is needed.
3. Style the Link Span Correctly
- Select the word you want to turn into a link, click the + Add Link from the inline text toolbar.
- Apply a Span class to the link or text span. Use it to style the link (color, underline, etc.).
- In the Designer panel, set Display: inline or inline-block—not block or flex—so it remains part of the text flow.
4. Prevent Layout Shifts with Responsive Typography
- Use VW-based or clamp() typography units in the typography settings for the heading to make it responsive.
- Example: Set font size to clamp(24px, 5vw, 48px) to scale between screen sizes smoothly.
5. Control Wrapping with Non-Breaking Spans
- If you're trying to keep part of a heading (like "Get Started Today") on the same line:
- Highlight the phrase and add a Text Span.
- Set White Space: nowrap on the Span to prevent mid-line breaks.
- This helps when you don’t want the link to wrap separately from its context.
6. Test Across Breakpoints
- Go through each Responsive Breakpoint in Webflow’s Designer.
- Adjust font size, line height, or margin manually to ensure the heading + link behaves correctly.
Summary
To build a responsive heading with an inline link, avoid setting text elements to flex, use inline spans instead of block elements, manage wrapping with white-space: nowrap when needed, and utilize responsive typography units like clamp(). Keep all elements inline and avoid nesting flex containers inside text lines unless absolutely necessary.