【发布时间】:2017-03-19 02:06:18
【问题描述】:
我做自适应搜索表单。搜索字段应取父 div 的 100% 宽度(父 div 的宽度会根据设备的分辨率而变化)。 “搜索”按钮应始终位于字段的右侧,不要向下移动。
但是有一个问题:文本“立即搜索”(占位符)太靠近字段的边缘,我无法将其移动到右侧。在其他示例中,它按字段填充的设置值移动。但是,如果我更改填充 - 字段本身会向左移动,但我只需要移动文本!
#searchfield {
padding: 10px 0 13px 0; /* Try to change the left padding here! All field shifts to the left! But I need only shift the placeholder text to right! */
}
【问题讨论】:
标签: css padding placeholder search-form