Search
 
SCRIPT & CODE EXAMPLE
 

CSS

css box

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
Comment

box css example

<style>
body {
  background: #0005;
  display: grid;
  place-content: center;
  min-height: 100vh;
  overflow: hidden;
  perspective: 800px;
}
.wrap {
  position: relative;
  margin: 0 auto;
  display: grid;
  place-content: center;
  width: 50vw;
  height: 50vw;
  background: #0202;
  transform-style: preserve-3d;
  transform: translate(0, 0%) translate3d(0, 0, 0) rotate3d(1, 1, 1, 45deg);
  // animation: spin 1s ease forwards infinite;
}
.side {
  position: absolute;
  transform-style: preserve-3d;
  transform-origin: center;
  width: 5rem;
  height: 5rem;
  background: #0005;
  left: 50%;
  top: 50%;
  transform: translate(0, 0%) translate3d(0, 0, 0) rotate3d(1, 1, 0, 45deg);
}
.side:nth-child(1) {
  transform: rotatey(0deg) translate(-50%, -50%) translate3d(0, 0, -5rem);
  background: hsla(50, 60%, 60%, 1);
}
.side:nth-child(2) {
  transform: translate(-50%, -50%) translate3d(0, 50%, -2.5rem)
    rotate3d(1, 0, 0, 90deg);
  background: hsla(100, 60%, 60%, 1);
}
.side:nth-child(3) {
  transform: translate(-50%, -50%) translate3d(0, -50%, -2.5rem)
    rotate3d(1, 0, 0, -90deg);
  background: hsla(140, 60%, 60%, 1);
}
.side:nth-child(4) {
  transform: translate(-50%, -50%) translate3d(50%, 0, -2.5rem)
    rotate3d(0, 1, 0, 90deg);
  background: hsla(180, 60%, 60%, 1);
}
.side:nth-child(5) {
  transform: translate(-50%, -50%) translate3d(-50%, 0, -2.5rem)
    rotate3d(0, 1, 0, -90deg);
  background: hsla(210, 60%, 60%, 1);
}
.side:nth-child(6) {
  transform: rotatex(0deg) translate(-50%, -50%) translate3d(0, 0, 0rem)
    rotate3d(0, 0, 0, -90deg);
  background: hsla(250, 60%, 60%, 1);
}
@keyframes spin {
  to {
    transform: translate(-50%, -50%) translate3d(0, 0, 0)
      rotate3d(1, 0, 0, 45deg);
  }
}

</style>
//////// HTML
<div class="wrap">
  <div class="side a"></div>
  <div class="side b"></div>
  <div class="side c"></div>
  <div class="side d"></div>
  <div class="side e"></div>
  <div class="side f"></div>
</div>
Comment

div box

<div class="box">...</div>
<section>...</section>
Comment

PREVIOUS NEXT
Code Example
Css :: css local variable 
Css :: how to change paragraph text color to Red css 
Css :: css flex cards 
Css :: make image scale based on screen size 
Css :: css padding property 
Css :: safari version 10+ media query 
Css :: first-letter css 
Css :: php get set 
Css :: css flex alle elemente gleiche höhe 
Css :: ahk borderless fullscreen 
Css :: mixed-blend-mode css all properties 
Css :: Script for free code camp test 
Css :: css in head or body 
Css :: css how to find all ids that end with something 
Css :: css hide select label 
Css :: responsive card css 
Css :: fade div 
Css :: css efeito negativo fotos 
Css :: difference bw box and border box 
Css :: css scroll y showing scroll bar 
Css :: popsition relative css 
Css :: nth-child in css 
Css :: repeat css 
Css :: add border at hover of div 
Css :: CSS Border - Shorthand Property 
Css :: add pseudo buttons 
Css :: scroll animation css 
Css :: label for centered image 
Css :: progress bar with width gradient 
Css :: chrome simulate prefers reduced motion 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =