CSS Tip: Learn CSS the easy way The best place to keep up to date with the new CSS features. Daily CSS tips and tricks to become a better web developer. 2024-11-26T00:00:00Z https://css-tip.com/ Temani Afif Full-bleed layout with modern CSS 2024-11-26T00:00:00Z https://css-tip.com/full-bleed-layout/ <![CDATA[

Use modern CSS and a few lines of code to create a full-bleed layout.

Full-bleed? It's when an element needs to bleed outside the main container and extend to the edge of the page.

CSS-only zig-zag borders

Read more

]]>
How to correctly use steps() with animations 2024-11-18T00:00:00Z https://css-tip.com/steps/ <![CDATA[

You want to create a discrete animation using steps() but you struggle with its value, right? You never know how many steps it requires and it never works as expected!

In most cases, adding an extra value will fix your issue.

Read more

]]>
Vertical rounded tabs using CSS mask 2024-11-15T00:00:00Z https://css-tip.com/vertical-rounded-tab/ <![CDATA[

Updating the previous rounded tab shape to create the vertical version using the same code structure.

  • No extra element & No pseudo-element
  • One variable to control the curvature
  • Works with gradient coloration
  • Powered by CSS mask

CSS-only vertical rounded tabs using CSS mask

Read more

]]>
Get the scrollbar width using only CSS 2024-11-14T00:00:00Z https://css-tip.com/width-scrollbar/ <![CDATA[

Do you want to know the scrollbar width? It's possible using only CSS and a few lines of code! You can get the pixel value within a CSS variable and use it everywhere.

As a bonus, you can also have an integer value!

Read more

]]>
Folded rectangle shapes using CSS mask 2024-11-08T00:00:00Z https://css-tip.com/folded-rectangle/ <![CDATA[

Create folded rectangle shapes with a subtle 3D effect

  • Single element (no pseudo-element)
  • Optimized with CSS Variables
  • Powered by CSS mask

CSS only folded rectangle shapes

Read more

]]>
Indent each line of your text 2024-11-04T00:00:00Z https://css-tip.com/text-indent/ <![CDATA[

Do you know that text-indent can take an extra value each-line? It allows you to have an indentation after each line! Useful if you rely on <br> to add new lines.

Read more

]]>
Select the last occurrence of an element in the whole document 2024-10-31T00:00:00Z https://css-tip.com/last-element-dom/ <![CDATA[

We saw the selector for the first occurrence and here is the selector for the last occurrence.

Read more

]]>
Select the first occurrence of an element in the whole document 2024-10-30T00:00:00Z https://css-tip.com/first-element-dom/ <![CDATA[

A CSS selector to select the first occurrence of an element regardless of its position in the document. The equivalent of document.querySelector('.target').

Read more

]]>
3D parallax effect on hover 2024-10-23T00:00:00Z https://css-tip.com/3d-parallax-effect/ <![CDATA[

After the previous effect, I am trying another concept of 3D parallax effect with a better illusion!

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 15 CSS declarations

A 3D parallax effect on images

Read more

]]>
How to correctly define a one-color gradient 2024-10-21T00:00:00Z https://css-tip.com/one-color-gradient/ <![CDATA[

Learn the correct way to create a one-color gradient with an optimized code. Stop using default values and save some space!

All the below are the same. You can save up to 32 chars!

Read more

]]>
Avatar hover effect with a rhombus shape 2024-10-18T00:00:00Z https://css-tip.com/avatar-rhombus/ <![CDATA[

Place you image inside a rhombus shape with a cool hover effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 15 CSS declarations

CSS-only images with a rhombus shape

Read more

]]>
Inner display vs Outer display 2024-10-16T00:00:00Z https://css-tip.com/inner-outer-display/ <![CDATA[

Do you know that the below declarations are the same?

Read more

]]>
Puzzle shapes using CSS mask 2024-10-09T00:00:00Z https://css-tip.com/puzzle-shape/ <![CDATA[

Create different kind of puzzle shapes using a few lines of code

  • Single element (Works with <img>)
  • Optimized with CSS variables
  • Powered by CSS mask

CSS-only puzzle shapes

Read more

]]>
The Filling CSS loaders Collection 2024-10-04T00:00:00Z https://css-tip.com/filling-loader/ <![CDATA[

Adding a new set of loaders to the biggest collection of loading animations.

The Filling CSS Loaders Collection #

CSS-only single element loaders

One example:

Read more

]]>
Default behavior of position absolute 2024-09-30T00:00:00Z https://css-tip.com/initial-containing-block/ <![CDATA[

Many have a wrong information about the default behavior of position: absolute element.

"if an absolute positioned element has no positioned ancestors, it uses the body element" NO, this is false!

The W3Schools page is showing a wrong information but the MDN page is showing the correct one.

Screenshot from W3schools showing a wrong information about position: absolute Screenshot from MDN showing a correct information about position: absolute

What is the initial containing block?

It's a rectangle having the same dimension as the viewport (full width/height) and anchored at the canvas origin (moves on scroll). In other words, it's similar to the viewport but moves if we have scrolling.

Here is a demo to illustrate:

Read more

]]>
Animate to height/width auto (without hacks) 2024-09-25T00:00:00Z https://css-tip.com/animate-height-auto/ <![CDATA[

Only three lines of code and you have a smooth transition to height: auto

Read more

]]>
Remove the unit from any CSS value 2024-09-19T00:00:00Z https://css-tip.com/length-to-integer/ <![CDATA[

Do you want to convert a length value to a unitless value?

It's possible to remove the unit from any CSS value to get an integer!

⚠️ A hacky experimentation to use with caution ⚠️

Read more

]]>
Update CSS variables using range slider 2024-09-16T00:00:00Z https://css-tip.com/css-variables-range-slider/ <![CDATA[

Using scroll-driven animations, you can link a CSS variable with a range slider and easily update its value!

No more JavaScript to do this. A few lines of CSS, one HTML element and you can update any value in real time.

Read more

]]>
Progress element with a tooltip 2024-09-10T00:00:00Z https://css-tip.com/progress-with-tooltip/ <![CDATA[

Adding a tooltip to the native progress element showing the percentage of progress.

  • No extra elements (only the <progress> tag)
  • No inline CSS
  • Everything is controlled by the "max" and "value" attributes
  • Powered by Scroll-Driven animations, anchor positioning & @property

CSS-only progress element with a tooltip

It's a Chrome-only experimentation:

Read more

]]>
Curved avatar header with hover effect 2024-08-29T00:00:00Z https://css-tip.com/fancy-avatar-header/ <![CDATA[

I am using the inner curve/notch shape to create a fancy header with an avatar and a cool hover effect.

  • No complex HTML code
  • Powered by CSS mask, @property and math functions
  • Optimized with CSS variables

CSS only curved header with avatar

Read more

]]>
Inner curve/notch shape using CSS mask 2024-08-28T00:00:00Z https://css-tip.com/inner-curve-notch/ <![CDATA[

Create an inner curve/notch shape using CSS mask and a few lines of code

  • Only one element
  • No pseudo-element
  • Works with gradients & images
  • Optimized with CSS variables

CSS only inner curve/notch shape

Read more

]]>
Quantity queries using has() selector 2024-08-26T00:00:00Z https://css-tip.com/quantity-queries/ <![CDATA[

Adjust the below to get your quantity query selector!

Select if it has and child elements

Read more

]]>
A decorative line with rounded dashes 2024-08-15T00:00:00Z https://css-tip.com/line-rounded-dashes/ <![CDATA[

Create a nice decorative line with rounded dashes using a few lines of code

  • Only one element
  • Responsive (no cut or partial dash)
  • You can easily switch to the vertical version
  • Optimized with CSS variables

CSS-only decorative lines with rounded dashes

Code available here: css-shape.com/rounded-dashes

Resize the below demo to notice the responsive part

Read more

]]>
A CSS generator for wavy circle shapes 2024-08-13T00:00:00Z https://css-tip.com/wavy-circles/ <![CDATA[

Use an online generator to create fancy wavy circles in no time!

css-generators.com/wavy-circle

  • Only one element (no pseudo-elements)
  • Works with <img> element
  • Supports gradient coloration
  • Powered by CSS mask

CSS only wavy circles shape

Related: css-tip.com/wavy-circle

Read more

]]>
Arc shape with rounded edges 2024-08-07T00:00:00Z https://css-tip.com/arc-shape/ <![CDATA[

Create an arc shape with rounded edges using a few lines of CSS

  • Single element (no pseudo-element)
  • Less than 10 CSS declarations
  • Supports gradient coloration
  • Optimized with CSS variables

A 3D shine animation on image

