Favorite places of your favorite city
Home
Add to preferred sources on Google

CSS Border Generator

Build a border for each edge of a box. Adjust widths, styles, colors and opacity, compare the native preview, then copy CSS for your page.

Preview

Preview only: the entire 340 × 260 px canvas is scaled to fit.

Border settings

Top
Right
Bottom
Left

Preview and CSS

Border CSS

Existing border images are removed; radius and box layout are not included.

None and hidden use no border space on this box. A transparent solid border still occupies space. Browser rendering and corner joins can vary.

Settings stay on this page; Copy writes the current CSS only when requested.

How to build a border

  1. Edit Top, Right, Bottom and Left independently. For a uniform border, set Top first and select Apply top to all; this copies its current settings once rather than linking later edits.
  2. Check the preview and try a light, dark or checkerboard backdrop to inspect transparency. Its square corners, fill, padding, size and fit scale are preview context and are not part of the copied CSS.
  3. Complete any invalid fields before copying. Copy the five displayed declarations into your rule, after any earlier border reset. If clipboard access is unavailable, select the CSS field and copy it manually.

Understanding the generated border

Every side has its own width in CSS pixels, style, RGB color and opacity. Widths range from 0 to 64 with up to three decimal places. A dot or comma is a decimal separator, never a thousands separator; the output always uses a CSS decimal dot.

The editor offers none, hidden, dotted, dashed, solid, double, groove, ridge, inset and outset. The last four produce shaded effects using browser rendering. Very thin double borders remain valid even when two separate lines are difficult to see.

None and hidden draw no border on the ordinary preview box, and their border widths resolve to zero. Your entered widths and colors stay in the CSS so changing the style restores them. A zero-width edge also draws nothing; a transparent solid edge still takes up space.

Opaque colors use six-digit hex. Lower opacity uses rgba with the same RGB channels and an alpha value from zero to less than one. For example, #ABCD09 at 7% becomes rgba(171, 205, 9, 0.07); zero opacity keeps the color's channels rather than removing the border.

The first declaration removes existing border images. Four side declarations then set all physical edges. The output leaves radius, box sizing, padding, background and dimensions alone. Later or more specific rules can override it; use the Border Radius tool separately for rounded corners.

Border examples

For a uniform frame, use 4px solid #2563EB at full opacity on every side. The preview has a 160 by 80 content area and 10px padding, so its unscaled outer layout is 188 by 108 CSS pixels. Those layout settings are not exported.

For an asymmetric frame, try top 4px solid #123456, right 2px dashed #ABCDEF, bottom 6px double #804020 and left 8px ridge #408060. With the same preview context its integer outer layout is 190 by 110 CSS pixels; each side keeps its own appearance.

For a left accent, apply a 0px solid border to all sides, then change Left to 6px and a chosen color. The other sides remain independently editable. No hidden linked mode changes them when you adjust Left later.

To compare invisible borders, set Top to 9px none and Bottom to 6px solid with zero opacity. Top uses no border space in this ordinary box; Bottom still reserves 6px. The checkerboard can help show where the transparent edge sits.

Scope and rendering differences

This is a bounded editor, not a parser for arbitrary CSS. It accepts pixel widths, six-digit RGB hex and integer opacity. Relative units, width keywords, named colors, currentColor, variables and pasted declaration blocks are outside its input grammar.

Dash spacing, double-line division, shaded styles, mixed-style corners and fractional-pixel painting can vary between browsers. The preview uses native CSS; it does not promise identical physical pixels on every display.

Top, Right, Bottom and Left are physical sides. This editor does not author logical borders, outline or image/gradient borders. Its ordinary-box preview does not reproduce collapsed-table conflict rules, where hidden and none differ.

The five declarations intentionally remove image borders but do not set corner radius or box layout. The receiving page can therefore look different when its surrounding styles differ. Border color and this preview alone do not establish accessibility of a complete interface.

Editing and clipboard privacy

Border settings are processed in this page without uploading them for CSS generation. The tool does not read your clipboard, load a user-supplied image or save settings in a URL or persistent store. Copy attempts to write only the current valid declarations when you request it.

CSS border questions

No. Each side has its own settings. Apply top to all copies Top into the other three sides once; later edits remain independent. Reset returns every side and the preview backdrop to their initial settings.

