S
S
Space2015-10-17 10:03:23
css
Space, 2015-10-17 10:03:23

How to make a div proportional?

It is necessary that two such oblique blocks stretch on the page with a width of 100%.

.header-left{
  width: 70%;
   	height: 0px;
   	border-top: 100px solid #F00;
        border-right: 100px solid transparent;
 	float: left;
  margin-right: -100px;
}

.header-right{
  width: 30%;
 	height: 0; 
 	border-bottom: 100px solid #ccc; 
  border-left: 100px solid transparent;
  float:left;
}

But this does not work, because you have to make another minus indent so that the blocks are connected. How can this be achieved? In addition, if you make blocks in this way, then I can’t increase them in height.
79362c2188544d3eb1ba1bfa02364e2f.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
holfza, 2015-10-17
@ruslite

https://jsfiddle.net/mrqkd33w/2/

P
Pavel Torbeev, 2015-10-17
@glizer

Alternatively, such a solution
https://jsfiddle.net/mrqkd33w/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question