亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

響應式按鈕 - 帶姓名和號碼

響應式按鈕 - 帶姓名和號碼

守著一只汪 2023-09-11 15:10:40
我嘗試創建一個相應的按鈕,其中包含按鈕的名稱和數字。我使用填充將按鈕名稱與數字分開,但是當數字非常高時,相同的數字會與按鈕名稱重疊。有沒有辦法將名稱放在按鈕上居中并使按鈕完全響應,而不管顯示的數字如何?演示版網頁  <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;}問題正如您在圖像中看到的,數字與名稱重疊:(我希望文本始終保持在按鈕的中心,并且寬度根據數字的大小進行調整。有人能幫我嗎?
查看完整描述

1 回答

?
德瑪西亞99

TA貢獻1770條經驗 獲得超3個贊

.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;

  justify-content: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;

  

  border-radius: 16px;

  

  align-items:center;

  background: #DDF6E9 0% 0% no-repeat padding-box;

  font-size: 13px;

  font-family: 'Noto Sans', sans-serif;

  margin-left:20px;

  color: #51CC8B;

}

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


查看完整回答
反對 回復 2023-09-11
  • 1 回答
  • 0 關注
  • 105 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號