Vertical 3D Bar using CSS - html

I need this vertically:
I tried a few things, but, I'm messing up something with the bottom layer and colors inside it.
EDIT:
I want colors to be started from the bottom of the bar, going upwards.
How do I add the bottom layer of the bar? I'm messing up with its height.
* {
margin: 0;
padding: 0;
}
.wrapper {
width: 100%;
height: 100%;
position: absolute;
display: block;
background-color: black;
}
.progress-wrapper {
width: 60px;
height: 300px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.progressbar {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transform: rotateX(-20deg) rotateY(-30deg);
}
.side {
width: 100%;
height: 100%;
background-color: rgba(254, 254, 254, 0.3);
position: absolute;
}
/* .bottom {
transform: rotateX(90deg);
transform-origin: bottom;
} */
.back {
transform: translateZ(-60px);
}
.left {
transform: rotateY(90deg);
transform-origin: left;
}
.right {
background-color: rgba(250, 250, 250, 0.1);
transform: rotateY(-90deg);
transform-origin: right;
}
.bar {
height: 50%;
background-color: rgba(225, 0, 120, 0.6);
box-shadow: 5px 5px 50px 5px rgba(225, 0, 120, 0.3);
width: 60px;
}
<div class="wrapper">
<div class="progress-wrapper">
<div class="progressbar">
<div class="side front"><div class="bar"></div></div>
<div class="side back"><div class="bar"></div></div>
<div class="side bottom"><div class="bar"></div></div>
<div class="side left"><div class="bar"></div></div>
<div class="side right"><div class="bar"></div>
</div>
</div>
</div>
Here's the result of what I tried:
What am I doing wrong? Am I going the right way? Is there any other less messy way to do this? (NOTE: I don't want to use HTML Canvas.)

Try increasing the height of .bar:
* {
margin: 0;
padding: 0;
}
.wrapper {
width: 100%;
height: 100%;
position: absolute;
display: block;
background-color: black;
}
.progress-wrapper {
width: 60px;
height: 300px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.progressbar {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transform: rotateX(-20deg) rotateY(-30deg);
}
.side {
width: 100%;
height: 100%;
background-color: rgba(254, 254, 254, 0.3);
position: absolute;
}
/* .bottom {
transform: rotateX(90deg);
transform-origin: bottom;
} */
.back {
transform: translateZ(-60px);
}
.left {
transform: rotateY(90deg);
transform-origin: left;
}
.right {
background-color: rgba(250, 250, 250, 0.1);
transform: rotateY(-90deg);
transform-origin: right;
}
.bar {
height: 80%;
background-color: rgba(225, 0, 120, 0.6);
box-shadow: 5px 5px 50px 5px rgba(225, 0, 120, 0.3);
width: 60px;
}
<div class="wrapper">
<div class="progress-wrapper">
<div class="progressbar">
<div class="side front">
<div class="bar"></div>
</div>
<div class="side back">
<div class="bar"></div>
</div>
<div class="side bottom">
<div class="bar"></div>
</div>
<div class="side left">
<div class="bar"></div>
</div>
<div class="side right">
<div class="bar"></div>
</div>
</div>
</div>
</div>

Ok, I figured out the answer to my second question about colors.
Picture
According to the height of the color fill in the bar, adjust its position in the bar by using the translateY() method.
Example: By adding height: 200px; transform: translateY(100px) ( where the height of the container is 300px ) in ".bar" class in CSS solves the problem.
Still, I couldn't figure out about the bottom layer.

Related

Issues in progress bar

I am working on an angular app and making a progress bar using angular. I am facing two problems with my progress bar.
The 4th section of web development is titled from end. I want to make it straight same as first section
Text inside boxes coming in one after the other lines. I want them in one single line in parallel.
How can I resolve these issues?
.wrap {
width: 100%;
height: 30px;
z-index: -2;
white-space: nowrap;
overflow: hidden;
}
.wrap div:first-child {
margin-left: -2%;
}
.progress {
margin: 0;
margin-left: 0.5%;
height: 30px;
width: 25%;
position: relative;
display: inline-block;
text-align: center;
line-height: 30px;
transition: all 0.8s;
}
.progress:before,
.progress:after {
content: "";
position: absolute;
transition: all 0.8s;
z-index: -1;
}
.progress:before {
height: 50%;
width: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.2);
-webkit-transform: skew(45deg);
-moz-transform: skew(45deg);
transform: skew(45deg);
}
.progress:after {
height: 50%;
width: 100%;
top: 50%;
left: 0;
background: rgba(0, 0, 0, 0.2);
-webkit-transform: skew(-45deg);
-moz-transform: skew(-45deg);
transform: skew(-45deg);
}
.progress:hover:before,
.progress:hover:after {
background: tomato;
}
<div class="wrap">
<div class="progress">
<div>MyData</div>
<div>My Status</div>
</div>
<div class="progress">
<div>MyData</div>
<div>My Status</div>
</div>
<div class="progress">
<div>MyData</div>
<div>My Status</div>
</div>
<div class="progress">
<div>MyData</div>
<div>My Status</div>
</div>
</div>
Since you've put each label in a div element you might use flex layout on the parent. Otherwise, simply put both labels in the same div. Here I demonstrate both approaches.
.wrap {
width: 100%;
height: 30px;
z-index: -2;
white-space: nowrap;
overflow: hidden;
}
.wrap div:first-child {
margin-left: -2%;
}
.progress {
margin: 0;
margin-left: 0.5%;
height: 30px;
width: 25%;
position: relative;
display: inline-flex; /* updated */
justify-content: center; /* new */
gap: 8px; /* new */
text-align: center;
line-height: 30px;
transition: all 0.8s;
}
.progress:before,
.progress:after {
content: "";
position: absolute;
transition: all 0.8s;
z-index: -1;
}
.progress:before {
height: 50%;
width: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(45deg);
}
.progress:after {
height: 50%;
width: 100%;
top: 50%;
left: 0;
background: rgba(0, 0, 0, 0.2);
-webkit-transform: skew(-45deg);
-moz-transform: skew(-45deg);
transform: skew(-45deg);
}
.progress:hover:before,
.progress:hover:after {
background: tomato;
}
<div class="wrap">
<div class="progress">
<div>MyData</div>
<div>My Status</div>
</div>
<div class="progress">
<div>MyData</div>
<div>My Status</div>
</div>
<div class="progress">
<div>MyData My Status</div>
</div>
<div class="progress">
<div>MyData My Status</div>
</div>
</div>

Divide sections in progress bar

I am working on angular app and I am very new to html and css. I am trying to make a progress bar. I want to divide each section of this progress bar into two sub sections with different background color as shown here in the image below.
my code is as follows:
.wrap {
width: 100%;
height: 30px;
z-index: -2;
white-space: nowrap;
overflow: hidden;
}
.wrap div:first-child {
margin-left: -2%;
}
.progress {
margin: 0;
margin-left: 0.5%;
height: 30px;
width: 25%;
position: relative;
display: inline-block;
text-align: center;
line-height: 30px;
transition: all 0.8s;
}
.progress:before,
.progress:after {
content: "";
position: absolute;
transition: all 0.8s;
z-index: -1;
}
.progress:before {
height: 50%;
width: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(45deg);
}
.progress:after {
height: 50%;
width: 100%;
top: 50%;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(-45deg);
}
.progress:hover:before,
.progress:hover:after {
background: tomato;
}
<div class="wrap">
<div class="progress">
simple
</div>
<div class="progress">
as
</div>
<div class="progress">
complex
</div>
<div class="progress">
Web Development
</div>
</div>
How can I do this? Please help.
.wrap {
width: 100%;
height: 30px;
z-index: -2;
white-space: nowrap;
overflow: hidden;
}
.wrap div:first-child {
margin-left: -2%;
}
.progress {
margin: 0;
margin-left: 0.5%;
height: 30px;
width: 25%;
position: relative;
display: inline-block;
text-align: center;
line-height: 30px;
transition: all 0.8s;
}
.progress:before,
.progress:after {
content: "";
position: absolute;
transition: all 0.8s;
z-index: -1;
}
.progress:before {
height: 50%;
width: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(45deg);
}
.progress:after {
height: 50%;
width: 100%;
top: 50%;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(-45deg);
}
#div1{
width:60%;
}
#div2{
width:40%;
}
#div2:hover:before,#div2:hover:after
{
background: green !important;
}
#div1:hover:before,#div1:hover:after
{
background: orange; !important;
}
<div class="wrap">
<div class="progress">
<div class="progress" id="div1">simple</div>
<div class="progress" id="div2">simple</div>
</div>
<div class="progress">
as
</div>
<div class="progress">
complex
</div>
<div class="progress">
Web Development
</div>
</div>
.wrap {
width: 100%;
height: 30px;
z-index: -2;
white-space: nowrap;
overflow: hidden;
}
.wrap div:first-child {
margin-left: -2%;
}
.progress {
margin: 0;
margin-left: 0.5%;
height: 30px;
width: 25%;
position: relative;
display: inline-block;
text-align: center;
line-height: 30px;
transition: all 0.8s;
}
.progress:before,
.progress:after {
content: "";
position: absolute;
transition: all 0.8s;
z-index: -1;
}
.progress:before {
height: 50%;
width: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(45deg);
}
.progress:after {
height: 50%;
width: 100%;
top: 50%;
left: 0;
background: rgba(0, 0, 0, 0.2);
transform: skew(-45deg);
}
#div1{
width:60%;
}
#div2{
width:40%;
}
#div2:hover:before,#div2:hover:after
{
background: green !important;
}
#div1:hover:before,#div1:hover:after
{
background: orange; !important;
}
<div class="wrap">
<div class="progress">
<div class="progress" id="div1">simple</div>
<div class="progress" id="div2">simple</div>
</div>
<div class="progress">
as
</div>
<div class="progress">
complex
</div>
<div class="progress">
Web Development
</div>
</div>
You could use a linear gradient, e.g.:
background: linear-gradient(90deg, rgba(0,212,255,1) 80%, rgba(0,0,0,0.2) 80%);
.wrap {
width: 100%;
height: 30px;
z-index: -2;
white-space: nowrap;
overflow: hidden;
}
.wrap div:first-child {
margin-left: -2%;
}
.progress {
margin: 0;
margin-left: 0.5%;
height: 30px;
width: 25%;
position: relative;
display: inline-block;
text-align: center;
line-height: 30px;
transition: all 0.8s;
}
.progress:before,
.progress:after {
content: "";
background: linear-gradient(90deg, rgba(0,212,255,1) 80%, rgba(0,0,0,0.2) 80%);
position: absolute;
transition: all 0.8s;
z-index: -1;
}
.progress:before {
height: 50%;
width: 100%;
top: 0;
left: 0;
transform: skew(45deg);
}
.progress:after {
height: 50%;
width: 100%;
top: 50%;
left: 0;
transform: skew(-45deg);
}
.progress:hover:before,
.progress:hover:after {
background: tomato;
}
<div class="wrap">
<div class="progress">
simple
</div>
<div class="progress">
<div style="display:inline-block;width:80%;">80%</div>
<div style="display:inline-block;width:20%;">20%</div>
</div>
<div class="progress">
complex
</div>
<div class="progress">
Web Development
</div>
</div>

