【问题标题】:How to add material icon in the placeholder of input tag如何在输入标签的占位符中添加材质图标
【发布时间】:2020-08-12 15:18:12
【问题描述】:

我的输入标签如下

 <input type="text" placeholder="search place../>

我想在带有这些标题的占位符中添加一个材质图标&lt;i class="medium material-icons"&gt;location_on&lt;/i&gt;



谁能告诉我该怎么做?我已经在 HTML 文件中包含了材料图标链接样式表

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

【问题讨论】:

    标签: html input placeholder google-material-icons


    【解决方案1】:

    试试这个:

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/solid.css">
    
    <input
      type="text"
      placeholder="&#xf689; Search place..."
      style="padding: 5px; font-family: Arial, 'Font Awesome 5 Free';"
    />
    

    希望对您有所帮助,只需使用一些 padding 和 css 来使其更美观

    【讨论】:

      猜你喜欢
      • 2017-07-17
      • 2020-08-05
      • 2020-12-27
      • 2017-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-07
      • 1970-01-01
      相关资源
      最近更新 更多