Read more

]]>
Get the width of the scrollbar using only CSS 2024-07-31T00:00:00Z https://css-tip.com/scrollbar-width/ <![CDATA[

You can find a better implementation here: Get the scrollbar width using only CSS

"What is the width of the scrollbar?" A question we can answer using a few lines of modern CSS! No need for JavaScript and you get the value as a CSS variable defined at :root level.

Read more

]]>
Count the number of lines inside a text 2024-07-29T00:00:00Z https://css-tip.com/count-lines/ <![CDATA[

By adjusting the code of the previous tip (getting the width/height of any element) we can do some intresting counting. For example, we can count the number of lines inside a text.

Read more

]]>
Get the width & height of any element without JavaScript 2024-07-26T00:00:00Z https://css-tip.com/element-dimension/ <![CDATA[

Use modern CSS features to get the width and height of any element as CSS variables.

  • Powered by Scroll-Driven animations and @property
  • Unitless values so you can easily use them inside any formula
  • You can apply the trick to multiple elements on the page
  • You can make the variables available everywhere on the page

Read more

]]>
Calculate the scroll progress of an arbitrary element 2024-07-24T00:00:00Z https://css-tip.com/scroll-progress-2/ <![CDATA[

The same code of the previous trick can also be used to get the scroll progress of any element on the page. The only difference is the use of self inside the scroll() value.

Read more

]]>
Calculate the scroll progress of the page 2024-07-23T00:00:00Z https://css-tip.com/scroll-progress/ <![CDATA[

Get the scroll progress of the page as a CSS variable using a few lines of code

  • Powered by Scroll-Driven animations
  • Defined at the :root level (avaiable to all the elements)
  • Typed using @property
  • You can easily use it within any formula

Read more

]]>
Manual typography using Scroll-driven animations 2024-07-18T00:00:00Z https://css-tip.com/manual-typography/ <![CDATA[

Add a slider to adjust the font-size of your website using modern CSS features.

  • 0 JavaScript required (100% CSS)
  • Powered by Scroll-driven animations & @property
  • Easy to control using CSS variables

Read more

]]>
Typed CSS variables using @property 2024-07-17T00:00:00Z https://css-tip.com/typed-variables/ <![CDATA[

Stop defining your variables inside :root!

Use the @property instead and create "Typed CSS Variables"

  • Easy to debug using Dev tools
  • Implicit data validation
  • Can be animated if the type allows it
  • Available globally with a default value

Instead of doing this:

Read more

]]>
Get the screen width & height without JavaScript 2024-07-16T00:00:00Z https://css-tip.com/screen-dimension/ <![CDATA[

Get the screen width and height as pixel values using a few lines of CSS.

  • Powered by @property & trigonometric functions
  • Unitless values so you can easily use them inside any formula
  • Updates on screen resize (No need for JavaScript)

Read more

]]>
Border gradient with border-radius 2024-07-10T00:00:00Z https://css-tip.com/border-gradient/ <![CDATA[

Save this code for the future! It will be the easiest way to add a gradient coloration to borders while having rounded corners.

  • No pseudo-element
  • One gradient layer
  • Transparent background

CSS gradient border with border-radius

⚠️ There is no implementation yet, but it's good to know.

Read more

]]>
Inverted border-radius using CSS mask 2024-07-09T00:00:00Z https://css-tip.com/inverted-radius/ <![CDATA[

Use CSS mask to create an inverted radius corner with a minimal code.

  • No extra elements
  • No pseudo-elements
  • Optimized with CSS variables

CSS-only inverted border-radius

Read more

]]>
Circular progress using scroll-driven animations 2024-07-04T00:00:00Z https://css-tip.com/circular-progress/ <![CDATA[

Transforming the native progress element into a circular one.

  • No extra elements (only the <progress> tag)
  • No Magic Numbers
  • Everything is controlled by the "max" and "value" attributes
  • Powered by Scroll-Driven animations & @property

CSS-only circular progress element

It's a Chrome-only experimentation:

Read more

]]>
Grainy texture using CSS gradients 2024-07-02T00:00:00Z https://css-tip.com/grainy-texture/ <![CDATA[

Create a random-style background (grainy texture) using a few lines of code.

grainy background texture

Read more

]]>
Fancy hover effect with anchor positioning 2024-06-21T00:00:00Z https://css-tip.com/hover-anchor-positionning/ <![CDATA[

A few experiemntation usign Anchor Positioning to create fancy hover effects. Highlight the menu items with a sliding effect.

Read more

]]>
Cut-out shapes using clip-path 2024-06-19T00:00:00Z https://css-tip.com/cut-out-shapes/ <![CDATA[

A simple code to easily invert any shape created using clip-path: polygon(). An easy way to create Cut-out shapes.

CSS-only Cut-out shapes using clip-path

Read more

]]>
Custom range slider with tooltip II 2024-06-11T00:00:00Z https://css-tip.com/range-slider-tooltip-2/ <![CDATA[

After the previous concept, here is another idea of range slider. The tooltip will adjust its shape to stay within the boundaries of the slider. Even the radius will adjust when the tail get closer to the corners.

CSS-only range slider with tooltip

Powered by modern CSS features:

  • Scroll-Driven animations
  • Anchor Positioning
  • @property & CSS variables

Read more

]]>
Better text wrapping using text-wrap 2024-06-10T00:00:00Z https://css-tip.com/text-wrap/ <![CDATA[

Enhance your text wrapping using text-wrap. No more lonely words at the end of paragraphs, and titles will look much better.

Read more

]]>
Custom range slider with tooltip 2024-06-04T00:00:00Z https://css-tip.com/range-slider-tooltip/ <![CDATA[

Create a custom range slider with a tooltip showing the selected value. There is no JS to update the values, it's pure CSS with minimal HTML!

CSS-only range slider with tooltip

Read more

]]>
No more pixel rounding issues! 2024-05-25T00:00:00Z https://css-tip.com/pixel-rounding/ <![CDATA[

One line of code that looks strange and confusing. You may think it's not even CSS but it will save you many times in the future:

Read more

]]>
CSS-only background patterns with a minimal code 2024-05-21T00:00:00Z https://css-tip.com/css-pattern/ <![CDATA[

css-pattern.com: The Biggest Collection Of Background Patterns

  • A unique URL per pattern
  • Controls to adjust the size & colors
  • Easy navigation between the patterns
  • Optimized with CSS variables
  • One-click to copy the code

You can also surprise yourself with a random CSS Pattern!

CSS patterns made with CSS gradients

Read more

]]>
Single-digit inputs with one element (OTP) 2024-05-14T00:00:00Z https://css-tip.com/single-digit-inputs/ <![CDATA[

Turn a simple input into single-digit inputs using a few lines of CSS. Useful for One-Time Password fields.

  • No extra element (only the <input> element)
  • Less than 15 CSS declarations
  • Optimized with CSS variables

CSS-only One-Time Password field

Read more

]]>
A Sparkle shape with one gradient 2024-05-09T00:00:00Z https://css-tip.com/sparkle-shape/ <![CDATA[

How much code is needed to create a Sparkle shape? ✨

Only one gradient and you can easily get the border-only variation.

CSS-only sparkle shape

Read more

]]>
How to extract R,G,B Channels from a color 2024-05-08T00:00:00Z https://css-tip.com/rgb-channels/ <![CDATA[

Using the new relative color syntax, you can easily extract the R,G,B channels of any color and use them as separate colors.

Useful when you want to do some color manipulation.

Read more

]]>
The shortest selector for the root element 2024-05-06T00:00:00Z https://css-tip.com/root-selector/ <![CDATA[

To target the html element, you either use "html{}" or ":root{}" but thanks to CSS nesting you can simply use "&{}"

When used alone, the nesting selector will match the root element!

A one-character selector 🤯

⚠️ It has a lower specificity than html and :root

Read more

]]>
Avatar with status indicator 2024-04-30T00:00:00Z https://css-tip.com/status-indicator/ <![CDATA[

Use modern CSS to add a status indicator to your avatar using less than 10 CSS declarations and without extra elements.

  • Only the <img> tag
  • No pseudo-elements
  • Transparent gap
  • Optimized with CSS variables
  • Subtle animation on hover

CSS-only avatar with status indicator

Read more

]]>
Create CSS Shapes with a single element 2024-04-29T00:00:00Z https://css-tip.com/css-shapes/ <![CDATA[

css-shape.com: The Ultimate Collection of CSS-Only shapes

  • Single-element implementation
  • Optimized CSS code
  • Easy to customize
  • One click to copy the code

The modern way to create CSS Shapes

CSS Shapes The modern way