HTML Image on top of triangle background

I have an image on a triangle background, however there is seen a line crossing the image. I tried using z-index together with position both relative and absolute, but it doesn't seem to work. Can someone help me out? Much appreciated.
/* Reset. */
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-size: 100%;
font-family: Arial, Helvetica, sans-serif;
}
/* Panels. */
.splitview {
position: relative;
width: 100%;
min-height: 45vw;
overflow: hidden;
}
.panel {
position: absolute;
width: 100vw;
min-height: 45vw;
overflow: hidden;
}
.panel .content {
position: absolute;
width: 100vw;
min-height: 45vw;
color: #FFF;
}
.panel .description {
width: 25%;
position: absolute;
top: 50%;
transform: translateY(-50%);
text-align: center;
}
.panel img {
box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.15);
width: 35%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.bottom {
background-color: rgb(44, 44, 44);
z-index: 1;
}
.bottom .description {
right: 5%;
}
.top {
background-color: rgb(77, 69, 173);
z-index: 2;
width: 50vw;
/*-webkit-clip-path: polygon(60% 0, 100% 0, 100% 100%, 40% 100%);
clip-path: polygon(60% 0, 100% 0, 100% 100%, 40% 100%);*/
}
.top .description {
left: 5%;
}
/* Handle. */
.handle {
height: 100%;
position: absolute;
display: block;
width: 5px;
top: 0;
left: 50%;
z-index: 3;
}
/* Skewed. */
.skewed .handle {
top: 50%;
transform: rotate(30deg) translateY(-50%);
height: 200%;
-webkit-transform-origin: top;
-moz-transform-origin: top;
transform-origin: top;
}
.skewed .top {
transform: skew(-30deg);
margin-left: -1000px;
width: calc(50vw + 1000px);
}
.skewed .top .content {
transform: skew(30deg);
margin-left: 1000px;
}
/* Responsive. */
#media (max-width: 900px) {
body {
font-size: 75%;
}
}
<div class="splitview skewed">
<div class="panel bottom">
<div class="content">
<div class="description">
<h1>My name is John Snow.</h1>
<p>I like making popcorn with icicles alot.</p>
</div>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/original-image.jpg" alt="Original">
</div>
</div>
<div class="panel top">
<div class="content">
<div class="description">
<h1>I dream about this girl everyday, but cannot seem to forget her.</h1>
<p>People say not many people can fall in love, and it's good I can experience it, but what is unrequited love worth actually.</p>
</div>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/original-image.jpg" alt="Duotone">
</div>
</div>
<div class="handle"></div>
</div>
Use only one image and put it outside the panels.
/* Reset. */
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-size: 100%;
font-family: Arial, Helvetica, sans-serif;
}
.splitview img {
z-index: 3;
box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.15);
width: 35%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Panels. */
.splitview {
position: relative;
width: 100%;
min-height: 45vw;
overflow: hidden;
}
.panel {
position: absolute;
width: 100vw;
min-height: 45vw;
overflow: hidden;
}
.panel .content {
position: absolute;
width: 100vw;
min-height: 45vw;
color: #FFF;
}
.panel .description {
width: 25%;
position: absolute;
top: 50%;
transform: translateY(-50%);
text-align: center;
}
.bottom {
background-color: rgb(44, 44, 44);
z-index: 1;
}
.bottom .description {
right: 5%;
}
.top {
background-color: rgb(77, 69, 173);
z-index: 2;
width: 50vw;
/*-webkit-clip-path: polygon(60% 0, 100% 0, 100% 100%, 40% 100%);
clip-path: polygon(60% 0, 100% 0, 100% 100%, 40% 100%);*/
}
.top .description {
left: 5%;
}
/* Handle. */
.handle {
height: 100%;
position: absolute;
display: block;
width: 5px;
top: 0;
left: 50%;
z-index: 3;
}
/* Skewed. */
.skewed .handle {
top: 50%;
transform: rotate(30deg) translateY(-50%);
height: 200%;
-webkit-transform-origin: top;
-moz-transform-origin: top;
transform-origin: top;
}
.skewed .top {
transform: skew(-30deg);
margin-left: -1000px;
width: calc(50vw + 1000px);
}
.skewed .top .content {
transform: skew(30deg);
margin-left: 1000px;
}
/* Responsive. */
#media (max-width: 900px) {
body {
font-size: 75%;
}
}
<div class="splitview skewed">
<div class="panel bottom">
<div class="content">
<div class="description">
<h1>My name is John Snow.</h1>
<p>I like making popcorn with icicles alot.</p>
</div>
</div>
</div>
<div class="panel top">
<div class="content">
<div class="description">
<h1>I dream about this girl everyday, but cannot seem to forget her.</h1>
<p>People say not many people can fall in love, and it's good I can experience it, but what is unrequited love worth actually.</p>
</div>
</div>
</div>
<div class="handle"></div>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/original-image.jpg" alt="Duotone">
</div>
It can be hard to get two elements exactly lined up when there is some sort of transform or resizing going on because the arithmetic can result in part CSS pixel being required, and that can cause trouble translating to the multiple screen pixels that can make up a CSS pixel on modern, high res screens.
Your spurious line looks like not as wide as a CSS pixel and could be screen pixels 'left behind' during these calculations.
I found your layout quite hard to follow as there were skews and other transforms.
Looking at the layout I wonder if a simpler approach - a 3 column grid with flex used to center items within the panels might suffice? It would make maintenance easier. The skews seemed to be needed for the background 'triangular' shapes and this snippet replaces them with a sloping linear gradient as the content element's background. No skewing or other transforms are required.
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-size: 100%;
font-family: Arial, Helvetica, sans-serif;
}
.content {
position: absolute;
min-height: 45vw;
width: 100vw;
color: #fff;
text-align: center;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
background-image: linear-gradient(-60deg, rgb(44, 44, 44) 0, rgb(44, 44, 44) 48%, rgb(77, 69, 173) 48%, rgb(77, 69, 173) 100%);
}
.panel {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.panel .description {
width: 75%;
}
.panel img {
width: 100%;
height: 100%;
object-fit: contain;
/* commented out as I don't understand it's use here box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.15);*/
}
<body>
<div class="content">
<div class="panel">
<div class="description">
<h1>I dream about this girl everyday, but cannot seem to forget her.</h1>
<p>People say not many people can fall in love, and it's good I can experience it, but what is unrequited love worth actually.</p>
</div>
</div>
<div class="panel">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/original-image.jpg" alt="Original">
</div>
<div class="panel">
<div class="description">
<h1>My name is John Snow.</h1>
<p>I like making popcorn with icicles alot.</p>
</div>
</div>
</div>
<div class="handle"></div>
</div>
</body>

Re-sizing a cube

I have a set of codes from the cube created using CSS.
However, how do I resize this into a bigger cube (for example, 200px)? I have tried but everytime I try doing it, it goes out of position..
.mainDiv {
position: relative;
width: 206px;
height: 190px;
margin: 0px auto;
margin-top: 100px;
}
.square {
width: 100px;
height: 100px;
background: #c52329;
border: solid 2px #FFF;
transform: skew(180deg, 210deg);
position: absolute;
top: 43px;
}
.square2 {
width: 100px;
height: 100px;
background: #c52329;
border: solid 2px #FFF;
transform: skew(180deg, 150deg);
position: absolute;
left: 102px;
top: 43px;
}
.square3 {
width: 114px;
height: 100px;
background: #c52329;
border: solid 2px #FFF;
transform: rotate(150deg) translate(-40px, -16px) skew(30deg, 0deg);
position: absolute;
left: 0px;
top: -32px;
}
<div class="mainDiv">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>
You may first adjust your code to make the shape easier by reducing the code and removing some fixed values then you only need to change the size of the main element to make the cube bigger or smaller:
* {
box-sizing:border-box;
}
.mainDiv {
position: relative;
width: 200px;
height: 100px;
margin: 120px auto 0;
font-size:0;
}
.mainDiv > * {
background: #c52329;
border: solid 2px #FFF;
}
.square,
.square2{
width: 50%;
height: 100%;
display:inline-block;
}
.square {
transform-origin:top left;
transform:skewY(30deg);
}
.square2 {
transform-origin:top right;
transform:skewY(-30deg);
}
.square3 {
width: calc(50% * 1.14);
height: 100%;
transform: rotate(-30deg) skewX(30deg);
position: absolute;
transform-origin:top left;
top:0;
}
<div class="mainDiv">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>
<div class="mainDiv" style="width:100px;height:50px;">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>
<div class="mainDiv" style="width:400px;height:200px;">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>
You can also reduce the code using pseudo-element and introduce CSS variable to control the size:
.mainDiv {
position: relative;
--d:50px;
width: calc(var(--d) * 1.73 * var(--s, 1)); /* x sqrt(3) */
height: calc(var(--d) * var(--s, 1));
margin: calc(var(--d) * var(--s, 1)) auto;
}
.mainDiv:before,
.mainDiv:after {
content: "";
width: 50%;
height: 100%;
background:
linear-gradient(#c52329,#c52329) center/calc(100% - 4px) calc(100% - 4px) no-repeat,
#fff;
display: inline-block;
}
.mainDiv:before {
transform-origin: top left;
transform: skewY(30deg);
}
.mainDiv:after {
transform-origin: top right;
transform: skewY(-30deg);
}
.mainDiv>div {
position: absolute;
width: calc(50% * 1.154); /* x (1/cos(30)) */
padding-top:50%;
transform: rotate(-30deg) skewX(30deg);
background:
linear-gradient(#c52329,#c52329) center/calc(100% - 4px) calc(100% - 4px) no-repeat,
#fff;
top: 0;
transform-origin: top left;
}
<div class="mainDiv" style="--s:0.5"><div></div></div>
<div class="mainDiv"><div></div></div>
<div class="mainDiv" style="--s:1.5"><div></div></div>
<div class="mainDiv" style="--s:2"><div></div></div>
<div class="mainDiv" style="--s:3"><div></div></div>
You can even reduce more the code by relying on some gradient as background to create one part of the shape and remove the inner div and you will only have one element at the end:
.mainDiv {
position: relative;
--d:50px;
width: calc(var(--d) * 1.73 * var(--s,1));
height: calc(var(--d) * var(--s,1));
margin: 0 auto calc(var(--d) * var(--s,1));
background:
linear-gradient(to bottom left,#c52329 47%,transparent 48.5%) bottom left,
linear-gradient(to bottom right,#c52329 47%,transparent 48.5%) bottom right,
linear-gradient(to top left,#c52329 47%,transparent 48.5%) top left,
linear-gradient(to top right,#c52329 47%,transparent 48.5%) top right;
background-size:50.5% 50.5%;
background-repeat:no-repeat;
}
.mainDiv:before,
.mainDiv:after{
content:"";
width:50%;
height: 100%;
background:
linear-gradient(#c52329,#c52329) center/calc(100% - 4px) calc(100% - 4px) no-repeat,
#fff;
display:inline-block;;
}
.mainDiv:before {
transform-origin:top left;
transform:skewY(30deg) translateY(50%);
}
.mainDiv:after {
transform-origin:top right;
transform:skewY(-30deg) translateY(50%);
}
<div class="mainDiv"></div>
<div class="mainDiv" style="--s:1.5"></div>
<div class="mainDiv" style="--s:2"></div>
<div class="mainDiv" style="--s:3"></div>
The easier solution is to scale main container up. You can try to play with values to achieve desired size and position.
.mainDiv {
position: relative;
width: 206px;
height: 190px;
margin: 0px auto;
margin-top: 100px;
transform: scale(2) translate(5px, 70px);
}
.square {
width: 100px;
height: 100px;
background: #c52329;
border: solid 2px #FFF;
transform: skew(180deg, 210deg);
position: absolute;
top: 43px;
}
.square2 {
width: 100px;
height: 100px;
background: #c52329;
border: solid 2px #FFF;
transform: skew(180deg, 150deg);
position: absolute;
left: 102px;
top: 43px;
}
.square3 {
width: 114px;
height: 100px;
background: #c52329;
border: solid 2px #FFF;
transform: rotate(150deg) translate(-40px, -16px) skew(30deg, 0deg);
position: absolute;
left: 0px;
top: -32px;
}
<div class="mainDiv">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>

Convert image to div through css

Can you help the image below convert to Div or table.
I have tried but I have stucked only till circle. Div 1, Div 2 till Div 7 I will replace with the Title, So I need those in middle of DIV.I don't need a 3d border, but if you help me with one I will be grateful.
#container {
position: relative;
width: 100px;
height: 100px;
}
.cover {
position: absolute;
width: 100%;
height: 100%;
clip: rect(0 100px 100px 50px);
}
.pie {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
clip: rect(0 50px 100px 0px);
}
#part1-wrapper {
transform: rotate(0deg);
}
#part1 {
background-color: #3266FF;
transform: rotate(90deg);
}
#part2-wrapper {
transform: rotate(90deg);
}
#part2 {
background-color: green;
transform: rotate(90deg);
}
#part3-wrapper {
transform: rotate(180deg);
}
#part3 {
background-color: #BF0000;
transform: rotate(90deg);
}
#part4-wrapper {
transform: rotate(270deg);
}
#part4 {
background-color: #7030A0;
transform: rotate(90deg);
}
<div id="container">
<div id="part1-wrapper" class="cover">
<div id="part1" class="pie"></div>
</div>
<div id="part2-wrapper" class="cover">
<div id="part2" class="pie"></div>
</div>
<div id="part3-wrapper" class="cover">
<div id="part3" class="pie"></div>
</div>
<div id="part4-wrapper" class="cover">
<div id="part4" class="pie"></div>
</div>
</div>
You can make this significantly simpler by using corner-specific border-radius.
#container {
position: relative;
width: 200px;
height: 200px;
}
.pie {
position: absolute;
width: 49%;
height: 49%;
color: #fff;
font-weight: bold;
text-align: center;
line-height: 98px;
}
#part1 {
background-color: #3266FF;
top:0;
left:0;
border-top-left-radius: 100%;
}
#part2 {
background-color: green;
top:0;
right:0;
border-top-right-radius: 100%;
}
#part3 {
background-color: #BF0000;
bottom:0;
right:0;
border-bottom-right-radius: 100%;
}
#part4 {
background-color: #7030A0;
bottom:0;
left:0;
border-bottom-left-radius: 100%;
}
#part5 {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background: #333394;
color: #fff;
text-align: center;
line-height:50px;
top:50%;
margin-top:-25px;
left:50%;
margin-left:-25px;
}
<div id="container">
<div id="part1" class="pie">part 1</div>
<div id="part2" class="pie">part 2</div>
<div id="part3" class="pie">part 3</div>
<div id="part4" class="pie">part 4</div>
<div id="part5">part 5</div>
</div>