Skewed Boxes with Background

Developer
Size
3,566 Kb
Views
22,264

How do I make an skewed boxes with background?

Skewing/slanting boxes to create a menu with an unslanted background using CSS. Includes jQuery to make div clickable anywhere the user clicks based upon the link inside the LI element.. What is a skewed boxes with background? How do you make a skewed boxes with background? This script and codes were developed by Taylor Vowell on 07 October 2022, Friday.

Skewed Boxes with Background Previews

Skewed Boxes with Background - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Skewed Boxes with Background</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { font-family: arial;
}
html { box-sizing: border-box;
}
*, *:before, *:after { box-sizing: inherit;
}
ul { margin: 0 0 20px 0; padding: 0; font-size: 0; list-style: none; cursor: default; border-radius: 3px; font-weight: 700; position:relative; left:90px;
}
li { display: inline-block; font-size: 20px; color: white; height: 329px; width:24%; max-width:448px; line-height: 50px; display: inline-block; padding: 0 20px; -webkit-transform: skew(-13deg); -moz-transform: skew(-13deg); transform: skew(-13deg); background-color: #333333; background-repeat: repeat-x; margin-right: 15px; text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.8); border:2px solid #333333; cursor:pointer; background-size:contain; overflow: hidden; -webkit-transform-origin: top left; -ms-transform-origin: top left; transform-origin: top left;
}
li::before { content: ""; transform: skewX(13deg); -ms-transform: skewX(13deg); /* IE 9 */ -webkit-transform: skewX(13deg); /* Safari and Chrome */ background-repeat: no-repeat; background-position: top left; /* new styles */ position: absolute; margin-left:-90px; -webkit-transform-origin: top left; -ms-transform-origin: top left; transform-origin: top left; width: 1000%; /* something ridiculously big */ height: 1000%; /* something ridiculously big */
}
li.slant1::before { background-image: url('http://www.shl-group.com/images/capabilities/SHL-CNC-Machining-Gantry-Type-CNC-Machine.jpg');
}
li.slant2::before { background-image: url('http://www.shl-group.com/images/capabilities/SHL-CNC-Machining-Gantry-Type-CNC-Machine.jpg');
}
li.slant3::before { background-image: url('http://www.shl-group.com/images/capabilities/SHL-CNC-Machining-Gantry-Type-CNC-Machine.jpg');
}
li a { text-transform:uppercase; display: block; font-style: normal; pointer-effects: none; position:absolute; bottom:0px; width:100%; text-align:center; margin-left:-20px; background:#333333;
}
li a { text-decoration:none; color:white;
}
li:hover a { color: #fdc943; background:#191919;
}
li:hover { background:#191919; border:2px solid #191919;
}
@media ( max-width:480px){ ul { margin:10px; left:0px;
}
li { width:100%; -webkit-transform: skew(0deg); -moz-transform: skew(0deg); transform: skew(0deg); margin-bottom:20px; } li::before { transform: skewX(0deg); -ms-transform: skewX(0deg); /* IE 9 */ -webkit-transform: skewX(0deg);
}
}
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body>
<ul> <li class="clickable slant1"><a href="">View Equipment</a></li> <li class="clickable slant2"><a href="">Industries Served</a></li> <li class="clickable slant3"><a href="">Materials</a></li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Skewed Boxes with Background - Script Codes CSS Codes

body { font-family: arial;
}
html { box-sizing: border-box;
}
*, *:before, *:after { box-sizing: inherit;
}
ul { margin: 0 0 20px 0; padding: 0; font-size: 0; list-style: none; cursor: default; border-radius: 3px; font-weight: 700; position:relative; left:90px;
}
li { display: inline-block; font-size: 20px; color: white; height: 329px; width:24%; max-width:448px; line-height: 50px; display: inline-block; padding: 0 20px; -webkit-transform: skew(-13deg); -moz-transform: skew(-13deg); transform: skew(-13deg); background-color: #333333; background-repeat: repeat-x; margin-right: 15px; text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.8); border:2px solid #333333; cursor:pointer; background-size:contain; overflow: hidden; -webkit-transform-origin: top left; -ms-transform-origin: top left; transform-origin: top left;
}
li::before { content: ""; transform: skewX(13deg); -ms-transform: skewX(13deg); /* IE 9 */ -webkit-transform: skewX(13deg); /* Safari and Chrome */ background-repeat: no-repeat; background-position: top left; /* new styles */ position: absolute; margin-left:-90px; -webkit-transform-origin: top left; -ms-transform-origin: top left; transform-origin: top left; width: 1000%; /* something ridiculously big */ height: 1000%; /* something ridiculously big */
}
li.slant1::before { background-image: url('http://www.shl-group.com/images/capabilities/SHL-CNC-Machining-Gantry-Type-CNC-Machine.jpg');
}
li.slant2::before { background-image: url('http://www.shl-group.com/images/capabilities/SHL-CNC-Machining-Gantry-Type-CNC-Machine.jpg');
}
li.slant3::before { background-image: url('http://www.shl-group.com/images/capabilities/SHL-CNC-Machining-Gantry-Type-CNC-Machine.jpg');
}
li a { text-transform:uppercase; display: block; font-style: normal; pointer-effects: none; position:absolute; bottom:0px; width:100%; text-align:center; margin-left:-20px; background:#333333;
}
li a { text-decoration:none; color:white;
}
li:hover a { color: #fdc943; background:#191919;
}
li:hover { background:#191919; border:2px solid #191919;
}
@media ( max-width:480px){ ul { margin:10px; left:0px;
}
li { width:100%; -webkit-transform: skew(0deg); -moz-transform: skew(0deg); transform: skew(0deg); margin-bottom:20px; } li::before { transform: skewX(0deg); -ms-transform: skewX(0deg); /* IE 9 */ -webkit-transform: skewX(0deg);
}
}
}

Skewed Boxes with Background - Script Codes JS Codes

$(".clickable").click(function(){ window.location=$(this).find("a:first").attr("href"); return false;
});
Skewed Boxes with Background - Script Codes
Skewed Boxes with Background - Script Codes
Home Page Home
Developer Taylor Vowell
Username taylorvowell
Uploaded October 07, 2022
Rating 3
Size 3,566 Kb
Views 22,264
Do you need developer help for Skewed Boxes with Background?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Taylor Vowell (taylorvowell) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!