Circle with text in the center Asp.net

Asked

Viewed 132 times

2

I would like to know how to make a circle with a text in the center on Asp.net, follows image of the expected result.inserir a descrição da imagem aqui

2 answers

2

Try the code below if you are not using Razor put in its 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>

2

If you want to put only one letter inside the circle, you can do so:

p {
  border-radius: 50%;
  background: #4CB5AB;
  color: #fff;
  display: inline;
  padding: 5px 10px
}
<p>M</p>


In the 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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.