On an ordinary box, those styles resolve the border width to zero. The authored 9px remains in the generated declaration, so switching to a visible style can restore it. Hidden and none have different priorities in collapsed tables, which this preview does not model.

No. A fully transparent solid border still occupies its border width. None, hidden or width zero removes that border space in the ordinary preview. Opacity changes color transparency rather than changing the style or authored width.

It deliberately removes an earlier image border so the four generated line borders can take effect consistently. This reset is part of the displayed and copied output, including when all four sides have identical settings.

No. The preview uses a square, fixed content-box specimen with padding and a chosen backdrop. Those context values are not exported, and the declarations leave an existing radius untouched. Use the separate Border Radius tool if you need to author rounded corners.

Browsers control details such as dash spacing, line division, corner joins, shading and pixel snapping. Very thin widths remain valid. Test the copied declarations in the browser and surrounding layout where you will use them.

The attempt uses the valid CSS snapshot from its click. Editing does not change bytes already handed to the browser, but the old attempt cannot publish a stale success or manual-copy message. The visible output always represents the current complete settings.

Sources

These references describe the CSS used by this ordinary-box editor.

The preview is an ordinary box, not a collapsed table.

CSS Filter Generator

Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.

Open tool — CSS Filter Generator

Fluid Font Size Calculator

Create root-relative CSS from viewport endpoints and inspect the copied size model.

Open tool — Fluid Font Size Calculator

CSS Button Generator

Style native button states, inspect keyboard focus and copy HTML and CSS.

Open tool — CSS Button Generator

CSS Background Pattern Generator

Create editable stripes, grids, dots and checkerboards. Preview colors and transparency locally, then copy the current CSS declarations.

Open tool — CSS Background Pattern Generator

CSS Clip Path Generator

Edit polygon points and basic shapes, preview the clipping and copy CSS.

Open tool — CSS Clip Path Generator

CSS Border Radius Generator

Edit eight corner radii, preview a box and copy CSS in pixels or percentages.

Open tool — CSS Border Radius Generator

CSS Grid Generator

Build a bounded CSS Grid example with editable tracks, placement and named areas. Preview it, copy CSS or HTML and download the same standalone example.

Open tool — CSS Grid Generator

CSS Flexbox Generator

Build a Flexbox example with container and item controls, explicit layout axes, matching CSS and HTML, and a local complete-example download.

Open tool — CSS Flexbox Generator

CSS Text Shadow Generator

Build ordered text shadows, preview plain text and copy exact CSS.

Open tool — CSS Text Shadow Generator

CSS Transform Generator

Compose repeatable 2D CSS transforms, edit px or percentage translation and origin, inspect a reference box and copy the exact current declarations.

Open tool — CSS Transform Generator

CSS Cubic Bezier Generator

Edit CSS cubic-bezier curves with coordinates, visual handles and presets. Inspect overshoot, run a deliberate comparison with linear motion, and copy easing CSS.

Open tool — CSS Cubic Bezier Generator

CSS Box Shadow Generator

Create ordered CSS box-shadow layers with a live preview and copyable code.

Open tool — CSS Box Shadow Generator

HTML to Markdown

Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.

Open tool — HTML to Markdown

JavaScript Regex Tester

Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.

Open tool — JavaScript Regex Tester

Markdown to HTML

Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.

Open tool — Markdown to HTML

CSS Gradient Generator

Create linear or radial CSS gradients with editable colors, opacity and stops.

Open tool — CSS Gradient Generator

Color Converter

Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.

Open tool — Color Converter

HTML Entity Encoder/Decoder

Encode or decode literal HTML references with explicit context, Unicode options and LF output, without parsing or rendering markup.

Open tool — HTML Entity Encoder/Decoder

Markdown Table Generator

Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.

Open tool — Markdown Table Generator

HTML Table Generator

Build a rectangular table with captions and headers, then copy HTML and CSS.

Open tool — HTML Table Generator

Query String Parser & Builder

Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.

Open tool — Query String Parser & Builder

URL Encoder & Decoder

Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.

Open tool — URL Encoder & Decoder

Color Contrast Checker

Compare foreground and background colors, adjust opacity and check WCAG numerical contrast thresholds for text and essential interface details.

Open tool — Color Contrast Checker

Base64 Encoder & Decoder

Encode UTF-8 text as standard or URL-safe Base64, or decode either format with clear errors and complete text output.

Open tool — Base64 Encoder & Decoder
View all tools in this category