Two ways:
<img src="..." border="1" />
or
<img style='border:1px solid #000000' src="..." />
Answer from Diodeus - James MacFarlane on Stack OverflowMDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-image
border-image - CSS | MDN - Mozilla
The border-image CSS property draws an image around a given element. It replaces the element's regular border.
W3Schools
w3schools.com › css › css3_border_images.asp
CSS Border Images
With the CSS border-image property, you can define an image to be used as the border around an element.
Videos
02:32
How to Add Border to an Image in HTML and CSS - YouTube
04:02
CSS Basics - Border-Image - YouTube
15:15
CSS Border Image Property | Border Images in CSS | CSS Tutorial ...
04:44
How To Use CSS3 Border Image Property [CSS tutorial] - YouTube
03:15
Unique Borders using the CSS Border-Image property. - YouTube
14:25
The border property you never knew you needed - YouTube
W3Schools
w3schools.com › cssref › css3_pr_border-image.php
CSS border-image property
❮ Previous Complete CSS Reference ... · More "Try it Yourself" examples below. The border-image property allows you to specify an image to be used as the border around an element....
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Guides › Backgrounds_and_borders › Border-image_generator
Border-image generator - CSS - MDN Web Docs
November 20, 2025 - This tool can be used to generate CSS border-image values.
Neocities
solaria.neocities.org › guides › borderimage
Using and Making CSS Border Images
You can use the CSS property border-image to give a custom border to any element, without having to put it in an additional container.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border-image
border-image - CSS - MDN Web Docs - Mozilla
The border-image CSS property draws an image around a given element. It replaces the element's regular border.
HTML AM
html.am › html-codes › image-codes › html-image-borders.cfm
HTML Image Borders
You create HTML image borders by using Cascading Style Sheets (CSS). Specifically, you use the CSS border property. You can also use other CSS properties to create HTML borders (such as border-width, border-style and border-color), but these don't do anything that border doesn't do.
Programiz
programiz.com › css › border-image
CSS border-image Property (With Examples)
CSS border-image property sets the image as a border of an element. In this tutorial, you will learn about CSS border-image with the help of examples.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border-image-source
border-image-source - CSS - MDN Web Docs
August 5, 2025 - The border-image-source CSS property sets the source image used to create an element's border image.
W3Schools
w3schools.com › howto › howto_css_border_image.asp
How To Add a Border to an Image
Learn how to add a border around an image. Use the border property to add a border to an <img> element: img { border: 5px solid #555; } Try it Yourself » · Go to our CSS Images Tutorial to learn more about how to style images.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-image-slice
border-image-slice - CSS - MDN Web Docs - Mozilla
December 5, 2025 - The sampled image size is scaled to fit inside the border, which means that if the width is bigger than the slice, the image can start to look somewhat pixelated (unless of course you use an SVG image). ... <div class="wrapper"> <div></div> </div> <ul> <li> <label for="width">slide to adjust <code>border-width</code></label> <input type="range" min="10" max="45" id="width" /> <output id="width-output">30px</output> </li> <li> <label for="slice">slide to adjust <code>border-image-slice</code></label> <input type="range" min="10" max="45" id="slice" /> <output id="slice-output">30</output> </li> </ul>
OpenReplay
blog.openreplay.com › mastering-border-images-in-css
Mastering Border Images in CSS
July 23, 2025 - The first box demonstrates a classic CSS border: a simple, solid brown line without intricate patterns or designs. The second box replaces the solid border with an image border. The border displays the content of the image.png file around the box, potentially featuring intricate patterns, textures, or designs, depending on the image’s content.
Border Image
border-image.com › home
Border Image CSS Code Generator - Easy Image Border - Border Image
April 8, 2025 - Basically, a border image property ... how the browser should apply the sections to the edges of the elements. In CSS, is written as, ‘.module { border-image: url(border.png);}’. The property specifies the border image’s source which can either be a data URI, URL, inline SVG ...
DigitalOcean
digitalocean.com › community › tutorials › css-gradient-borders-pure-css
How To Add Border Images and Gradient Borders with Pure CSS | DigitalOcean
April 8, 2021 - Learn how to use border images and gradients borders with border-image-source and border-image-slice.