diff --git a/content/hue-manipulation-color-mix/index.md b/content/hue-manipulation-color-mix/index.md index 010c3fd5..9b3c3dad 100644 --- a/content/hue-manipulation-color-mix/index.md +++ b/content/hue-manipulation-color-mix/index.md @@ -38,7 +38,4 @@ The same can be done using relative colors but the support is still low:

-## Related Links -* [https://developer.chrome.com/articles/high-definition-css-color-guide/](https://developer.chrome.com/articles/high-definition-css-color-guide/) -* [https://www.w3.org/TR/css-color-5/#color-mix](https://www.w3.org/TR/css-color-5/#color-mix) diff --git a/content/overlapping-border-image/image.png b/content/overlapping-border-image/image.png new file mode 100644 index 00000000..c1fa487c Binary files /dev/null and b/content/overlapping-border-image/image.png differ diff --git a/content/overlapping-border-image/index.md b/content/overlapping-border-image/index.md new file mode 100644 index 00000000..5651f518 --- /dev/null +++ b/content/overlapping-border-image/index.md @@ -0,0 +1,41 @@ +--- +layout: layouts/post.njk +title: Overlapping border on images with hover effect +description: Add an overlapping border to your image with cool hover effect +date: 2023-07-06 +tags: posts +--- + +Add an overlapping border to your image with a nice hover effect +* No extra element (only the `` tag) +* No pseudo-element +* 10 CSS declarations +* Optimized with CSS variables + +{% image "./image.png", "images with overlapping border" %} + +```css +img { + --c: #F9CDAD; /* the main color */ + --b: 8px; /* thickness of the border */ + --o: 25px; /* control the offset */ + + width: 200px; /* the image size */ + --_p: calc(2*var(--o) + var(--b)); + padding: var(--_p) var(--_p) 0 0; + outline: var(--b) solid var(--c); + outline-offset: calc(var(--o) - var(--_p)); + transition: .4s; +} +img:hover { + padding: calc(var(--_p)/2); +} +``` + +

+ See the Pen + Overlapping border on image (with hover effect) by Temani Afif (@t_afif) + on CodePen. +

+ +