Element styling such that it can give a rotated and tilted effect

<div> Element styling such that it can give a rotated and tilted effect



Hi i wanted to know how can the tilted style of the header section present in the image can be recreated using element and CSS?



this is what i wanted to create




body
margin: 0px;
background-color: #FFEF4C;


#header
background-color: #FF3578;
height: 300px;
transform: rotate(20deg);


<div id="header"></div>



i want to get rid of those yellow gaping and want the header div to cover all the upper area....but i dont know how stupid of me






Sample code and your try required!

– Prashant Pimpale
Sep 9 '18 at 6:11






k will add it in a min giving the problem a second try

– aditya prakash
Sep 9 '18 at 6:16




2 Answers
2



I suppose you want something like this:




body
margin: 0px;
background-color: #FFEF4C;


#header
background:
linear-gradient(to bottom left,#FF3578 49.5%,transparent 50%);
height: 200px;


<div id="header"></div>



I have solved this by adding margin property in your code check this out:


margin




<html>

<head>
<style>
body
margin: 0px;
background-color: #FFEF4C;


#header
background-color: #FF3578;
height: 300px;
margin-top: -30px;
transform: rotate(20deg);

</style>
</head>

<body>

<div id="header"></div>

<body>

</html>



Note that margin-top: -30px; did the magic.


margin-top: -30px;






i wanted the other area to be covered as well the remain yellow portion

– aditya prakash
Sep 10 '18 at 9:25



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)