Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8616853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:43:02+00:00 2026-06-12T05:43:02+00:00

How to apply an inset border into an HTML element, but just only on

  • 0

How to apply an inset border into an HTML element, but just only on one side of it.
Until now, I’ve been using an image to do that (GIF/PNG) that I would then use as a background and stretch it (repeat-x) and position a little off from the top of my block.
Recently, I discovered the outline CSS property, which is great! But seems to circle the whole block…
Is it possibly to use this outline property to do it on just only one border?
Also, if not, do you have any CSS trick that could replace the background image? (so that I could personalize the colors of the outline later using CSS, etc).

Here’s an image of what am trying to achieve:
http://exiledesigns.com/stack.jpg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:43:03+00:00Added an answer on June 12, 2026 at 5:43 am

    Outline indeed does apply to the whole element.

    Now that I see your image, here’s how to achieve it.

    .element {
      padding: 5px 0;
      background: #CCC;
    }
    .element:before {
      content: "\a0";
      display: block;
      padding: 2px 0;
      line-height: 1px;
      border-top: 1px dashed #000; 
    }
    .element p {
      padding: 0 10px;
    }
    <div class="element">
      <p>Some content comes here...</p>
    </div>

    (Or see external demo.)

    All sizes and colors are just placeholders, you can change it to match the exact desired result.

    Important note: .element must have display:block; (default for a div) for this to work. If it’s not the case, please provide your full code, so that i can elaborate a specific answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to apply style only to the myPage id. But I am not
I've been trying to add HTML content to a web view, but can't seem
I'm trying to use CROSS APPLY in SQL, but only want to use the
Is it possible to apply 2 box-shadows to a HTML element at once? I
I'm trying to apply border-radius effect on a particular div. The code I used
Is it possible to apply a workflow in Sitecore only for a particular user?
I want to apply texture to the transparent png(bitmap), but I don't want to
I need to apply tint effect on image in Android . But the tint
I am trying to insert data from one of my existing table into another
I'm building a browser extension that will insert a chunk of HTML into some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.