Example 1: Basic Transparent Input Field
In this example, we create a basic transparent input field on a transparent div.
HTML
<!DOCTYPE html> < html > < head > < title >Transparent Input Field</ title > < style > body { background: #9b9b9b; width: 100%; } .transparent-input { background: transparent; } input { width: 250px; height: 40px; font-size: 24px; border: 1px solid #383535; } </ style > </ head > < body > < div class = "transparent-div" > < input type = "text" class = "transparent-input" placeholder = "Enter text here..." > </ div > </ body > </ html > |
Output: In this code, the .transparent-div class has a transparent white background using the hex color format. The .transparent-input class makes the input field transparent by setting the background to transparent.