html - 如何在输入标签的占位符中添加材质图标
问题描述
我有我的输入标签,如下所示
<input type="text" placeholder="search place../>
我想<i class="medium material-icons">location_on</i>
用这些标题在占位符中添加一个材质图标
谁能告诉我该怎么做?我已经在 HTML 文件中包含了材料图标链接样式表
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
解决方案
尝试这个 :
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/solid.css">
<input
type="text"
placeholder=" Search place..."
style="padding: 5px; font-family: Arial, 'Font Awesome 5 Free';"
/>
希望它有所帮助,只需使用一些填充和 css 使其更好
推荐阅读
- python - 使用 random.randint() 屏蔽每个 DataFrame 列
- javascript - 用于查找 2 个文件中内容之间差异的 Java 脚本,包括字体
- asp.net - 如何在asp.net中解决这个为什么结果= 0
- database - 何时使用 Redis?什么时候去塔兰图尔?
- hyperledger-fabric - 我如何运行零知识证明 (ZKP) 以使用 Hyperledger 结构确认块中的数据
- amazon-web-services - AWS CLI v2 不选择环境变量
- angular - FormControl 类型的角打字稿
- android - 回调 JNI C 作为 C 上的参数传递
- django - 将 API 密钥添加到 DRF 可浏览 API 页面中的标头
- reactjs - 在按钮上单击选中复选框并将数据添加到 react redux 中的购物车?