css3 - Can I do a diagonal line in CSS? -


i want design this:

so in fact left side background-color, right side background-color (divs of course, easy).

but can diagonal line css?

you can achieve shape skewed pseudo element :

demo

html :

<div>     <h1>your title here</h1> </div> 

css :

div{     padding:0 10px 10px;     background:#e7e5dd;  } h1{     margin:0;     display:inline-block;     position:relative;     z-index:1;     padding:10px 50px 10px;     overflow:hidden; } h1:before{     content:'';     width:100%; height:100%;     position:absolute;     top:0; left:0;     background:#fff;     z-index:-1;      -webkit-transform: skewx(-20deg);     -ms-transform: skewx(-20deg);     transform: skewx(-20deg);      -webkit-transform-origin:0 0;     -ms-transform-origin:0 0;     transform-origin:0 0; } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -