【问题标题】:The chip close button won't adhere to css芯片关闭按钮不会遵守 css
【发布时间】:2018-07-10 10:36:58
【问题描述】:

我似乎无法让芯片上的关闭 x 出现并坚持 .css。

这是 HTML:

<ion-card>
  <ion-card-content>
    <ion-label>City</ion-label>
      <input placeholder="Enter city" #searchPlaces>
    <div class="selected-places">
    <ion-chip *ngFor="let intPlace of intPlaces">
      <ion-label>{{ intPlace }}</ion-label>
      <button (click)="deletePlace(intPlace)">
        <img src="assets/img/ic-small-close.png"/>
      </button>
    </ion-chip>
  </div> 
  </ion-card-content>
</ion-card>

还有css

.selected-places {
    ion-label{
      width: 79.4px;
      font-family: Gotham;
      font-size: 14.2px;
      font-weight: normal;
      font-style: normal;
      font-stretch: normal;
      line-height: normal;
      letter-spacing: normal;
      text-align: left;
      color: black !important;
      overflow-y: visible !important;
     }

     ion-chip{
        display: inline-block;
        padding: 0 25px;
        padding-bottom: 25px;
        height: 30px;
        font-size: 12px;
        line-height: 20px;
        border-radius: 25px;
        background-color: #f1f1f1;
        margin: 3px;
        img{
            width: 3px !important;
            height: 3px !important;
            float: right !important;
        }
    }

由于某种原因,我无法在芯片上显示 x。我试过玩css,但它不会出现在芯片上。

“L”下的灰色竖条应该是“x”图像。

【问题讨论】:

  • 我认为你在 css 部分错过了一个结束 }.. 可能只是问题中的一个错字
  • 是的,这是问题中的错字。右括号在 css 中。

标签: html css angular ionic-framework


【解决方案1】:

我通过完全放弃离子芯片并仅使用标签解决了这个问题。我遇到了几个通过不使用 ION 特定元素而仅使用常规 html 对应元素来解决的问题。

【讨论】:

    猜你喜欢
    • 2023-03-13
    • 2013-06-09
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    • 2018-02-21
    • 1970-01-01
    • 2021-06-30
    • 2013-01-20
    相关资源
    最近更新 更多