Read more

]]>
Write better CSS with modern CSS 2024-04-24T00:00:00Z https://css-tip.com/better-modern-css/ <![CDATA[

A lot of new CSS features can help you optimize your code and reduce redundancy.

  • CSS Nesting
  • CSS Variables
  • Media Query range features

Here is an example of a CSS code with a lot of redundancy

Read more

]]>
A fancy frame with Zig-Zag borders 2024-04-18T00:00:00Z https://css-tip.com/zig-zag-box/ <![CDATA[

Use modern CSS to create a fancy Zig-Zag border around images using a few lines of code.

  • Only one element (the <img> tag)
  • No pseudo-element
  • Optimized with CSS variables

⚠️ Not suitable for touch screen (the sharp edges may hurt you) use wavy borders

CSS-only zig-zag borders

Read more

]]>
A Modern way to create a star shape 2024-04-16T00:00:00Z https://css-tip.com/star-shape/ <![CDATA[

Create a Star shape using clip-path and only 5 points instead of 10.

Three different codes to create the same shape

  1. Precise version using math
  2. Calculated version without math
  3. Simplified version with easier coordinates values

CSS-only star shape

Read more

]]>
CSS-Only pixelated cut corners 2024-04-11T00:00:00Z https://css-tip.com/pixelated-corner/ <![CDATA[

Use modern CSS to cut the corner of an image with a pixelated effect.

  • Only one element (the <img> tag)
  • Only 4 properties
  • Optimized with CSS variables

A Rhombus shape with rounded corners

Read more

]]>
Rounded tabs with inner curves 2024-04-04T00:00:00Z https://css-tip.com/rounded-tab/ <![CDATA[

Use modern CSS to create those famous rounded tabs with inner curves.

  • No extra element & No pseudo-element
  • Less than 10 CSS declarations to get the three variations
  • One variable to control the curvature
  • Works with gradient coloration

CSS-only rounded tabs with inner curves

Read more

]]>
Fluid typography with discrete steps 2024-04-03T00:00:00Z https://css-tip.com/fluid-typography/ <![CDATA[

Use the round() function and create a fluid typography with a discrete function instead of a continuous one.

Define the step and get precise values within a specific range. Very useful if you have some calculation based on the font-size like using the em unit. No more rounding issue!

Read more

]]>
A CSS-only wavy divider 2024-03-29T00:00:00Z https://css-tip.com/wavy-divider/ <![CDATA[

Use modern CSS and add a cool Wavy divider to your section. Only one property and two gradients are needed.

CSS-only wavy divider

Read more

]]>
A CSS-only fragmentation effect 2024-03-25T00:00:00Z https://css-tip.com/fragmentation-effect/ <![CDATA[

Add a hover aniamtion with a fancy fragmentation effect using only the <img> tag. Powered by CSS Mask, @property and optimized with CSS mask

CSS-only fragmentation effect

Read more

]]>
Smoothly stop a rotation on hover 2024-03-21T00:00:00Z https://css-tip.com/stop-rotation/ <![CDATA[

Make your rotation look more natural by smoothly stopping it on hover instead of an abrupt stop. No complex code is required!

The rotation will resume slowly on mouse-out as well.

Read more

]]>
Accelerate a rotation on hover 2024-03-19T00:00:00Z https://css-tip.com/accelerate-rotation/ <![CDATA[

Do you want to accelerate the rotation of your element on hover? Here is a simple CSS trick using animation-composition and a few lines of code

  • No extra element
  • No pseudo-element
  • One animation

Read more

]]>
Turn an image into a postage stamp 2024-03-14T00:00:00Z https://css-tip.com/postage-stamp/ <![CDATA[

Transform your image into a cool postage stamp with a few lines of code

  • No extra element (only the <img> tag)
  • Only two CSS gradients
  • Works with any image size
  • Easy to adjust using CSS variables

CSS-only overlay reveal animation

Read more

]]>
A wavy circle with cool hover effect 2024-03-13T00:00:00Z https://css-tip.com/wavy-circle/ <![CDATA[

Place you image inside a wavy circular frame powered by modern CSS (mask, trigonometric functions, @property, animation-composition and more)

  • No extra element (only the <img> tag)
  • No pseudo element
  • A cool animation on hover
  • Optimized with Sass and CSS variables

CSS-only wavy circles

Read more

]]>
The gotcha of align-content with block elements 2024-03-11T00:00:00Z https://css-tip.com/align-content-center/ <![CDATA[

Everyone is excited about the new align-content that works with block-level elements, but pay attention when you want to center elements such as <img>, <iframe>, <canvas>, <video>, etc.

⚠️ They won't get centered ⚠️

They will look centered but in reality, they are not and this is not a bug!

Illustrating the effect of align-content on image inside block level elements: the image is not perfectly centered

Images and similar inline-level elements have that strange white space under them due to the default baseline alignment, and that space is preserved when using align-content because we align the "whole content"

So don't forget to get rid of that space using vertical-align: top

Adding vertical-align: top to the image to have a perfect centering alignment

That space may look small but it can make a difference especially if you use a big font-size.

Read more

]]>
CSS Functions that work without arguments 2024-02-28T00:00:00Z https://css-tip.com/css-functions/ <![CDATA[

Do you know that some CSS functions can be used without arguments?

This is the case with circle() and ellipse() of clip-path. No need to provide any argument and they will, by default, round your element. circle() is a particular case of the ellipse() and is useful with square elements.

clip-path circle and ellipse

The browser will default circle() to circle(closest-side at center) and ellipse() to ellipse(closest-side closest-side at center)

Read more

]]>
Create a flower shape using CSS mask 2024-02-20T00:00:00Z https://css-tip.com/flower-shape/ <![CDATA[

Create a fancy flower shape using an online generator 🌺

css-generators.com/flower-shapes

Get an optimized code in no time. Adjust the setting and then click!

  • Only one element
  • Works with images
  • Powered by CSS Mask

CSS-only flower shapes

More CSS Shapes: css-shape.com

Read more

]]>
Be careful when using the nesting selector (&) 2024-02-19T00:00:00Z https://css-tip.com/nesting-selector/ <![CDATA[

CSS Nesting is cool and using the "&" is a lifesaver BUT be careful. There's a gotcha!

⚠️ "&" in CSS is different from the one in Sass ⚠️

Your Sass code won't work the same way if you use it as a CSS code.

The below code won't give the same result when used with CSS Nesting and Sass

Read more

]]>
Heart shape with a sliding hover effect II 2024-02-15T00:00:00Z https://css-tip.com/heart-shape-hover-2/ <![CDATA[

Another variation of the previous effect using the same code structure

  • No extra element (only the <img> tag)
  • No pseudo-elements

A CSS only heart shape

Read more

]]>
Heart shape with a sliding hover effect 2024-02-14T00:00:00Z https://css-tip.com/heart-shape-hover/ <![CDATA[

Turn your image into a heart shape with a lovely hover animation 😍

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Less than 15 CSS declarations

A CSS only heart shape for images

Read more

]]>
Create a triangle shape with 2 CSS properties 2024-02-11T00:00:00Z https://css-tip.com/triangle-shape/ <![CDATA[

Creating a basic triangle shape is as simple as using two CSS properties

  • aspect-ratio
  • clip-path (with a 3-point polygon)

That's it, and it works with any kind of elements including images.

A diagram showing to create CSS-only triangle shapes

Get the CSS code from: css-generators.com/triangle-shapes

Read more

]]>
Responsive full-screen slanted coloration 2024-02-07T00:00:00Z https://css-tip.com/responsive-slanted-coloration/ <![CDATA[

Use modern CSS to:

  • Set a max-width
  • Center an element
  • Set a minimum margin
  • Add a full-width slanted coloration
  • Make the slant effect responsive

All of this, using only 3 properties and easy to control with CSS variables

max-width section with a full screen responsive slanted coloration

Read more

]]>
When to use the min() or max() function 2024-02-06T00:00:00Z https://css-tip.com/min-max/ <![CDATA[

min() or max()? You always struggle to know which one to use and you end up trying both until one of them works.

💡 Here is a figure to help you decide when to use them

You start with clamp() then:

  • when you remove max, you use max()
  • when you remove min, you use min()

A 3D shine animation on image

If you want to set a max-width to your element then it's min()

width: clamp(min,100%,max)width: min(100%, max)

Read more

]]>
An infinite number of borders around images 2024-01-31T00:00:00Z https://css-tip.com/infinite-borders/ <![CDATA[

Use the magic border-image and add as many borders as you want to your images for a fancy decoration

  • No extra elements & No pseudo-elements
  • Only one gradient
  • Optimized with CSS variables

images with infinite borders

