Reputation: 19
I try to program a site in an HTML form and I need to see my background image behind the input text for example for search. what can I do? I try to set image background but when I add an input text it is white and I can't see bg image behind that
<html>
<head>
<style>
body {
background-image: url(example url}#weap{display:inline;}
</style>
</head>
<body>
<div id="wrap">
<input id="search" name="search" type="text" placeholder="What're we looking for ?">
</div>
</body>
</html>
Upvotes: 0
Views: 55
Reputation: 133
Reduce opacity of input field, so that the background image will get visible through the input field,
in your case use below code
#search{
opacity:0.5;
outline: none;
webkit-appearance: none;
}
Here is the reference for learning more about Opacity attribute:
[link]:https://www.w3schools.com/cssref/css3_pr_opacity.asp
Upvotes: 0
Reputation: 1178
You can add opacity
to your search field. For example:
#search{
opacity: .7;
filter: alpha(opacity=70); /* For IE8 and earlier */
}
Upvotes: 3