0

How to shorten the background color left over from the text? enter image description here

Css

    p {
    background-color: #CC3340;
    text-align: center;
    border-radius: 100px;
    font-size: 1.2em;
    font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: white;
    }

1 Answers1

1

You can try adding the following:

  width:fit-content;
  padding: .5rem;

I advice you to have a look at this for more details about the difference between min-content, max-content, and fit-content.

EDIT I believe your question is the same as this one here, the answer uses a different approach.

minasrc
  • 89
  • 8