Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"3D Box Model"
Bootstrap 4.1.1 Snippet by
ravishkumar
4.1.1
Preview
HTML
CSS
View Full Screen
Fork
Fork this
3.6K
 
3 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="main"> <div class="cube"> <div class="layer right">Right</div> <div class="layer left">Left</div> <div class="layer front">Front</div> <div class="layer back">Back</div> <div class="layer top">Top</div> <div class="layer bottom">Bottom</div> </div> </div> </div> </div>
.main{ width : 200px; height : 200px; margin : 100px auto;} .cube{ perspective : 10000px; width : 100%; height : 100%; perspective-origin : 150% 150%; transform-style : preserve-3d; animation : ani 7s infinite;}.layer{ position : absolute; line-height : 200px; width : 200px; height : 200px; font-size : 50px; color : #000; text-align : center;}.right{ background-color : red; transform : rotateY(90deg) translateZ(100px);}.left{ background-color : green; transform : rotateY(-90deg) translateZ(100px);}.front{ background-color : yellow; transform : translateZ(100px);}.back{ background-color : cyan; transform : rotateY(180deg) translateZ(100px);}.top{ background-color : purple; transform : rotateX(90deg) translateZ(100px);}.bottom{ background-color : blue; transform : rotateX(-90deg) translateZ(100px);}@keyframes ani{ 25%{transform:rotateX(360deg);} 50%{transform:rotateY(180deg) translateZ(100px);} 75%{transform:rotateY(35deg) rotateX(45deg);} 100%{transform:rotateY(270deg) rotateX(360deg);} }
Related:
See More
Template
Material Dashboard Pro Angular
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76