html - 如何在输入字段旁边插入图像 - HTML?
问题描述
我正在尝试在输入框旁边插入图像。这就是我正在做的事情:
http://jsfiddle.net/a4aME/2307/
基本上,
.iconCamera {
background: url('https://www.tutorialspoint.com/videotutorials/images/coding_ground_home.jpg') no-repeat;
width: 50px;
height: 50px;
}
<div class="A" style="display:inline-block">
<div>
<input type="text" placeholder="Product Key">
<div class="iconCamera"></div>
</div>
</div>
既然,我已经给出了inline-block
,这两个组件应该显示side by side - in one line
对吗?
但目前有stacked
一个低于另一个。关于在这种情况下需要做什么的任何指示?
解决方案
display: inline-block
在 css 规范中使用。
http://jsfiddle.net/a4aME/2310/
.iconCamera {
background: url('https://www.tutorialspoint.com/videotutorials/images/coding_ground_home.jpg') no-repeat;
width:50px;
height:50px;
display: inline-block;
}
推荐阅读
- c# - 是否可以构建针对 Linux 和 Windows 的 .Net Core C++/CLI 应用程序
- lua - 如何在 Lua 中打印表格(指针)内容
- amazon-web-services - 为什么“Sum CPUCreditBalance”的值这么高?
- javascript - 如何从收益中返回 *
- flutter - Flutter Provider 嵌套导航
- angular - formGroup 需要一个 FormGroup 实例,动态表单
- delphi - Delphi /w Indy 10:在 ERROR 400 (idHTTP) 后获取内容
- phpmyadmin - 两因素身份验证在 PMA 5.00 中不起作用
- sql-server - 在 SQL 中执行 SSIS 包时出错。文件连接管理器中未指定目录
- python - 替换numpy数组中的元素块