background - How do you style triangular mask in CSS? -


i have been looking @ how "inverse triangular" background using css. referring white diagonal parts on bottom, on top of background (fixed) image.

the i've gotten shapes, aren't apparently solution having in mind responsive design. don't care if when window narrower there 1 diagonal, long there no horizontal scroll. shapes , absolute width mess up.

i apologize if silly/common/often asked thing. haven't been able find it, due lack of technical term. thank :)

edit: page keeps scrolling down! there content below diagonals/triangles. triangles not bottom of page.

enter image description here

here's fiddle similar , responsive: http://jsfiddle.net/blbu5/

html:

<body> <div id="triangle-holder"> <div id="triangle-1"></div> <div id="triangle-2"></div> </div> </body> 

css:

body { background-image: url('http://miriadna.com/desctopwalls/images/max/ideal-landscape.jpg'); margin: 0; padding: 0;  }  #triangle-1 {  width: 0;  height: 0;  border-bottom: 30vw solid red;  border-right: 100vw solid transparent; float: left; }  #triangle-2 {  width: 0;  height: 0;  border-bottom: 30vw solid red;  border-left: 100vw solid transparent;  }   #triangle-holder { position: absolute; bottom: 0; } 

read technique here: https://css-tricks.com/examples/shapesofcss/

hope works!


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -