L
L
ligisayan2015-10-30 15:45:36
css
ligisayan, 2015-10-30 15:45:36

How to achieve triangular bevels in blocks using styles?

Greetings! Please tell me how to use styles to achieve such bevels in blocks as in pictures 1 and 2, and the text can be of different heights - is it possible or only with the help of a script?
1db8062fdd3643f3b29ecc9f1838ee36.png
6f0621ca6b4c49c88ae32f0162ddfe8f.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
SerzN1, 2015-10-30
@ligisayan

This can be done jsfiddle.net/SerzN1/bpmqbzsp
I don't think it's worth explaining that the 2nd option is easier
. In this option there are of course some limitations with backgrounds and the maximum width of the arrow.
If you need arrows on complex backgrounds, then you need to look here htmlbook.ru/blog/matritsa-preobrazovanii (in this scenario, height: 100% will work).
This feature was actively used on the sochi2014 website (it was closed), all the blocks were "skew" there.
The main thing is that if you don't run into only 1 element + pseudo-elements, then it's even much easier to do.

A
Anton Nagaets, 2015-10-30
@gr1mm3r

Geometric shapes in CSS

K
Kirill, 2015-10-30
@GoooodBoy

use pseudo elements. In your case :after
If it's not clear, here's an example - codepen.io/GoooodBoy/pen/dYKROB
UDP: Another option is via clip-path: polygon. It turns out rubber. The code on the codepen has been updated.

I
inDeepCode, 2015-10-30
@inDeepCode

graphics

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question