Distressed and worn border style achieved with CSS

I'm attempting to replicate the unique teal colored border shown in the image link below:

https://i.sstatic.net/RewiB.png

The border displayed has an irregular pattern, with random breaks and fades. If achieving an exact match is not possible, I would like to get as close as I can.

Can this be accomplished using CSS? If not, are there any alternative methods to achieve a similar effect?

While there is a border-image property available, it requires a specific image which I lack the skills to create using software like Photoshop. Therefore, my options are limited to CSS or utilizing an existing image for the border. Any suggestions on where I could find suitable border images would be appreciated.

https://jsfiddle.net/2oeb569z/1/

HTML:

<div class="container">
  <div class="wrapper">
    <div class="content">

    </div>
  </div>
</div>

CSS:

.container {
  margin: auto;
  margin-top: 20px;
  width: 400px;
  height: 300px;
  background: #131313;
  position: relative;
}

.wrapper {
  position: absolute;
  margin-top: 30px;
  margin-left: 20px;
  width: 330px;
  height: 230px;
  background: white;
  padding: 10px 15px;
}

.content {  
  height: 90%;
  border: 0px solid teal;
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(teal), to(transparent));
  background-image: -webkit-linear-gradient(teal, transparent);
  background-image: -moz-linear-gradient(teal, transparent), -moz-linear-gradient(teal, transparent);
  background-image: -o-linear-gradient(teal, transparent), -o-linear-gradient(teal, transparent);
  background-image: linear-gradient(teal, transparent), linear-gradient(teal, transparent);
  -moz-background-size: 7px 100%;
  background-size: 7px 100%;
  background-position: 0% 0, 100% 0;
  background-repeat: no-repeat;
}

Answer №1

Add a touch of creativity by designing an image with unique randomly faded borders. This image can be scaled to fit any object where a border is desired. Utilize cropping techniques to create the perfect border effect. For added customization, consider creating separate images for the top and left borders.

Answer №2

Looking for some border frames? Check out this collection here, most of them are in psd format.

To customize these frames, you'll need to use photoshop or create your own from scratch using the same tool. Using border images is a simple way to achieve the desired effect.

Answer №3

Check out this cool effect I made using gradients! Feel free to experiment with different images as well.

  #grad1 {