Read more

]]>
A curved ribbon shape with hover effect 2024-01-29T00:00:00Z https://css-tip.com/curved-ribbon/ <![CDATA[

Create a simple ribbon shape with a cool hover effect

  • Only one element
  • Optimized with CSS variables
  • Powered by @property

Curved ribbon shape

Read more

]]>
A fancy frame with wavy borders II 2024-01-24T00:00:00Z https://css-tip.com/image-wavy-borders-2/ <![CDATA[

Improving the previous effect to consider a gradient coloration instead of a solid color. Using the same code structure.

CSS-only images with wavy borders on all the sides

Read more

]]>
A fancy frame with wavy borders 2024-01-23T00:00:00Z https://css-tip.com/image-wavy-borders/ <![CDATA[

Place your image inside a fancy frame! Wavy borders on all the sides 🤩

  • Only one element (the <img> tag)
  • No pseudo-elements
  • Optimized with CSS Variables
  • First use case of the round() function 🥳

CSS-only images with wavy borders on all the sides

Read more

]]>
Triangle shape with rounded corners 2024-01-19T00:00:00Z https://css-tip.com/triangle-rounded-corner/ <![CDATA[

A modern way to create a triangle with rounded corners

  • Only one element (no pseudo-elements)
  • Only three CSS properties
  • One variable to control the radius

triangles with rounded corners

Read more

]]>
A Modern way to create an octagon shape 2024-01-16T00:00:00Z https://css-tip.com/octagon-shape/ <![CDATA[

An easy and modern way to create Octagon shapes

  • Only 2 CSS declarations
  • No magic numbers
  • A 4-point polygon (instead of 8) for the clip-path

CSS-only octagon shapes

Read more

]]>
A Modern way to create hexagon shapes 2024-01-11T00:00:00Z https://css-tip.com/hexagon-shape/ <![CDATA[

An easy and modern way to create Hexagon Shapes

  • Only 2 CSS declarations
  • No magic numbers
  • A simple 4-point polygon for the clip-path

CSS-only hexagon shapes

Read more

]]>
Fix your images with an adhesive tape 2024-01-08T00:00:00Z https://css-tip.com/adhesive-tape-image/ <![CDATA[

Don't let your images fall. Stick them with some adhesive tape! A CSS-only solution using a single element.

  • Durable fixation & easy to remove
  • Pre-cut adhesive tape
  • Environment friendly ♻️

images with adhesive tape

Read more

]]>
Fancy corner decoration for your images 2024-01-05T00:00:00Z https://css-tip.com/fancy-corner-decoration/ <![CDATA[

Add a fancy decoration to the corners of your image using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Optimized with CSS Variables

corner-only decoration for images

Read more

]]>
Border with inner radius for your images 2024-01-03T00:00:00Z https://css-tip.com/inner-radius-image/ <![CDATA[

Add a border with an inner radius to your image using a simple code.

  • No extra element
  • No pseudo-element
  • Only 2 CSS declarations

images with inner border radius

Read more

]]>
Circular list of stacked avatars 2023-12-28T00:00:00Z https://css-tip.com/circular-stack-avatars/ <![CDATA[

An horizontal list is good but a circular one is better 🤩

Another list of stacked avatars using the same code structure

  • Minimal HTML (images inside a container)
  • Works with any number of images
  • Powered by modern CSS (CSS variables, mask, @property, and more)
  • Optimized with Sass

CSS-only circular list of stacked avatars

Read more

]]>
Horizontal list of stacked avatars 2023-12-25T00:00:00Z https://css-tip.com/horizontal-stack-avatars/ <![CDATA[

Create a list of stacked avatars with a cool hover effect and with transparency

  • Minimal HTML (images inside a container)
  • Works with any number of images
  • Powered by modern CSS (CSS variables, mask, @property, has() selector and more)

CSS-only list of stacked avatars

Read more

]]>
Add a 3D style to your text III 2023-12-22T00:00:00Z https://css-tip.com/3d-style-text-3/ <![CDATA[

Add a cool 3D effect to your name or your favorite number

  • Only one element per word (not per letter)
  • No pseudo-elements
  • Optimized with CSS variables

A 3D text using CSS

Read more

]]>
Place your image inside a 3D gift box II 2023-12-20T00:00:00Z https://css-tip.com/image-gift-box-2/ <![CDATA[

Here is another variation of the previous effect. Now you can open the gift box from both sides 🎁

Still using only the <img> tag (No extra elements, No pseudo-elements) and a touch of magic 🪄

A 3D box with image

Read more

]]>
Place your image inside a 3D gift box 2023-12-19T00:00:00Z https://css-tip.com/image-gift-box/ <![CDATA[

Place your image inside a 3D box and reveal it with a cool hover effect. Perfect for your virtual gifts 🎁

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Optimized with CSS Variables

A 3D box with image

Read more

]]>
A circular reveal effect for your images 2023-12-14T00:00:00Z https://css-tip.com/circular-reveal-effect/ <![CDATA[

Add a fancy reveal effect to your images with a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Powered by CSS Variables & @property

CSS-only reveal effect on hover

Read more

]]>
Infinite stripes shadow for your images 2023-12-08T00:00:00Z https://css-tip.com/infinite-stripes-shadow/ <![CDATA[

Another variation of the previous effect with infinite stripes

  • No extra element (only the image tag)
  • No pseudo-elements
  • Optimized with CSS variables

CSS infinite stripes shadow

Read more

]]>
Infinite shadow for your images II 2023-12-06T00:00:00Z https://css-tip.com/infinite-shadow-image/ <![CDATA[

Another variation of the previous effect where you can add a diagonal infinite shadow to your rounded image.

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Optimized with CSS variables

four images with a diagonal infinite shadow

Read more

]]>
Overlay reveal animation for your images 2023-11-30T00:00:00Z https://css-tip.com/overlay-reveal-image/ <![CDATA[

Add a reveal animation to your image with a simple code

  • No extra element (only the image tag)
  • No pseudo-elements
  • Optimized with CSS Variables

CSS-only overlay reveal animation

Read more

]]>
A Ribbon shape with a reveal hover effect 2023-11-29T00:00:00Z https://css-tip.com/ribbon-reveal-effect/ <![CDATA[

Create a ribbon shape with a fancy reveal effect on hover

  • Only one element
  • No fixed size (it fits your text content)
  • Optimized with CSS Variables

CSS Ribbon shape with reveal effect

Read more

]]>
Rounded gradient border with hover effect 2023-11-28T00:00:00Z https://css-tip.com/gradient-border-hover/ <![CDATA[

Add a fancy hover effect to your image with a gradient border

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Powered by CSS mask & @property

rounded gradient border

Read more

]]>
A Tooltip Shape using 2 CSS properties 2023-11-21T00:00:00Z https://css-tip.com/simple-tooltip/ <![CDATA[

The smallest code to create a simple Tooltip Shape

  • One element (No pseudo-elements)
  • Only 2 CSS Properties
  • Optimized with CSS Variables

A CSS-only tooltip shape

Read more

]]>
Add a 3D style to your text II 2023-11-17T00:00:00Z https://css-tip.com/3d-style-text-2/ <![CDATA[

Another concept of 3D text with a minimal code

  • Only one element (no pseudo-elements)
  • Works with multi-line text
  • Optimized with CSS variables

A 3D text using CSS

Read more

]]>
Add a 3D style to your text 2023-11-15T00:00:00Z https://css-tip.com/3d-style-text/ <![CDATA[

Add a touch of 3D to your text using a few lines of code

  • Minimal HTML
  • Works with multi-line text
  • Less than 10 CSS declarations

A 3D text using CSS

Read more

]]>
Responsive multi-line Ribbon Shape II 2023-11-10T00:00:00Z https://css-tip.com/multi-line-ribbon-shape-2/ <![CDATA[

After the previous one, here is another concept of Responsive Ribbon Shape using the same code structure.

  • Only one element
  • Works with multi-line text
  • Optimized with CSS variables and Math functions

CSS only ribbon shapes with multi-line text

Read more

]]>
An Infinite Ribbon Shape for your title 2023-11-03T00:00:00Z https://css-tip.com/infinite-ribbon-shape/ <![CDATA[

Transform your title into an Infinite Ribbon Shape using a few lines of code

  • Only one element
  • No pseudo-elements
  • No overflow issue

CSS only infinite ribbon shapes

Read more

]]>
Responsive multi-line Ribbon Shape 2023-11-02T00:00:00Z https://css-tip.com/multi-line-ribbon-shape/ <![CDATA[

Place your text inside a responsive ribbon shape using a few lines of code.

  • Only one element
  • No pseudo-elements
  • Works with multi-line text

CSS only ribbon shapes with multi-line text

