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

PREVIOUS NEXT
Code Example
Css :: background color 
Css :: box sizing css 
Css :: text-align attribute in css 
Css :: z-index on position absolute 
Css :: style input number css 
Css :: focus on input change label color 
Css :: border style shorthand 
Css :: ie showing close icon 
Css :: css multiline comment 
Css :: css make background image repeat vertically 
Css :: html textgröße ändern css 
Css :: indexes 
Css :: text vs font properties in css 
Css :: what is display inline 
Css :: scss to css 
Css :: reset css simples 
Css :: css() multiple 
Css :: css body overflow hidden sidebar scrollbar 
Css :: laravel 7 css not working 
Css :: sub menu disappears on hover css 
Css :: svg tailwind 
Css :: animation-delay in css 
Css :: tailwind css modules 
Css :: custom checkbox 
Css :: git apagar branch remoto 
Css :: woocommerce cart css description 
Css :: css homepage 
Css :: transform translate-x ie11 
Css :: gmail auto rewize dont 
Css :: no nobr substitute in html 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =