Answer the question
In order to leave comments, you need to log in
How to make the background of a web page in the form of a triangle?
There is a landing page PSD layout that has almost the entire background of a solid color. Let's say #fff colors.
But somewhere in the middle of this layout, there is a geometric figure in the background in the form of a wide inverted triangle. Moreover, the base of the triangle is directed to the site header, and the top to the site footer.
A simple background for a landing page is easy to draw. Like this:
html {
background: #fff
}
Answer the question
In order to leave comments, you need to log in
Putting it as an image is not an option
The triangle pseudo-element, and z-index: -1
But the body background must be transparent, otherwise you won't see what's underneath.
https://jsfiddle.net/dhy1xdcx/
You can set gradients: https://codepen.io/SagePtr/pen/rdgeNP?editors=0100
(for example, gradients from yellow to red for clarity, but it is quite possible to replace from white to white, and the background will become uniform, but with a hole in the middle in the form of a triangle)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question