Read more

]]>
Folded Ribbon Shape with hover effect II 2023-09-26T00:00:00Z https://css-tip.com/folded-ribbon-hover-2/ <![CDATA[

Create a fancy ribbon shape with a few lines of code

  • Only one element
  • No pseudo-elements
  • Optimized with CSS variables
  • Nice animation on hover

A folded ribbon shape using CSS

Read more

]]>
Rotated Ribbon Shape with hover effect 2023-09-21T00:00:00Z https://css-tip.com/rotated-ribbon-hover/ <![CDATA[

Place your title into a fancy Ribbon Shape with a cool hover effect 😍

  • Only one element
  • Optimized with CSS variables
  • Powered by modern CSS features 💪

A CSS-only ribbon shape

Read more

]]>
Folded Ribbon Shape with hover effect 2023-09-19T00:00:00Z https://css-tip.com/folded-ribbon-hover/ <![CDATA[

Turn your title into a fancy Ribbon Shape 🎀

  • One element (no complex HTML)
  • No pseudo-elements
  • Optimized with CSS variables
  • Cool animation on hover

A folded ribbon shape

Read more

]]>
A Fancy Hover Effect For Your Avatar III 2023-09-13T00:00:00Z https://css-tip.com/avatar-hover-effect-3/ <![CDATA[

Another fancy "Pop out" hover effect using modern CSS. The spiky variation of the previous effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Powered by the future of CSS (mask, @property, Trigonometric functions and a lot of math)
  • Optimized with Sass & CSS Variables

A pop out hover effect to image

Read more

]]>
Slanted underline with hover effect 2023-09-12T00:00:00Z https://css-tip.com/slanted-underline/ <![CDATA[

Add a slanted underline to your text with a nice hover effect using a simple code

  • Minimal HTML
  • No pseudo-elements
  • Works with multi-line text
  • Optimized with CSS variables

text with slanted underline

Read more

]]>
Starburst images with rotation 2023-09-07T00:00:00Z https://css-tip.com/starburst-image/ <![CDATA[

Place your image inside a Starburst shape with a cool rotation 🤩

  • No extra element (only the <img> tag)
  • Powered by clip-path

Get the code in no time using an Online Generator for Starburst Shape

Images with Starburst shapes

Read more

]]>
Infinite shadow for your images 2023-09-05T00:00:00Z https://css-tip.com/infinite-shadow/ <![CDATA[

Add an infinite shadow to your image in any direction using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Only 2 CSS properties
  • Works with rounded corners

four images with an infinite shadow

Read more

]]>
Fancy circular hover effect 2023-09-01T00:00:00Z https://css-tip.com/fancy-circular-hover/ <![CDATA[

Create a fancy hover effect with small circles rotating around your image.

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Powered by CSS Mask and @property
  • Optimized with Sass

Small circles around an image

Read more

]]>
Border reveal animation on hover 2023-08-23T00:00:00Z https://css-tip.com/border-reveal-animation/ <![CDATA[

Add a simple border around your image with a nice hover effect

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Only 3 Gradients
  • Less than 15 CSS declarations

animation to reveal a border around the image

Read more

]]>
Fancy frame for your image with hover effect 2023-08-22T00:00:00Z https://css-tip.com/fancy-frame-image/ <![CDATA[

Add a nice frame around your image with a cool hover effect

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Only 4 gradients
  • Optimized with CSS variables

CSS only frame with hover effect around an image

Read more

]]>
Zig-Zag sepration between images with hover effect 2023-08-21T00:00:00Z https://css-tip.com/zig-zag-image-seperation/ <![CDATA[

Place 2 images next to each other with a Zig-Zag separation ⚡️

  • Minimal HTML code
  • Less than 25 CSS declarations
  • Optimized with CSS variables
  • Nice hover effect

Zig-Zag edge generator 👉 css-generators.com/custom-borders

Zig Zag seperation between two images

Read more

]]>
A Fancy Hover Effect For Your Avatar II 2023-08-14T00:00:00Z https://css-tip.com/avatar-hover-effect-2/ <![CDATA[

Add a fancy "Pop out" hover effect to your avatar using modern CSS. Another variation of the previous effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Powered by the future of CSS (mask, @property, Trigonometric functions and a lot of math)
  • Optimized with Sass & CSS Variables

A pop out hover effect to image

Read more

]]>
A Fancy Hover Effect For Your Avatar 2023-08-11T00:00:00Z https://css-tip.com/avatar-hover-effect/ <![CDATA[

Add a nice "Pop out" hover effect to your avatar using a minimalist code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 20 declarations
  • Optimized with CSS variables

A pop out hover effect to image

Read more

]]>
A reveal hover effect using CSS mask III 2023-08-09T00:00:00Z https://css-tip.com/reveal-hover-mask-3/ <![CDATA[

Add a nice reveal animation to your image with a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-elements
  • Powered by CSS Mask & @property

A reveal hover effect using mask & @property

Read more

]]>
A simple checkbox using CSS mask 2023-08-04T00:00:00Z https://css-tip.com/checkbox-mask/ <![CDATA[

A simple design for your checkbox with a nice animation on click.

  • No extra element (only the <input> tag)
  • No pseudo-elements
  • One value to control the size
  • Less than 15 CSS declarations

CSS-only checkbox using CSS mask

Read more

]]>
A reveal animation with a rotating square 2023-07-31T00:00:00Z https://css-tip.com/rhombus-hover-effect/ <![CDATA[

Add a fancy reveal animation to your image on hover

  • No extra element (only the <img> tag)
  • Powered by Trigonometric functions and @property
  • Optimized with CSS variables

A reveal animation with a rotating square

Read more

]]>
A reveal hover effect using CSS mask II 2023-07-21T00:00:00Z https://css-tip.com/reveal-hover-mask-2/ <![CDATA[

Another variation of the previous hover effect with a diagonal reveal. Using the same code structure.

  • No extra element (only the <img> tag)
  • Less than 10 CSS declarations
  • Powered by CSS mask and CSS gradients

A diagonal reveal effect using mask

Read more

]]>
A reveal hover effect using CSS mask 2023-07-20T00:00:00Z https://css-tip.com/reveal-hover-mask/ <![CDATA[

Reveal your images with a nice hover effect and a few lines of code

  • No extra element (only the <img> tag)
  • Less than 10 CSS declarations
  • Powered by CSS Mask

A reveal hover effect using mask

Read more

]]>
A color wheel with an array of colors 2023-07-18T00:00:00Z https://css-tip.com/color-wheel/ <![CDATA[

Create a perfect color wheel with multiple colors using conic-gradient()

  • One variable to define all the colors
  • No color duplication
  • Smooth transition between all the colors

A color wheel using conic-gradient

Read more

]]>
Zoom effect on hover 2023-07-14T00:00:00Z https://css-tip.com/zoom-hover-effect/ <![CDATA[

Add a simple zoom effect on hover for your images with a small code

  • No extra element (only the <img> tag)
  • 5 CSS declarations

Read more

]]>
Corner-only borders with hover effect 2023-07-13T00:00:00Z https://css-tip.com/corner-only-border-image/ <![CDATA[

Add corner-only borders to your images with a nice hover effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 10 CSS declarations
  • Only 2 gradients

Images with corner-only border

Read more

]]>
Overlapping border on images with hover effect 2023-07-06T00:00:00Z https://css-tip.com/overlapping-border-image/ <![CDATA[

Add an overlapping border to your image with a nice hover effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • 10 CSS declarations
  • Optimized with CSS variables

images with overlapping border

Read more

]]>
3D trailing shadows for images 2023-07-04T00:00:00Z https://css-tip.com/3d-trailing-shadow/ <![CDATA[

Add a 3D trailing shadow to your image with a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 10 CSS declarations
  • No scrollbar issue

A 3D trailing shadow for images

Read more

]]>
A reveal hover effect with an expanding circle 2023-06-29T00:00:00Z https://css-tip.com/circle-hover-effect/ <![CDATA[

Add a reveal animation to your image with a simple and nice hover effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • 10 CSS declarations

A reveal hover effect with an expanding circle

Read more

]]>
A CSS-only array of colors 2023-06-26T00:00:00Z https://css-tip.com/colors-array/ <![CDATA[

Do you want to define an array of colors using only CSS? Yes, it's possible! It's limited to only background coloration but can be useful in many situations.

Use an index like any programming language to iterate through the array. Practical when you are already using an index for something else.

Boxes with different colors

Read more

]]>
3D shine animation with a hover effect 2023-06-19T00:00:00Z https://css-tip.com/3d-shine-animation/ <![CDATA[

