html - Can't get smooth egdes on a hexagon in css -


i've made hexagon container image, can't figure how add more smooth/curved edges on it.

i hoping me.

.hexagon {    position: relative;    width: 180px;     height: 103.92px;    background-color: #64c7cc;    margin: 51.96px 0;  }    .hexagon:before,  .hexagon:after {    content: "";    position: absolute;    width: 0;    border-left: 90px solid transparent;    border-right: 90px solid transparent;  }    .hexagon:before {    bottom: 100%;    border-bottom: 51.96px solid #64c7cc;  }    .hexagon:after {    top: 100%;    width: 0;    border-top: 51.96px solid #64c7cc;  }
<div class="hexagon"></div>

thanks help.

you can achieve similar using divs z-index , radial-gradient:

<div class="hexagon"></div> <div class="circle"></div> 

and css:

body {   background-color: #eeeeee; }  .circle {   width: 240px;   position: absolute;   top:15px;   height: 240px;   z-index: 2;   background: -webkit-radial-gradient(transparent 59%, #eeeeee 41%);   background: -o-radial-gradient(transparent 59%, #eeeeee 41%);    background: -moz-radial-gradient(transparent 59%, #eeeeee 41%);    background: radial-gradient(transparent 59%, #eeeeee 41%);  }   .hexagon {   position: absolute;   top: 31px;   left: 38px;   width: 180px;    height: 103.92px;   background-color: #64c7cc;   margin: 51.96px 0;   z-index: -1; }  .hexagon:before, .hexagon:after {   content: "";   position: absolute;   width: 0;   border-left: 90px solid transparent;   border-right: 90px solid transparent;  }  .hexagon:before {   bottom: 100%;   border-bottom: 51.96px solid #64c7cc; }  .hexagon:after {   top: 100%;   width: 0;   border-top: 51.96px solid #64c7cc; } 

the body background color property blend outside gradient background, remove see gradient on it's own. doesn't work in ie 9 , below though....

jsfiddle


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -