how to make a raised border

How to Create a Raised Border

By James Moore
AD

Adding a raised border to your text or images can significantly enhance their appearance, making them stand out on a webpage or document. This simple design element can create a sense of separation, draw attention, and add a touch of elegance. Here, we'll guide you through the process of creating a raised border using CSS, the standard language for styling web pages.

Before we dive into the steps, ensure you have a basic understanding of HTML and CSS. If you're new to these, don't worry; we'll keep the explanations simple and straightforward. Let's get started!

Understanding Raised Borders

In CSS, a raised border is typically achieved using the box-shadow property. This property allows you to add shadow effects around an element, giving it a 3D appearance. By strategically placing the shadow, you can create the illusion of a raised border.

AD
a woman laying bricks on the ground with text overlaying it that reads beginner's diy how to install a brick border
a woman laying bricks on the ground with text overlaying it that reads beginner's diy how to install a brick border
easy diy No Dig Border
easy diy No Dig Border
16 Budget-Friendly Edging Ideas You Can Do Now 💰🌿
16 Budget-Friendly Edging Ideas You Can Do Now 💰🌿

In this tutorial, we'll create a raised border using box-shadow and explore different variations to suit various design needs.

Basic Raised Border

To create a basic raised border, we'll use the box-shadow property with the following syntax: box-shadow: horizontal offset vertical offset blur radius spread radius color.

DIY Garden Bed Edging Anybody Can Do
DIY Garden Bed Edging Anybody Can Do
Landscaping
Landscaping
DIY Garden Bed Edging Just About Anyone Can Do
DIY Garden Bed Edging Just About Anyone Can Do

For a simple raised border, set the horizontal offset to a positive value (like 5px), the vertical offset to a negative value (like -5px), and the blur radius to a small value (like 2px). Here's an example:

```css .element { box-shadow: 5px -5px 2px rgba(0, 0, 0, 0.2); } ```

In this example, the element will have a subtle raised border with a slight shadow cast downwards and to the right.

AD

Raised Border with Inscription

Sometimes, you might want to add a raised border to text within an element. To achieve this, you can wrap the text in a span tag and apply the box-shadow to that span.

the front yard has been cleaned and ready to be used as a flower bed
the front yard has been cleaned and ready to be used as a flower bed
15 DIY Garden Border Ideas That Cost Almost Nothing to Install
15 DIY Garden Border Ideas That Cost Almost Nothing to Install
DIY Retaining Wall Construction for a Beautiful Garden - Jennifer Maker
DIY Retaining Wall Construction for a Beautiful Garden - Jennifer Maker
How to Create an Edging for Your Garden
How to Create an Edging for Your Garden
Top 37 Garden Edging Border Ideas: Spruce Up The Landscape
Top 37 Garden Edging Border Ideas: Spruce Up The Landscape
7 Easy DIY Edging and Garden Border Ideas That Make Any Backyard Look Expensive! #5 Feels Like Magic
7 Easy DIY Edging and Garden Border Ideas That Make Any Backyard Look Expensive! #5 Feels Like Magic

Here's an example using the same shadow properties as above:

```css .element { position: relative; padding: 10px; } .element span { box-shadow: 5px -5px 2px rgba(0, 0, 0, 0.2); position: relative; display: inline-block; } ```

In this case, the text within the span tag will have a raised border, while the rest of the element remains unaffected.

AD

Advanced Raised Border Techniques

Now that we've covered the basics, let's explore some advanced techniques to create more intricate raised borders.

25 Garden Border Ideas That Make Your Garden Beds Look Neat And Beautiful 2026
25 Garden Border Ideas That Make Your Garden Beds Look Neat And Beautiful 2026
a man is using a power drill to build a raised garden bed in the yard
a man is using a power drill to build a raised garden bed in the yard
an olive tree growing in the middle of a garden with dirt and mulch around it
an olive tree growing in the middle of a garden with dirt and mulch around it
Easy Landscaping Border - Rooms For Rent blog
Easy Landscaping Border - Rooms For Rent blog
How To Install Brick Garden Borders…The Easy Way!
How To Install Brick Garden Borders…The Easy Way!
20 Creative And Easy Flower Border Ideas
20 Creative And Easy Flower Border Ideas
30 Brick Flower Bed Borders
30 Brick Flower Bed Borders
How to Maintain Garden Edging Stones - On Sutton Place
How to Maintain Garden Edging Stones - On Sutton Place
How to Design a Beautiful Perennial Border
How to Design a Beautiful Perennial Border
a brick garden border is shown with the words diy reclaimed brick garden borders on it
a brick garden border is shown with the words diy reclaimed brick garden borders on it
37+ Cheap & Easy Lawn Edging Ideas
37+ Cheap & Easy Lawn Edging Ideas
a man laying bricks on the ground to make a walkway for his house or garden
a man laying bricks on the ground to make a walkway for his house or garden
How to make saw-tooth brick garden edging
How to make saw-tooth brick garden edging
DIY Brick Garden Edging
DIY Brick Garden Edging

Dual-Color Raised Border

To create a dual-color raised border, you can use multiple box-shadow declarations. This technique allows you to have different colors for the inner and outer shadows, creating a more pronounced 3D effect.

Here's an example:

AD
```css .element { box-shadow: 5px -5px 2px rgba(0, 0, 0, 0.2), 10px -10px 4px rgba(255, 255, 255, 0.5); } ```

In this example, the first shadow creates the main raised border, while the second, larger, and lighter shadow enhances the 3D effect.

Rounded Raised Border

To create a raised border with rounded corners, you can combine the box-shadow property with border-radius.

Here's an example:

```css .element { box-shadow: 5px -5px 2px rgba(0, 0, 0, 0.2); border-radius: 5px; } ```

In this case, the element will have a raised border with rounded corners.

And there you have it! You now know how to create various types of raised borders using CSS. Experiment with different values and colors to find the perfect raised border for your project. Happy designing!

AD