Add a fancy 3D animation to your image with a cool hover effect

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Optimized with CSS variables

A 3D shine animation on image

Read more

]]>
Slow down a rotation on hover 2023-06-13T00:00:00Z https://css-tip.com/slow-down-rotation/ <![CDATA[

Did you ever wanted to slow down a rotating element on mouse hover? You can easily do it with a simple code:

  • No extra element
  • No pseudo-element
  • One animation
  • Easy to control with CSS variables

Read more

]]>
Sliding reveal animation for your images 2023-06-10T00:00:00Z https://css-tip.com/sliding-reveal-image/ <![CDATA[

Add a reveal effect to your image with a sliding animation on hover

  • No extra element (only the <img> tag)
  • No pseudo element
  • Less than 10 CSS declarations

Sliding reveal animation

Read more

]]>
Color your image with a sliding hover effect 2023-06-06T00:00:00Z https://css-tip.com/color-reveal-hover-effect/ <![CDATA[

Reveal the colors of your images with a sliding animation on hover

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 15 CSS declarations
  • Easily control the sliding direction

CSS reveal hover effect

Read more

]]>
3D shine effect on hover 2023-06-01T00:00:00Z https://css-tip.com/3d-shine-effect/ <![CDATA[

Add a 3D effect to your image with a shiny animation on hover ✨

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 10 CSS declrations

A 3D shine effect on image

Read more

]]>
A Rhombus shape with rounded corners 2023-05-29T00:00:00Z https://css-tip.com/rhombus-image/ <![CDATA[

Transform your image into a Rhombus shape with rounded corners using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Optimized with CSS variables

A Rhombus shape with rounded corners

Read more

]]>
Add a gradient overlay using border-image 2023-05-18T00:00:00Z https://css-tip.com/gradient-overlay-border-image/ <![CDATA[

Do you want to add a gradient overlay above your background but you cannot edit the background property, add an extra element or use pseudo-element?

You can do it with border-image!

Only one line of code and you have your overlay 🤩

A gradient overaly above a background

Read more

]]>
Transform a 2D image into a 3D one 2023-05-17T00:00:00Z https://css-tip.com/image-3d-effect/ <![CDATA[

Transform your 2D image into a 3D one using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Nice animation on hover 🤩

3D images using CSS

Read more

]]>
3D parallax effect on images 2023-05-16T00:00:00Z https://css-tip.com/3d-parallax-image/ <![CDATA[

Add a fancy 3D effect to your image with a simple code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • No JavaScript
  • Perfect 3D illusion on hover 🤩

A 3D effect to your image

Read more

]]>
A folded ribbon to the corner 2023-05-12T00:00:00Z https://css-tip.com/folded-ribbon/ <![CDATA[

Add a folded ribbon to the corner of your container using a few lines of code

  • One element (no pseudo-element)
  • No fixed width/height (fit content size)
  • No magic positioning numbers
  • Easy switch between both positions

A CSS folded ribbon

Read more

]]>
A Ribbon title to the edge of the screen 2023-05-08T00:00:00Z https://css-tip.com/ribbon-style-title/ <![CDATA[

Add a ribbon style to your title that extend to the edge of the screen.

  • Only one CSS property 🤩
  • No extra element
  • No pseudo-element
  • No scrollbar issue

Titles having a ribbon style that extend to the left edge of the screen

Read more

]]>
Full screen slanted background 2023-05-05T00:00:00Z https://css-tip.com/stanled-background-full-screen/ <![CDATA[

Add a slanted background to your container that extend to the edge of the screen.

  • Only 2 CSS properties 🤯
  • No pseudo-element
  • No scrollbar issue
  • One variable to control the angle

A full screen slanted background

Read more

]]>
An inner border-radius with one property 2023-05-03T00:00:00Z https://css-tip.com/inner-border-radius/ <![CDATA[

Do you want to have a radius inside the element but not outside? You can do it using only one property 🤩

A box with an inner border-radius

Read more

]]>
Select all elemens between two class names 2023-05-02T00:00:00Z https://css-tip.com/select-elements-between-two-class/ <![CDATA[

Do you want to select all the elements between two different class names? Use the :not() selector to do it

Read more

]]>
A reveal hover effect with a single element II 2023-05-01T00:00:00Z https://css-tip.com/reveal-hover-effect-2/ <![CDATA[

Adding more variations to the previous reveal animation using the same tricks

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Powered by object-fit & object-position
  • A lot of possible combination

CSS reveal animation using padding and object-fit

Read more

]]>
A reveal hover effect with a single element 2023-04-27T00:00:00Z https://css-tip.com/reveal-hover-effect/ <![CDATA[

Add a simple reveal animation to your images using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 10 CSS declarations
  • Powered by object-fit and object-position
  • Easily control the reveal direction

Read more

]]>
A fancy hover effect with rotating squares 2023-04-26T00:00:00Z https://css-tip.com/rotating-square-hover-effect/ <![CDATA[

Add a fancy hover effect to your image with a small code. Transform your image into little rotating squares!

  • One element (the <img> tag)
  • No pseudo-element
  • Powered by CSS mask and @property

Pay attention to the support of the @property.

Image with rotating squares

Read more

]]>
A CSS-only Ribbon 2023-04-24T00:00:00Z https://css-tip.com/css-ribbon-2/ <![CDATA[

Create a cool CSS Ribbon with a few lines of code

  • One element (no pseudo-element)
  • One color definition
  • No fixed width/height (It fits the content size)
  • Optimized with CSS variables

A CSS-only Ribbon

Read more

]]>
A CSS-only 3D Zig-Zag edge 2023-04-19T00:00:00Z https://css-tip.com/3d-zig-zag-edge/ <![CDATA[

Create a nice 3D Zig-Zag edge with a simple code:

  • One element (No pseudo-element)
  • Two gradients
  • One color definition
  • Optimized with CSS variables

A CSS-only 3D Zig Zag edge

Read more

]]>
Select the first & last element with a class 2023-04-18T00:00:00Z https://css-tip.com/first-last-element-with-class/ <![CDATA[

Do you want to select the first and last element with a specific class? It's possible and you can do it using 2 different methods!

Read more

]]>
Customize your numbered list 2023-04-17T00:00:00Z https://css-tip.com/custom-numbered-list/ <![CDATA[

Use @counter-style to customize your <ol> list with a simple code

  • No extra markup
  • No pseudo-element
  • No need for counter()
  • Keep the default browser algorithm

A numbered list

Read more

]]>
CSS-only custom range slider 2023-04-10T00:00:00Z https://css-tip.com/custom-range-slider/ <![CDATA[

Use modern CSS tricks to create fancy range sliders with a little code

  • No extra element (only the <input> element)
  • Optimized with CSS variables
  • Transparent gap around the thumb

CSS-only range slider

Read more

]]>
A color wheel with gradient 2023-04-03T00:00:00Z https://css-tip.com/color-wheel-gradient/ <![CDATA[

Use conic-gradient() and the new color interpolation to create a nice color wheel 🤩

A color wheel made conic-gradient

Read more

]]>
Fade content inside border using mask 2023-03-30T00:00:00Z https://css-tip.com/fade-content-border-mask/ <![CDATA[

Create a fading content while keeping the border visible using CSS mask. It works with border-radius and no need to know the value of border.

A fading content

Read more

]]>
Hue manipulation using color-mix() 2023-03-29T00:00:00Z https://css-tip.com/hue-manipulation-color-mix/ <![CDATA[

Use the new color-mix() to manipulate the Hue of a color in the HSL color space

Read more

]]>
Color shades using color-mix() 2023-03-28T00:00:00Z https://css-tip.com/color-shades-color-mix/ <![CDATA[

Use the new color-mix() to create different shades from one color.

Mix with ⚫️ black for a darker color and ⚪️ white for a lighter color

3 color shades from one color

Read more

]]>
Color switch using color-mix() 2023-03-27T00:00:00Z https://css-tip.com/color-switch-color-mix/ <![CDATA[

Use the new color-mix() function to create a color switch with a compact code

  • No color duplication
  • Define your colors using one variable
  • Easy switch between colors
  • Suitable for dark/light mode

Read more

]]>
CSS shapes: Polygon & Starburst 2023-03-08T00:00:00Z https://css-tip.com/polygon-starburst-shapes/ <![CDATA[

Use online generators to create CSS shapes using clip-path in no time!

Starburst & polygon shapes

Read more

]]>
CSS-only gradient shadows 2023-02-10T00:00:00Z https://css-tip.com/css-gradient-shadows/ <![CDATA[

An online tool to create fancy CSS shadows with gradients coloration. Get the code in One click 🌟

  • Works with transparency
  • Works with border-radius

