html - Safari text-input 渲染输入框下方的文字

标签 html css safari

我在 safari 中遇到了一个问题,我的输入框中的文本呈现在框下方,如图所示。我在 chrome 和 firefox 中试过这个,它似乎工作正常,所以我不确定我可以改变什么。抱歉,我不知道如何分离 CSS 和 HTML 的代码块,我是新来的。 enter image description here

.banner {
  background: #ececec;
  position: absolute;
  top: 0px;
  left: 64px;
  width: 100vw;
  height: 60px;
  line-height: 60px;
  min-width: 1100px;
}
.search_bar {
  display: block;
  height: 32px;
  width: 276px;
  color: #353a4f;
  background: white;
  border-radius: 16px;
  border: none;
  font-size: 16px;
  font-family: League Spartan, helvetica;
  padding-left: 40px;
  padding-top: 4px;
  margin: 0;
}
.search_bar:focus {
  outline: none;
}
.search_bar_wrapper {
  position: relative;
  top: 14px;
  left: 20px;
  margin: 0 0;
  z-index: 10;
}
.search_bar_icon {
  position: absolute;
  height: 20px;
  width: 20px;
  fill: #353a4f;
  top: 6px;
  left: 10px;
}
<div class="banner">
  <div class="search_bar_wrapper">
    <input type="text" class="search_bar" placeholder="Search..." />
    <img src="imgs/Icons/search.svg" class="search_bar_icon" />
  </div>
</div>

最佳答案

仅通过在输入框上指定行高来修复。

关于html - Safari text-input 渲染输入框下方的文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39557921/

相关文章:

javascript - 如何从 HTML 表单调用现有的 REST api?

css - 如何在带有 overflow hidden 的父级内部水平居中放置多个图像

html - 防止在 100% 宽度的页面上水平拖动滚动

html - 在 Win7 上的 Safari 中居中输入占位符

javascript - 为什么这个正则表达式在 Angular 上的匹配仅在 Safari 上失败?

html - 下拉菜单出现问题,因为它没有出现在悬停时(只是一个 html-css 模板)

javascript - 菜单上的事件监听器不工作并且 "The key "初始规模的控制台错误“未被识别和忽略。”

html - 可以在没有段落标记的 div 中包含文本吗?

缩小/放大时 HTML 图像不会减小尺寸,它在 Bootstrap 4 中没有响应

html - 按钮标签无法更改 Iphone safari 浏览器上的字体颜色