-2

I have to create a Circular Button with icon(PNG Icon) and Dynamic Text Inside it.

I am looking for a simple way to generate it in HTML_CSS (preferably CSS). Features:

  1. Change Inner Circle Fill Color by Simple CSS Class change (Pink, Blue, Gray)
  2. Update Text displayed as required (Numbers/Count) by changing HTML Text
  3. Trigger JS function on Click of Button

Added Simple Rough Paint Mockup Here

I tried looking for existing solutions:

Unable to get Solution that has both of them ?

  • Welcome to Stack Overflow. Please edit your question to include details of what you have tried so far and the code you used in a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) so we can see what you are doing and be able to help. – FluffyKitten Jul 27 '20 at 10:28

1 Answers1

0

Simple HTML and CSS Can do. You need font-awesome library to make use of awesome ICONS. Here is my try for your question

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>


.btn {
  display:block;
  height: 50px;
  width: 50px;
  border-radius: 50%;
  border: 1px solid red;
  
}
</style>
</head>
<body>

<!-- For dynamic button values you can add some functions -->
<button class="btn"><i class="fa fa-camera-retro"></i> Clicks</button>

</body>
</html>
Aroon
  • 991
  • 2
  • 15
  • 34