css-generators.com/gradient-shadows

CSS-only gradient shadows

Read more

]]>
A border-only Tooltip using mask & clip-path 2023-02-08T00:00:00Z https://css-tip.com/border-only-tooltip-mask/ <![CDATA[

Create a border-only Tooltip with a few lines of code

  • One element
  • Support gradient coloration
  • Support border-radius
  • Optimized with CSS variables

CSS border-only tooltip with gradient coloration

Read more

]]>
A rainbow gradient animation 2023-01-31T00:00:00Z https://css-tip.com/rainbow-gradient-animation/ <![CDATA[

Use the new color interpolation to easily create an infinite rainbow animation using CSS gradients 🌈

  • One color declaration
  • A simple animation

Read more

]]>
Card reveal animation 2023-01-23T00:00:00Z https://css-tip.com/card-reveal-animation/ <![CDATA[

Add a cool text reveal animation to your image card

  • Minimal HTML
  • No pseudo-element
  • Powered by CSS Mask (with fallback for old browsers)

Card reveal animation

Read more

]]>
Fancy Rounded frame around your images 2022-11-01T00:00:00Z https://css-tip.com/rounded-frame-image/ <![CDATA[

Add a nice frame around your image using a few lines of code

  • One element (The <img> tag)
  • No pseudo-element
  • Only 3 CSS properties
  • Optimized with CSS variables

An image with a fancy rounded frame

Read more

]]>
How many elements your container has? 2022-10-10T00:00:00Z https://css-tip.com/number-elements-has-selector/ <![CDATA[

Use the :has() selector and style your container based on its number of elements (direct children)

⚠️ It doesn't count text nodes. Only tags!

Read more

]]>
A CSS-only wavy shapes 2022-09-29T00:00:00Z https://css-tip.com/css-wavy-shape/ <![CDATA[

How much code is needed to create a Wavy Shape?

  • 1 Property
  • 2 Gradients

Use an online generator to easily get the code: css-generators.com/wavy-shapes

A wavy shape

Read more

]]>
An infinite image slider 2022-09-16T00:00:00Z https://css-tip.com/infinite-image-slider/ <![CDATA[

Create an infinite image carousel using a few lines of code:

  • Minimal HTML (<img>s inside a container)
  • No duplicated images
  • One simple animation
  • Works with any number of images
  • Optimized with Sass

Read more

]]>
Cut the corners of your element 2022-09-08T00:00:00Z https://css-tip.com/css-cut-corners/ <![CDATA[

How much code is needed to cut the four corners of an element? Also known as inverted border-radius

  • One Property
  • One Gradient

Use an online generator to easily get the code: css-generators.com/custom-corners

An element with 4 cut corners

Read more

]]>
A CSS-only Zig-Zag edge 2022-09-02T00:00:00Z https://css-tip.com/css-zig-zag-edge/ <![CDATA[

How much code is needed to create a Zig-Zag edge?

  • One Property
  • One Gradient

Use an online generator to easily get the code: css-generators.com/custom-borders

A CSS-only zig-zag border

Read more

]]>
A fancy title divider II 2022-08-26T00:00:00Z https://css-tip.com/fancy-title-divider-2/ <![CDATA[

After the previous one, here is another fancy design for your title

  • No extra element
  • No pseudo element
  • No overflow issue
  • Less than 15 CSS declarations
  • Optimized with CSS variables

A title with a fancy decoration

Read more

]]>
A fancy title divider 2022-08-25T00:00:00Z https://css-tip.com/fancy-title-divider/ <![CDATA[

Turn your titles into a fancy divider using few lines of code

  • No extra element
  • No pseudo element
  • No overflow issue
  • Easy to update using CSS variables

A title with a fancy decoration

Read more

]]>
A fancy hover effect using outline 2022-08-24T00:00:00Z https://css-tip.com/outline-hover-effect/ <![CDATA[

Add a cool hover effect to your images using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo element
  • Using only the outline property
  • Optimized with CSS variables

A fancy hover effect using CSS outline

Read more

]]>
Zig-Zag expanding image panels 2022-08-22T00:00:00Z https://css-tip.com/css-zig-zag-panel/ <![CDATA[

Build an expanding image panels with Zig-Zag edges

  • Minimal HTML
  • Works with any number of images
  • Optimized with CSS variables

A fancy hover effect using outline

Flexbox Demo #

Read more

]]>
Diagonal split & reveal animation 2022-08-19T00:00:00Z https://css-tip.com/diagonal-reveal-effect/ <![CDATA[

Reveal your images with a cool hover effect using a few lines of code

  • Minimal HTML (2 <img> inside a container)
  • Less than 15 CSS declaration
  • Optimized with CSS variables

A fancy hover effect using CSS clip-path

Read more

]]>
A CSS-only Speech Bubble 2022-08-18T00:00:00Z https://css-tip.com/css-speech-bubble/ <![CDATA[

Create a Speech Bubble using a few lines of code

  • One element
  • No pseudo-element
  • Only 3 CSS properties
  • Optimized with CSS variables

A speech bubble made with CSS

Read more

]]>
Custom dashed border 2022-08-10T00:00:00Z https://css-tip.com/css-dashed-border/ <![CDATA[

Create a custom dashed border using a few lines of code.

  • No extra element
  • Less than 8 CSS properties
  • Easy to update using CSS variables

A custom dashed border

Read more

]]>
Put a number inside boxes 2022-08-02T00:00:00Z https://css-tip.com/number-inside-box/ <![CDATA[

Make your numbers look fancy by placing each digit inside its own box.

  • Only one element
  • Easy to control using CSS variables
  • Two versions: Full & Border-only
  • No restriction on the number length

A number where each digit is inside a box

Read more

]]>
CSS-only back to top button 2022-07-27T00:00:00Z https://css-tip.com/back-to-top/ <![CDATA[

Create a CSS-only "Back To Top" button with a simple code

  • No JavaScript
  • Control when the button appears
  • Smooth scroll on click
  • Powered by CSS grid and sticky position

Read more

]]>
Navigation menu with sliding items 2022-07-22T00:00:00Z https://css-tip.com/sliding-navigation-menu/ <![CDATA[

Create a simple navigation menu with a sliding effect

  • Minimal HTML code
  • No duplicated text
  • Less than 20 CSS declarations
  • Optimized with CSS variables

Read more

]]>
Dashed lines using CSS gradient 2022-07-13T00:00:00Z https://css-tip.com/css-dashed-lines/ <![CDATA[

Create dashed lines using only one gradient

A background with dashed lines

Read more

]]>
Heart shape animation using outline 2022-07-04T00:00:00Z https://css-tip.com/heart-shape-animation/ <![CDATA[

Add a beautiful animation to a Heart shape and reveal your best images 🥰 😍

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Less than 10 declarations

An image with a heart shape

Read more

]]>
Turn your image into a heart 2022-07-01T00:00:00Z https://css-tip.com/image-heart-shape/ <![CDATA[

Turn your favorite image into a Heart 💖 using a few lines of code

  • No extra element (only the <img> tag)
  • No pseudo-element
  • Only two CSS declarations

An image with a heart shape

Read more

]]>
Horizontal lines around your title 2022-06-24T00:00:00Z https://css-tip.com/horizontal-line-title/ <![CDATA[

Add horizontal lines around your title using border-image

  • No extra element
  • No pseudo-element
  • No overflow issue
  • Only two CSS properties
  • Optimized with CSS variables

Titles with horizontal lines on the sides

Read more

]]>
Float an element to the bottom corner 2022-06-22T00:00:00Z https://css-tip.com/float-bottom-corner/ <![CDATA[

Make an element float to the bottom corner of your text content

  • Minimal HTML code
  • No JavaScript
  • No media query

An image float at the bottom corner of the text

Read more

]]>
Extend your underline to the edge of the screen II 2022-06-20T00:00:00Z https://css-tip.com/overflowing-underline-2/ <![CDATA[

Improving the previous effect to consider an underline with a gradient coloration that extend to the edge of the screen

  • No extra element
  • No pseudo-element
  • No overflow issue
  • Optimized with CSS variables

An extended underline to left and the right

Read more

]]>
Extend your underline to the edge of the screen 2022-06-16T00:00:00Z https://css-tip.com/overflowing-underline/ <![CDATA[

Add an underline to your title and extend it to the right (or left) edge of the screen whatever the element/container size

  • No extra element
  • No pseudo-element
  • No overflow issue
  • Only one CSS property

An extended underline to left and the right

Read more

]]>
A CSS-only custom cursor 2022-06-14T00:00:00Z https://css-tip.com/css-custom-cursor/ <![CDATA[

