0

I'm trying to style a form input["text"] field, but I'm getting this white border / background all around, and I don't know how to get rid of it.

Can anyone help me?

enter image description here

.my-form-login input[type="text"] {
    background-image: url('../images/text-input.png');
    background-repeat: no-repeat;
    outline: none;
    width: 180px;
    height: 30px;
    border: none;
    padding: 5px;
}
3
  • Is this only happening on Chrome? Commented Nov 24, 2011 at 12:31
  • try setting background color to transparent Commented Nov 24, 2011 at 12:40
  • Try using border-radius from CSS3 if all you want is rounded corners. Commented Nov 24, 2011 at 12:49

2 Answers 2

1

Use background-color:[background color of parent tag];

Sign up to request clarification or add additional context in comments.

2 Comments

The element that's showing the white background is almost definitely the input - it has a default background color of white. Just setting the background color to transparent will do for the most part.
thnx BoldClock and yes that input tag, need to set background color for input tag.
0

A combination of border:0px + setting the background color solved it

Althought would be great to set it to transparent...

Thanks everyone.

.my-form-login input[type="text"] {
    background-image: url('../images/text-input.png');
    background-repeat: no-repeat;
    outline: none;
    width: 180px;
    height: 30px;
    padding: 0px;
    background-color: #444;
    border: 0px;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.