Michael Downey
Michael Downey

Reputation: 687

Background color to be same as text color

Currently I have the following code.

#Image_ID {
    color: #000066;
    font: normal 10pt Verdana, Helvetica, Arial;
    background: none;
    border: none;
}

This makes my Input Box white and gets rid of the border. But when a value is entered the value is a black color. What I want is so that when text is entered that it is the same color as the background so that it is virtually invisible.

Upvotes: 4

Views: 12840

Answers (2)

vsync
vsync

Reputation: 130660

Automatic background color to be the same as the specified color of the element, without specifying it manually can be done using the currentColor value for the background property.

body {
  color: black;
  background: currentColor;
}

Browsers support is excellent.

Upvotes: 22

Mark
Mark

Reputation: 3272

This should do the trick.

#Image_ID:focus {
    color: transparent;
}

Upvotes: 8

Related Questions