user3475724
user3475724

Reputation:

Button with image VS html/css button

Is it better to draw a button and than use as background-image(for example .png) or to make same button using html+css. Will performance change significantly ? An average button weights 60 KB?

Upvotes: 0

Views: 2131

Answers (2)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

It doesn't affect the performance for your website if you have one or lesser image but it would be little painful to your website to load them if you use a lot of images for the buttons or something else.

So, you should consider yourself. If you can layout the same thing with just css then I would like to recommend you to use that way, its very light than using image.

If you want to use single image in multiple places then you don't need to worry about the performance because it just loads one time for all places even for different sizes.

Upvotes: 1

mbillard
mbillard

Reputation: 38842

If you use an image it's going to be harder to change the text, the look, the color, etc.

Unless your button is super fancy, I would go with html+css.

Upvotes: 1

Related Questions