Single-side borders are one of the most versatile design tools in CSS.
Loading Border Builder…
Set individual border-top, right, bottom, left independently
Preview left-side accent, bottom underline, and top separator patterns
Adjust width and color per side without affecting others
Generates shorthand or individual property declarations
Drop the Border Builder into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.
Embed code
<iframe
src="https://www.fixtools.io/css-tool/border-builder?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="Border Builder by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
The left-side accent pattern is one of the most common single-side border uses. Setting border-left: 4px solid #6366f1 on a navigation item, list entry, or sidebar element creates a colored indicator line that signals active or selected state. To prevent width changes between active and inactive states, set border-left: 4px solid transparent on inactive items so the layout space is pre-allocated. On the active item, change border-left-color to the accent color. This technique avoids horizontal layout shifts across the navigation when active state changes. The left accent width typically ranges from 3px to 5px for good visibility at standard navigation item heights.
Border-bottom as a heading underline gives more styling control than text-decoration: underline. You can set the thickness, color, and offset independently from the text. Setting display: inline-block or display: inline on a heading element and applying border-bottom: 2px solid #6366f1 creates an underline that matches the text width rather than the full block width. On block-level headings, border-bottom spans the full container width. For a partial underline that only underlies the heading text, wrap the text in a span with display: inline and apply the border-bottom to the span. Hover effects can animate the border-color or scale the underline width using width and transition.
Horizontal separators using border-top or border-bottom on section elements replace the html hr element with more styling flexibility. Setting border: none; border-top: 1px solid #e5e7eb on a div or section creates a precise separator that inherits the container width. This is cleaner than hr because you control the color, weight, and margin without needing to override the browser's default hr styling. For article layouts, a border-top on each section except the first creates clean visual separation between content blocks. Combining border-top with padding-top on paragraphs or sections creates consistent grouped content patterns across long-form layouts.
Box-sizing has a subtle but important effect on one-sided border patterns, especially in navigation grids where every list item should be the same width. Under the default content-box model, adding border-left: 4px solid colour to one item makes that item 4px wider than its neighbours, which pushes the whole row out of alignment. Switching to box-sizing: border-box subtracts the 4px from the content area instead, keeping the outer dimensions identical across items. Combined with the transparent-border pre-allocation trick (border-left: 4px solid transparent on inactive items, change only color on active), the layout stays perfectly stable as selection moves. The same logic applies to border-bottom indicators on tab bars: each tab keeps its measured width across all states because border-box absorbs the indicator into the existing width budget. Without border-box, every state change on a one-sided border subtly shifts neighbours, and the cumulative effect across a navigation grid is visible jitter on every click.
Select the left side accent pattern to see border-left: 4px solid #6366f1 with border-right: none; border-top: none; border-bottom: none. Switch to underline mode for border-bottom only. Adjust width and color for your design, then copy the generated CSS.
Step-by-step guide to css border on one side generator:
Select which sides to border
Enable only the sides you want in the side selector. Disable the other three sides to create a one-sided border. The preview updates to show exactly how the selected side configuration looks.
Set width and color for each active side
Enter a pixel width and select a color for each enabled side. Left accent borders typically use 3px to 5px. Bottom underlines use 1px to 3px. Top separators use 1px.
Preview the common patterns
Use the pattern presets to see left accent, bottom underline, and top separator patterns immediately. Adjust from a preset rather than starting from scratch for faster iteration.
Copy the generated CSS
Copy the individual border-side declarations. The tool generates the minimal set of properties needed without including zero-value sides unless they are needed for a reset.
Common situations where this approach makes a real difference:
Active state indicator in sidebar navigation
A sidebar navigation uses border-left: 3px solid transparent on all items and border-left-color: #6366f1 on the active item. The transparent default pre-allocates the 3px space so the layout does not shift when the active item changes. Combined with background: #f0f4ff and color: #6366f1 on the active item, the left border reinforces the selection visually alongside the background highlight.
Blockquote left bar in an article
An article blockquote uses border: none with border-left: 4px solid #6366f1 and padding-left: 16px, plus font-style: italic and color: #4b5563. The left line provides the visual signal that this is quoted content without enclosing the text in a box. The padding-left keeps the text away from the colored line. This pattern is used by most editorial CSS frameworks for blockquote styling.
Tab bar active indicator
A horizontal tab bar uses border-bottom: 2px solid transparent on all tab buttons and border-bottom-color: #6366f1 on the active tab. Each tab has padding-bottom: 8px to add space between the tab label and the indicator line. The tab container has border-bottom: 1px solid #e5e7eb for the full-width separator, and the active tab indicator overlaps it visually. Transitions on border-color make the indicator movement smooth when switching tabs.
Heading with expanding underline on hover
A card heading uses ::after pseudo-element with content: ''; display: block; width: 0; height: 2px; background: #6366f1; transition: width 0.3s ease. On the heading :hover, the ::after width transitions to 100%, creating an expanding underline animation. This technique uses background instead of border-bottom for the underline to make the width transition work cleanly, as border-bottom width transitions create height changes rather than horizontal growth.
Get better results with these expert suggestions:
Left accent border on blockquotes is more readable than full borders
A blockquote with border: 1px solid #e5e7eb on all four sides competes with surrounding content. Setting border: none; border-left: 4px solid #6366f1 with padding-left: 16px creates a clean left accent that marks the quote without boxing it. The left line draws the eye and signals a quote without visual noise on the other three sides.
Animate bottom border width for underline-grow hover effects
Animating a heading underline from 0 to full width on hover creates an expanding underline effect. Set the element to position: relative, then use ::after with position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: #6366f1; transition: width 0.3s ease. On :hover, set width: 100%. This approach uses a pseudo-element with background instead of border-bottom, which gives cleaner transition control.
Use border-bottom for tab navigation active indicators
Tab components use border-bottom to indicate the active tab. Set border-bottom: 2px solid transparent on all tabs and border-bottom-color: #6366f1 on the active tab. This produces a bottom indicator line that appears directly under the active tab text. Add padding-bottom to the tabs to create space between the text and the indicator. The border-bottom approach is standard in Material Design and most component library tab implementations.
Combine border-left with box-shadow for a raised accent effect
Adding box-shadow: inset 3px 0 0 0 #6366f1 to an element instead of border-left avoids the layout space that border-left occupies. The inset shadow paints a left-side line inside the element's box without adding to its width. This is useful inside flex or grid children where adding border-left would require adjusting padding to compensate for the occupied space.
Pre-allocate single-side border space with transparent values
On interactive elements where a border appears on a state change, set the border to transparent in the default state: border-left: 4px solid transparent. On the active state, change only border-color to the visible value. This prevents layout shifts when the border becomes visible.
Use border-bottom for custom underlines on inline text
Apply border-bottom on a span with display: inline rather than on a block element to get an underline that matches the text width. Combine with padding-bottom: 2px to add space between the text baseline and the underline. This gives far more visual control than text-decoration: underline.
Replace hr elements with border-top on divs for more control
The hr element has browser-default margin and styling that requires overriding. Using a div with border: none; border-top: 1px solid #e5e7eb gives you a separator without any defaults to fight. Control margin entirely with the parent padding or explicit margin on the separator div.
More use-case guides for the same tool:
Other tools you might find useful:
Open the full Border Builder — free, no account needed, works on any device.
Open Border Builder →Free · No account needed · Works on any device