I have an hexagon shapped div where I am placing input field but I would like to have round corners, however, it breaks shape if I change border-radius:
https://jsfiddle.net/burimsyla/0cbou4wr/43/
div {
display: flex;
flex-wrap: wrap;
margin: 0;
padding: 30px 20px;
border: none;
font-family: sans-serif;
}
div .header {
flex-basis: 100%;
margin: -10px 0 10px;
text-align: center;
color: #1E9BAF;
}
div input,
div button {
flex-grow: 1;
height: 30px;
margin: 0 5px;
padding: 0 5px;
box-sizing: border-box;
background-color:#1E9BAF;
border: 0;
}
.rhombus {
position: relative;
-webkit-perspective: 600px;
perspective: 600px;
border-radius: 10px;
}
.rhombus:before,
.rhombus:after {
content: "";
position: absolute;
left: 0;
height: 50%;
width: 100%;
background-color: #1E9BAF;
z-index: -1;
}
.rhombus:before {
top: 0;
-webkit-transform: rotateX(30deg);
-webkit-transform-origin: center bottom;
-ms-transform: rotateX(30deg);
-ms-transform-origin: center bottom;
transform: rotateX(30deg);
transform-origin: center bottom;
/*box-shadow: 3px 5px #DDD;*/
}
.rhombus:after {
bottom: 0;
-webkit-transform: rotateX(-30deg);
-webkit-transform-origin: center top;
-ms-transform: rotateX(-30deg);
-ms-transform-origin: center top;
transform: rotateX(-30deg);
transform-origin: center top;
/*box-shadow: 5px 5px #DDD;*/
}
<div class="rhombus">
<input name="name" placeholder="An input field"/>
</div>
Besides that problem, can anyone tell me how to change the width of this hexagon without breaking the shape of it? For how it looks please refer to the fiddle link I provided above!