Languages
[Edit]
EN

CSS - div box with arrow in pure CSS

4 points
Created by:
Walter
586

In this short article, we would like to show how to make div box with arrow in pure CSS.

Presented div box with arrow in pure CSS.
Presented div box with arrow in pure CSS.

Solution 1

Edit

Presented solution uses some trick, that allows to set triangle shape for div elements. The trick bases on 2 divs where one has border and is rotated using 45 degrees and second one cuts first one it giving triangle effect, what was presented in the below.

 

Solution 2

Edit

Presented solution uses some trick, that allows to set triangle shape for div elements. That divs are used later with absolute position as triangle with proper box. Using two triangle divs makes possible to ad additional border for arrows, what was presented in the below.

Quick solution:

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

CSS

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join