bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Change a CSS button into a star image?
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Mon Dec 02, 2013 10:54    Post subject: How to Change a CSS button into a star image? Reply with quote

Code:
button.star {

    background-image: url(img/star.jpg);
}


If there's no content in the button make sure you set the height/width otherwise it won't stretch to fit the button.

As a background


Code:
button {

    background: url('http://imgur.com/I0EwG.png') transparent;
    height: 48px;
    width: 45px;
    border: none;
}​


In The button

HTML

Code:
<button><img src='http://imgur.com/I0EwG.png' /></button>


CSS

Code:
button {

    border: none;
    margin: 0;
    padding: 0;
    background: transparent;
}


Example:

http://jsfiddle.net/robert/DjYmR/
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©