0

I have been using a Game Assets collection to build a Game upon. The main problem that now arises is how to include the User Interface Buttons.

Currently a Button is a Collection of different Gradients and a certain Font. I’ve tried to convert the Images Gradient to a Background Property but have failed to do so plus the Font that is being used is a collection of Characters represented by Images.

What is the best practice to solve this problem? Use the Images as Button? What is the correct Semantic Markup?

Example of a Button

Semantic of the Button

Thnx! for the response on this question, but it isn't about how to do it; but about the correct Semantic Markup.

Currently I've solved it with the following setup which seems reasonable.

<label>
    <img src="/aButton.png" alt="Send Message">
</label>

2 Answers2

2

Try as follows

HTML

<input type="submit" id="search" name="submit" alt="search" value="">

CSS

input#search    {
background:url(../search-icon.png);
background-repeat: no-repeat;
width:40px;
height:40px;
border: 0;
}
input#search:hover    {
    background:url(../search-icon2.png);
    background-repeat: no-repeat;
    width:40px;
    height:40px;
    border: 0;
    }
Arshid KV
  • 9,631
  • 3
  • 35
  • 36
1

If you want to use input, try this:

background-image: url(...);
background-repeat: no-repeat;
background-position: <left|right>;
padding-<left|right>: <width of image>px;
<button type="submit"><img></img></button>
Tapasa
  • 66
  • 7