How do I add an hr tag between two columns in Webflow?
Published on
September 22, 2023
To add an <hr>
tag (horizontal rule) between two columns in Webflow, you can use a combination of Webflow's built-in design tools and custom code. Here's a step-by-step guide to help you achieve this:
- Open your Webflow project and access the page where the two columns are located.
- Select the parent container of the columns by clicking on it. This could be a section or a div block.
- Navigate to the Style panel on the right-hand side of the Webflow interface.
- Under the Layout section, choose the "Display" property and set it to "Flex".
- Go to the Columns section and set the desired number of columns for the container.
- Customize the width and spacing of the columns as needed using the provided controls.
- Next, click on the parent container again to reveal more options.
- Click on the "Add Child Element" button (+ sign) to insert a new child element inside the container.
- Choose the "DIV" element and position it between the two existing columns.
- With the new DIV element selected, go to the Style panel and customize its styling attributes, such as width, background color, and padding.
- Now, you can add the
<hr>
tag inside this new DIV element. Click on the "Add Child Element" button once again and select the "HTML Embed" element. - An HTML embed component will appear within the new DIV element. Click on it to open the HTML embed settings.
- Inside the HTML embed settings, enter the
<hr>
tag in the "Embed code" field. - Customize the
<hr>
tag using CSS, either by adding inline styles or by selecting the Embed element and applying custom classes in the Style panel. - Adjust the positioning and dimensions of the
<hr>
tag by manipulating the parent DIV element.
By following these steps, you should be able to insert an <hr>
tag between two columns in Webflow. Remember to save and publish your changes to see the updated design on your live website.
Additional Notes:
- Using this method allows you to have more control over the styling and positioning of the
<hr>
tag compared to simply inserting it as a standalone element. - Be cautious when using the Embed element and adding custom code in Webflow, as it may affect your site's responsiveness or create conflicts with other elements. Always test your design changes across different devices to ensure optimal display.
Example Code:
<div class="parent-container"> <div class="column"> <!-- Content for the first column goes here --> </div> <div class="divider-column"> <div class="divider"> <hr> </div> </div> <div class="column"> <!-- Content for the second column goes here --> </div></div>
CSS Stylesheet:
.parent-container { display: flex;}.column { flex: 1;}.divider-column { display: flex; flex: 0 0 auto; align-items: center;}.divider { width: 100%; background-color: #333; padding: 1px; /* Adjust as needed */}.hr-tag { /* Customize the <hr> tag styles */}
Additional questions:
- How do I create columns in Webflow?
- What is the HTML embed element in Webflow?
- How do I customize the styling of an HTML embed component in Webflow?