Я попытался создать соответствующую кнопку, которая содержит название кнопки и номер.
Я использовал заполнение, чтобы отделить имя кнопки от номера, однако, когда число очень велико, это же число перекрывает имя кнопки.
Есть ли способ отцентрировать имя кнопки и сделать ее полностью отзывчивой независимо от отображаемого числа?
DEMO
Html
<div class="d-flex justify-content-md-center flex-nowrap" style="margin-top:50px">
<a style="color: #51CC8B;" class="btnP">Prepared
<span class="nav-link btn-glyphicon1">1500</span>
</a>
</div>
Css
.btnP {
padding-right: 50px;
padding-left: 8px;
height: 24px;
transition: all 0.3s ease 0s;
cursor: pointer;
white-space: nowrap;
position: relative;
text-decoration: none;
display: flex;
align-items: center;
margin-right: 16px;
text-align: center;
font-weight: bold;
font-size: 13px;
font-family: 'Noto Sans', sans-serif;
line-height: 6px;
letter-spacing: 0;
color: #51CC8B;
-ms-border-radius: 16px;
-o-border-radius: 16px;
-moz-border-radius: 16px;
-webkit-border-radius: 16px;
border-radius: 16px;
border-width: none;
background: #EDFAF3;
outline: none;
}
.btn-glyphicon1 {
padding: 8px;
line-height: 6px;
text-align: center;
border-radius: 16px;
right: 0;
position: absolute;
background: #DDF6E9 0% 0% no-repeat padding-box;
font-size: 13px;
font-family: 'Noto Sans', sans-serif;
letter-spacing: 0;
color: #51CC8B;
}
![image](https://i.stack.imgur.com/N09Yd.png)
ПРОБЛЕМА
![image](https://i.stack.imgur.com/x46Si.png)
Как видно на рисунке, число перекрывается с name :( Я хочу, чтобы текст всегда оставался по центру кнопки, а ширина изменялась в соответствии с размером числа.
Может кто-нибудь мне помочь?