S
S
Sergey2020-04-24 00:46:10
css
Sergey, 2020-04-24 00:46:10

How to make an octagonal button?

Please help me how can I make an octagonal button?

5ea20c8b218d1339536075.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
A person from Kazakhstan, 2020-04-24
@UDAV99

The button is clickable

A
anakondoz, 2020-04-24
@anakondoz

https://habr.com/en/post/126207/
<div id="octagon"></div>

#octagon {
  width: 300px;
  height: 100px;
  background: red;
  position: relative;
}

 
#octagon:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;    
  border-bottom: 29px solid red;
  border-left: 29px solid #eee;
  border-right: 29px solid #eee;
  width: 242px;
  height: 0;
}
 
#octagon:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;    
  border-top: 29px solid red;
  border-left: 29px solid #eee;
  border-right: 29px solid #eee;
  width: 242px;
  height: 0;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question