When designing landing pages, blogs, or email templates in HubSpot, even small visual touches — like adding a border around a rich text box
can improve the user experience and make your content stand out.
Surprisingly, HubSpot default design editor doesn’t always make it obvious how to customize a rich text box with a border.
As a HubSpot Consultant with 15 years of hands-on experience helping companies optimize their HubSpot assets, I’m going to walk you
through exactly how to add a border to a HubSpot rich text box in the easiest way possible using HTML, and also show you how this could be
approached if you were using C# or VB.NET in custom HubSpot CMS modules.
Let’s dive in.
Borders are not just decorative — they:
In HubSpot, however, adding a border isn’t just a matter of clicking a setting — it requires a bit of HTML or inline styling knowledge.
If you’re editing a rich text box inside HubSpot drag-and-drop editor, the easiest solution is to insert a simple div tag
with inline CSS.
Heres exactly what you need to do:
<div style="border: 2px solid #000; padding: 20px;">
<h2>This is a bordered Rich Text Box</h2>
<p>Add your rich content here. Text, images, links — anything.</p>
</div>
Explanation:
border: 2px solid #000;
— adds a solid black border 2 pixels wide.
padding: 20px;
— adds space inside the box so the content isn’t squeezed.
You can customize:
Border color (#000
for black, #ccc
for light gray, etc.)
Border thickness (e.g., 1px
, 3px
)
Border style (solid
, dashed
, dotted
)
Here’s a more visually attractive version:
<div style="border: 3px dashed #3498db; padding: 25px; border-radius: 8px; background-color: #f9f9f9;">
<h2>Stylish Bordered Box</h2>
<p>This rich text block looks polished and professional!</p>
</div>
This adds:
Dashed border style.
Rounded corners (border-radius
).
Background color for extra contrast.
If you’re working inside HubSpot Design Tools with custom modules or templates, you have even more flexibility.
In a custom HTML + HubL module, simply wrap your rich_text
field like this:
<div style="border: 2px solid #333; padding: 15px;">
{{ module.rich_text_content }}
</div>
Where {{ module.rich_text_content }}
pulls in whatever the user enters into the rich text editor field.
You might wonder: why would someone use C# or VB.NET when working with HubSpot?
Well, if you’re building external CMS integrations, HubDB powered web apps, or customized server-side processing that
interfaces with HubSpot APIs, you might use C# or VB.NET in the workflow.
Although HubSpot CMS is mostly client-side (HTML/HubL), here’s how you would conceptually handle it if you’re manipulating content
before sending it to HubSpot:
string content = "<h2>Your dynamic content here</h2><p>More rich text</p>";
string borderedContent = $"<div style='border: 2px solid #4CAF50; padding: 20px;'>{content}</div>";
// You would then send this HTML to HubSpot via the CMS or Email API.
Here:
We are dynamically wrapping the content in a bordered div
.
This would be useful if you are generating marketing emails, blog posts, or page content dynamically in your C# application.
Dim content As String = "<h2>Your VB.NET Content</h2><p>Text goes here</p>"
Dim borderedContent As String = "<div style='border: 2px solid #ff5722; padding: 20px;'>" & content & "</div>"
Now you can send borderedContent to HubSpot API.
Again, this is useful when you’re managing large content blocks externally and pushing them into HubSpot templates or blogs.
Here are a few advanced suggestions to take your styling further:
Mobile Responsive:
Make sure your padding and borders are responsive by using percentage values or media queries if you’re editing CSS in a theme.
Hover Effects:
You can make the border change color when users hover over the box.
<div style="border: 2px solid #555; padding: 20px;" onmouseover="this.style.borderColor='#e67e22'" onmouseout="this.style.borderColor='#555'">
<h2>Hover over me!</h2>
</div>
Add subtle shadows for a more modern, elevated design.
<div style="border: 1px solid #ccc; padding: 20px; box-shadow: 2px 2px 8px rgba(0,0,0,0.1);">
<h2>Fancy Text Box</h2>
</div>
Instead of repeating inline styles, create a CSS class in your HubSpot theme:
.bordered-box {
border: 2px solid #0077cc;
padding: 20px;
border-radius: 10px;
}
Then simply use:
<div class="bordered-box">
<h2>This uses a class</h2>
</div>
This is cleaner and scalable for larger websites.
Forgetting to add padding (your content will look cramped without it).
Using colors with low contrast (always test for accessibility).
Overcomplicating it — a simple, clean border often looks best.
Not testing on mobile view — make sure borders don’t break mobile layouts.
Adding a border around a rich text box in HubSpot is surprisingly easy once you know where to insert the right HTML, whether you’re
working inside a simple page editor, the Design Manager, or integrating dynamic content with C# or VB.NET.
Mastering small customizations like these gives your HubSpot pages a polished, professional look — and improves your audience experience.
How to put a border around a text box in constant contact HubSpot free?
In Constant Contact, you can add a border around a text box by clicking on the text block, selecting the “Block“ settings in the sidebar, and
adjusting the border style, color, and thickness under the “Border” options.
If needed, you can also apply custom borders using the Advanced CSS editor.
What is the rich text field in HubSpot free?
A rich text field in HubSpot is a content area that allows you to add and format text, images, links, videos, and other media using a visual
editor.
Its commonly used in landing pages, emails, blogs, and custom modules to create flexible, styled content without needing to code.
How do I add a border to a text box in Canva instead of HubSpot?
To add a border around a text box in Canva, insert a rectangle or square shape from the “Elements” tab, adjust its size to frame your text, set
the fill to transparent, and customize the border’s color and thickness.
Then, position this shape behind your text box to create the bordered effect.
How do I add a border to a text box in HubSpot?
To add a border around a text box in HubSpot, wrap your content within a <div>
tag using inline CSS. For example:
<div style=”border: 2px solid #000; padding: 20px;”>
<!– Your content here –>
</div>
How to Embed a List in HubSpot
Circle.so HubSpot Integration