HTML CSS examples for CSS Widget:Shape
Apply triangle shape to an image
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .pageOption {<!--from ww w .j ava2 s .co m--> overflow:hidden; position:relative; width:41em; height:28em; } .option, .option img { width:100%; height:100%; } .option { overflow:hidden; position:absolute; transform:skewX(-56.99deg); } .option:first-child { left:-.26em; transform-origin:100% 0; } .option:last-child { right:-.26em; transform-origin:0 100%; } .option img { transform:skewX(56.99deg); transform-origin:inherit; } </style> </head> <body> <div class="pageOption"> <a href="#" class="option" data-inf="photo"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </a> </div> </body> </html>