Use text as input

0

I want to make a purchase button, with some CSS attributes, but without using images.

I want it to be a black square, with the text COMPRAR in white letters.

This is what I tried so far, but it is not black and does not look like a button like this.

<input 
  style="border:1px solid black; padding:5px; width:100%; height:30px; margin-top:15px;"
  type="image"
  border="0"
  name="submit"
  alt="PURCHASE">

Is this possible?

    
asked by Ivan Soler 18.08.2016 в 21:00
source

2 answers

2

If that's what I understand, you want to simply add a CSS style to the buy button. You should read more about CSS and learn how to use it. I leave you a manual doing click here .

.purchase{
    background-color:#000;
    color:#FFF;
    border:transparent;
    padding:5px 10px;
    cursor:pointer;
  }
<input type="submit" value="Comprar" class="purchase">
    
answered by 18.08.2016 / 22:06
source
-2

Use the placeholder="your message" attribute or if you want an initial value you can use value="your value"

The value attribute is the one that will travel to your server. That is what your user enters. The placeholder, is to display a text and when entering a value disappears, is designed to eliminate or not abuse much of the label.

It does not make sense for you to use both together.

    
answered by 18.08.2016 в 21:02