問題描述
我正在嘗試將 html 代碼放入我老板提供的設計模型中,其中一些美學 - 例如搜索欄的形狀有點奇怪和復雜.作為一個簡單的解決方法,我想我只需在搜索欄的圖像上放置一個文本字段,但我無法讓它工作.
I'm trying to put html code to a design mockup my boss provided, and some of the aesthetics - the shape of the search bar, for example, are a little bit bizarre and complex. As an easy fix, I thought I would simply put a text field over an image of the search bar, but I can't get it to work.
誰能建議一種在圖像上添加文本字段的方法,使其不可見但仍然有效?
Can anyone suggest a way to layer a text field over an image, leaving it invisible but still functional?
推薦答案
就隱身而言,把這個 CSS 放在你的輸入上:
As far as the invisibility goes, put this CSS on your input:
input {
background: transparent;
border: none;
}
查看這個 jsFiddle,它展示了這一點.就定位輸入而言,您應該能夠正常處理.
Check out this jsFiddle that shows this in action. As far as positioning the input goes, you should be able to handle that normally.
這篇關于在 html 中創建不可見的文本字段?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!