我做自适应搜索表单。搜索字段应采用100%
父 div 的宽度(父 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! */
}