2

I'm trying to make a button for my form which has an image background and displays the text on top of the background. Seems very simple but I'm struggling to get the text to appear no matter what I try and struggling after an hour of searching to find someone with a similar problem so assume I'm doing something stupid!.

Here's my CSS:

#detail-left .cart-button {
    background : url("../graphics/cart-button.png");
    border : none;
    color : transparent;
    height: 48px;
    width: 118px;
    padding: 10px;
    line-height: 48px;
}

and my html:

<input class='cart-button' type='submit' value='Add' />

3 Answers 3

3

Remove color:transparent. Its making your text transparent give it some color.

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

1 Comment

No, Problem. Actually i am not able to submit my answer by just writing "Remove color:transparent" so it takes time to think what else to write to make it submit :-)
2

Remove color : transparent; from your style class, That should work

#detail-left .cart-button {
    background : url("../graphics/cart-button.png");
    border : none;
    height: 48px;
    width: 118px;
    padding: 10px;
    line-height: 48px;
}

Try this working fiddle

1 Comment

Thank you, this did the trick. At least I was correct about one thing - stupidity!
2

The "color : transparent;" setting will cause the text to be completely transparent, if you want the text to have half-transparency consider using rgba.

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.