Create a custom cursor using CSS without external resources. Style your cursor like you do with a simple <div>!

Powered by CSS-in-SVG-in-CSS

Read more

]]>
Extend the background to the edge of the screen 2022-06-09T00:00:00Z https://css-tip.com/overflowing-background/ <![CDATA[

Extend the background of an element outside of its container to cover the full screen width

  • No extra element
  • No pseudo-element
  • No overflow issue
  • Only one CSS declaration

An overflowing background

Read more

]]>
CSS Graph paper pattern 2022-06-07T00:00:00Z https://css-tip.com/css-graph-paper/ <![CDATA[

Create a Graph Paper design using only 2 gradients

A graph paper pattern

Read more

]]>
Responsive grid of Hexagon shapes 2022-06-03T00:00:00Z https://css-tip.com/responsive-hexagon-grid/ <![CDATA[

Create a fully responsive grid of Hexagon shapes (and more!)

  • No media query
  • No JavaScript
  • Minimal HTML code
  • Easy to control using CSS variables

responsive grid of Hexagon shapes

Read more

]]>
Wavy text animation II 2022-04-20T00:00:00Z https://css-tip.com/wavy-text-animation-2/ <![CDATA[

Improving the previous CSS-only Wavy animation

  • Adding another wave
  • Support multi-line of text

A text with a wavy background coloration

Read more

]]>
Wavy text animation 2022-04-19T00:00:00Z https://css-tip.com/wavy-text-animation/ <![CDATA[

Create a Wavy text animation using a few lines of code

  • One element
  • No pseudo element
  • No duplicated text
  • No SVG
  • Optimized with CSS variables

A text with a wavy background coloration

Read more

]]>
A color overlay above your images 2022-04-07T00:00:00Z https://css-tip.com/image-color-overlay/ <![CDATA[

Add a color overlay above your image using only 3 declarations

  • No extra element (only the <img> tag)
  • No pseudo element
  • Works with rounded image

You can also have a cool transition on hover

A color overlay above an image

Read more

]]>
Tooltip using mask 2022-04-04T00:00:00Z https://css-tip.com/tooltip-mask/ <![CDATA[

Create a Tooltip shape with rounded corners using a few lines of code

  • No extra element
  • No pseudo element
  • Works with any background
  • Easy to control using CSS variables

A tooltip with gradient coloration

Read more

]]>
Section divider 2022-03-07T00:00:00Z https://css-tip.com/section-divider/ <![CDATA[

Create a cool divider between your sections in no time using an online generator.

css-generators.com/section-divider

different section dividers

Read more

]]>
Grid with dashed lines 2022-02-28T00:00:00Z https://css-tip.com/grid-dashed-lines/ <![CDATA[

Create a grid of dashed lines using a few lines of code

  • One property
  • Two gradients
  • Easy to adjust using CSS variables

A grid of dashed lines

Read more

]]>
CSS-only Zoom effect on images 2022-02-17T00:00:00Z https://css-tip.com/css-zoom-effect/ <![CDATA[

Apply a zoom effect to your image with a few lines of code:

  • No extra element (only the <img> tag)
  • No duplicated images
  • Only three CSS properties
  • Easy to adjust using CSS variables

A zoom effect on images

Read more

]]>
3D effect on images 2022-02-11T00:00:00Z https://css-tip.com/3d-image-effect/ <![CDATA[

Add a 3D effect to your images with a few lines of code:

  • No extra element (only the <img> tag)
  • No pseudo element
  • No duplicated image
  • A cool animation on hover

Images with 3D effect

Read more

]]>
CSS-only folded ribbon 2022-02-07T00:00:00Z https://css-tip.com/css-ribbon/ <![CDATA[

Create a cool Ribbon using one element and a few lines of code.

  • Easy to update using CSS variables
  • No hard-coded values
  • Works with any text content
  • Works with multi-lines of text

A CSS ribbon

Read more

]]>
A simple CSS loader 2022-02-02T00:00:00Z https://css-tip.com/simple-css-loader/ <![CDATA[

Create a CSS-only loader with a simple code.

  • One <div>
  • Less than 10 CSS declarations

A CSS only loader

Read more

]]>
A rounded & dashed underline 2022-02-01T00:00:00Z https://css-tip.com/rounded-dashed-underline/ <![CDATA[

Add a nice rounded dashed underline to your text.

  • No SVG, No image
  • No extra element
  • No pseudo-element
  • Works with multi-lines of text
  • Easy to update using CSS variables

A text with a rounded dashed underline

Read more

]]>
Equal width buttons 2022-01-20T00:00:00Z https://css-tip.com/equal-width-button/ <![CDATA[

Make a set of buttons equal in width to the largest one using a few lines of code.

  • No JavaScript
  • Works with any number of button
  • Easily switch between the horizontal and vertical configuration

eqaul width buttons

Read more

]]>
Stick an element to the top-right corner 2022-01-13T00:00:00Z https://css-tip.com/stick-element-grid/ <![CDATA[

Make an element stay at the top-right corner of your responsive grid using one instruction.

A grid with an element anchored on the top right corner

Read more

]]>
A matrix of cubes using one element 2022-01-03T00:00:00Z https://css-tip.com/matrix-cube/ <![CDATA[

Create a matrix of cubes using only one element. Yes it's possible!

A matrix of cube

Read more

]]>
Cut your image into pieces 2022-01-02T00:00:00Z https://css-tip.com/matrix-image/ <![CDATA[

Cut your image into small pieces using one CSS instruction.

A image cut into small pieces

Read more

]]>
One big image + thumbnails 2021-12-15T00:00:00Z https://css-tip.com/image-thumbnail/ <![CDATA[

A big image + thumbnails using CSS Grid. Same code for both the horizontal and vertical layout.

A big image plus thumbnail

Read more

]]>
Full screen height container 2021-12-15T00:00:00Z https://css-tip.com/full-screen-height/ <![CDATA[

Make your container fill all the screen height

  • No cascading height:100%
  • No side effects of the 100vh
  • Works with the default margin of <body>
  • No overflow issue. The height will grow to fit the content.

Read more

]]>
max-width + centering with one instruction 2021-12-10T00:00:00Z https://css-tip.com/center-max-width/ <![CDATA[

Set max-width and center your block element with one CSS declaration using margin-inline and max().

Centering and settin a max-width using max()

Read more

]]>
Hamburger menu icon 2021-12-07T00:00:00Z https://css-tip.com/css-menu-icon/ <![CDATA[

Create a CSS-only hamburger menu icon with 2 gradients. Adjust one value to control the size.

A CSS-only menu icon

Read more

]]>
Multi-line text decoration 2021-11-30T00:00:00Z https://css-tip.com/multi-line-text-decoration/ <![CDATA[

Give your your text a fancy looking using box-decoration-break: clone and CSS gradients.

A CSS-only menu icon

Read more

]]>
Circular dashed border 2021-11-25T00:00:00Z https://css-tip.com/dashed-rounded-border/ <![CDATA[

Create a circular dashed border with full control over the dashes. Only one element and a few lines of code are required. Simply update the CSS variables to control the design of the border.

Circular dashed border

Read more

]]>
CSS-only scrolling shadow 2021-11-24T00:00:00Z https://css-tip.com/css-scrolling-shadow/ <![CDATA[

Create a CSS-only Scrolling Shadow effect with a few lines of code.

  • No JavaScript
  • No extra element
  • No pseudo element
  • Only background properties.

CSS-only scrolling shadow

Read more

]]>
Progress bar with dynamic coloration 2021-11-15T00:00:00Z https://css-tip.com/progress-bar-dynamic-color/ <![CDATA[

Create a CSS-only progress bar with a dynamic coloration. The color change based on the value

  • No JavaScript
  • No specific CSS selector

progress bar with dynamic coloration

Read more

]]>
One column to control the height of another 2021-11-05T00:00:00Z https://css-tip.com/equal-height-column/ <![CDATA[

Make one column control the height of another column whatever its content.

Below, the left column will control the right column.

No JavaScript is needed, only three lines of CSS will do the job

equal height column

Read more

]]>
CSS-only plus/cross icon 2021-11-04T00:00:00Z https://css-tip.com/css-plus-symbol/ <![CDATA[

Create a plus icon ➕ or a cross icon ✖️

  • One element
  • No Pseudo element
  • One gradient
  • Easily adjust the size and coloration

CSS-only cross/plus icon

Read more

]]>
Corner-only border around an image 2021-11-03T00:00:00Z https://css-tip.com/corner-only-border/ <![CDATA[

Create a corner-only border around any element.

  • No extra element
  • No Pseudo-element
  • Only background properties

You can also animate it on hover!

image with corner-only border

Read more

]]>