height: 200px;
width:300px;
background: -webkit-repeating-linear-gradient(90deg,#eaeaea,#fbfbfb 7%,#e6e6e6 10%); /* For Safari 5.1 to 6.0 */
background: -o-repeating-linear-gradient(); /* For Opera 11.1 to 12.0 */
background: -moz-repeating-linear-gradient(90deg,#eaeaea,#fbfbfb 7%,#e6e6e6 10%);/* For Firefox 3.6 to 15 */
background: repeating-linear-gradient(90deg,#eaeaea,#fbfbfb 7%,#e6e6e6 10%); /* Standard syntax (must be last) */

}
<!DOCTYPE html>
<html>
<head>


</head>
<body>


<div id="grad1"></div>



</body>
</html>

Answer №4

maybe this is a solution?

border: 2px solid rgba(79, 211, 255, 0.2);

utilizing the rgba(red, green, blue, opacity) function enables you to define a color with a certain level of transparency, allowing for the creation of fade effects

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for automatically scrolling images horizontally in responsive layouts

Recently, I've been working on a website called . On the homepage, my portfolio images are arranged in a grid format using the <li> tag. I'm looking to align them side by side and have them scroll horizontally automatically, preferably with ...

In order to achieve a sliding effect for the second div, it can be programmed to

Currently, I am working on implementing hide and show functionality in my project. However, I have come across a bug in my code that I need assistance with. When clicking on the first div element, the content opens from bottom to top instead of the desired ...

Creating a suggestion box within an HTML container using JavaScript

https://i.sstatic.net/Asi5r.pngI am currently working on a page where users can click on a word and receive a small suggestion box (like a tiny popup) to choose synonyms they prefer. Although I believe this can be achieved with JavaScript, I haven't ...

Learn how to dynamically assign a new ID and name to a cloned div element using jQuery based on the original element's ID

Within a DIV, there are two Input Textboxes present. I am attempting to duplicate the above div, meaning I want two additional textboxes cloned from the original ones. However, I am encountering challenges when it comes to assigning new IDs and Names to ...

Utilizing inline-block for styling code blocks

I'm attempting to format two blocks with varying lengths using inline-block, but block-1 is getting aligned with the length of block-2. I need to keep the height of block-1 at 100px. Check out this jsfiddle for reference: http://jsfiddle.net/CGHZ5/5 ...

Is there a distinction between em and percentage measurements and do their defaults have specified definitions?

Both em and percentage are defined in relation to other elements or properties. For example, with text-indent, it is related to the width of the paragraph, while with font size, it is related to the browser's default size. The question arises - wh ...

Implement the slide toggle function of jQuery on the PHP loop-generated results

Need help with my PHP code. I have a while loop that outputs the variable $the_job_id and I want to apply jQuery slidetoggle to each output. The issue is that slidetoggle only works for the first output in the loop. Can anyone suggest how I can modify my c ...

Transitioning the CSS background for a lightbox display

I am currently experimenting with creating an image that fades in along with its background when clicked using the :target selector. (Similar to Lightbox: , but done purely with CSS). Here is the HTML: <a href="#firstimg"><img src="img/thumb-3.j ...

Issue with Font Awesome (6.2) Duotone not displaying correctly in Bootstrap 5 breadcrumb divider

I attempted to modify the Bootstrap 5.2 breadcrumb divider and include a Font Awesome Duotone icon, but it is not displaying. I am unable to figure out what the issue might be. Any suggestions would be greatly appreciated. Thank you. One interesting disco ...

Using colored circles in ASP Dropdownlist ListItems (without jQuery): A step-by-step guide

Objective: To create a Dropdown list that displays a green circle if someone's Availability is True, and a red circle if someone's Availability is False. Note: The task needs to be accomplished without the use of jQuery, as it is restricted in t ...

To reveal the secret map location, just tap on the button - but remember, this only applies to

I am encountering an issue with duplicating a card and toggling the hidden location map. Currently, the location button only works for the first card and not for the rest. I need each card to independently open and hide the location map when clicked on the ...

How can I remove the unsightly scrollbar caused by overflow: auto?

I've encountered a problem while working on my website. The inner div #content wasn't expanding to the full size of the page, causing the text to overflow messily over the background image and making it difficult to read. I initially used overflo ...

ways to eliminate horizontal scrollbar on iframes in Google Chrome

Is there a way to enable vertical scrolling while keeping horizontal scrolling turned off? I've attempted using scrolling="no", but that disables both vertical and horizontal scrolling. I've also experimented with CSS: #myiframe{ overflo ...

JavaScript form with radio buttons

I'm completely new to JavaScript and I'm attempting to create a basic script that will show one form when a radio button is checked, and another form when the second radio button is clicked (with no form displayed when neither is selected). I kno ...

Create a web design where two HTML elements with full width are positioned to overlap each other,

I am facing a design challenge where I need sections to span the full width of the page, but the content is contained within an article. Additionally, there is an interactive aside that needs to float above the full-width sections. Both the article and as ...

how to dynamically add classes in jsx with a combination of tailwind and regular classes

Why is it that in Nextjs 14 (ReactJS 18), when I conditionally assign css classes within a jsx code like this: <Swiper className={lightbox ? "swiperLightbox h-[80%] md:h-[70vh] z-50" : "swiperMain h-[21vmax] rounded-xl"} > ...

Experience the ultimate in slider automation with the cutting-edge power of

Here is an example of a website plugin I used on my site. You can check it out by clicking here. However, I'm having trouble automating the events that occur when the item slider is clicked. I would like to make these events happen automatically with ...

How about mixing up your backgrounds with an overlay effect for a unique look?

Hey there, I'm currently working on adding random backgrounds to my website through an overlay, but I've hit a roadblock when it comes to displaying them. Here is the code I'm working with: .css / .php #intro { background: ...

Resizing logo to fit Outlook desktop

https://i.sstatic.net/e34kS.pngWhen creating emails using a Drag & Drop editor in a CRM (Dynamics 365 with ClickDimensions), I encountered an issue with the logo not displaying correctly in Outlook desktop. Despite using inline styling, the logo appeared f ...

Each element in Sass is assigned the same index value in a loop

Seeking to add animations to various div elements with unique delay times, I encountered a puzzling issue. Despite following online tutorials closely (such as this one), the animation delays remain consistent for all divs. The loop I have is as follows: @ ...