Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set my input boxes semi-transparent

Tags:

html

css

I couldn't find a way to render my input boxes semi-transparent. I have an image in the background. I mean only the background of my input boxes must be semi-transparent, not the text.

Any idea?

Here is an example of my html code

<h2>Connexion</h2>
<div>
    <label for="UserName">Username</label>               
    <input data-val="true" data-val-required="Le nom d&amp;#39;utilisateur est requis" id="UserName" name="UserName" type="text" value="" />                             
</div>
<div>
    <label for="Password">Password</label>
    <input data-val="true" data-val-required="Le mot de passe est requis" id="Password" name="Password" type="password" />              
</div> 
like image 525
Bronzato Avatar asked Oct 22 '25 09:10

Bronzato


1 Answers

If you mean that there is a background image that you want to be able to see through your input boxes then you can just user rgba() when setting the background-color of an input:

input {
    background-color: rgba(255, 255, 255, 0.5);
}
like image 159
My Head Hurts Avatar answered Oct 25 '25 00:10

My Head Hurts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!