I would like to know how to make a circle with a text in the center in asp.net, follow the image of the expected result.
Try the following code, if you are not using razor puts it in your format:
.bloco{
background-color: #4fb7ad;
font-size: 10px;
color: white;
padding: 10px;
border-radius: 50%;
text-align: center;
display: inline;
}
<div class="bloco">
M
</div>
If you want to put only one letter inside the circle, you can do this:
p {
border-radius: 50%;
background: #4CB5AB;
color: #fff;
display: inline;
padding: 5px 10px
}
<p>M</p>
In case of being a word or phrase, one way to do it is with flexbox defining the properties align-items
and justify-content
:
.circulo {
border-radius: 50%;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
justify-content: center;
background: #4CB5AB;
color: #fff;
width: 300px;
height: 300px;
}
<div class='circulo'>StackOverflow</div>