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

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

在列表組項目中使用圖像占據所有內部空間

在列表組項目中使用圖像占據所有內部空間

慕尼黑的夜晚無繁華 2024-01-11 10:36:10
我應該如何風格化這個:<div class="list-group">  <li class="list-group-item">    <div class="media">      <img th:if="${geral.logo}" th:src="@{/imagem/download/__${geral.logo.id}__}" width="180px" height="360px" class="mr-3" th:alt="${geral.titulo}">      <svg th:unless="${geral.logo}" width="180px" height="360px" class="bd-placeholder-img mr-3" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: 64x64">        <title>Placeholder</title>        <rect width="100%" height="100%" fill="#868e96"></rect>        <text x="50%" y="50%" transform="rotate(90)" fill="#dee2e6" dy=".3em" th:text="${geral.titulo}"></text>      </svg>    </div>  </li>...</div>在某種程度上,圖像占據了list-group-item元素的所有空間,圖像邊緣和項目邊框之間沒有空白。更新我試過這個:html:<div class="list-group">  <li class="list-group-item">    <div class="media logo">      <img th:if="${geral.logo}" th:src="@{/imagem/download/__${geral.logo.id}__}" width="180px" height="360px" class="mr-3" th:alt="${geral.titulo}">      <svg th:unless="${geral.logo}" class="bd-placeholder-img mr-3" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: 64x64">        <title>Placeholder</title>        <rect width="100%" height="100%" fill="#868e96"></rect>        <text x="50%" y="50%" transform="rotate(90)" fill="#dee2e6" dy=".3em" th:text="${geral.titulo}"></text>      </svg>    </div>  </li>...</div>CSS:li.list-group-item {  padding: 0;}.logo {    display: flex;    flex-direction: row;    justify-content: space-between;}但我總是看到圖像右側有一個空白區域。
查看完整描述

1 回答

?
心有法竹

TA貢獻1866條經驗 獲得超5個贊

這應該有效

.list-group-item{
        padding: 0;
    }


查看完整回答
反對 回復 2024-01-11
  • 1 回答
  • 0 關注
  • 132 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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