Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make round buttons

How would I make round buttons using HTML and CSS? I tried to use a background image, and make it a certain size, but that doesn't seem to work. Specifically, I would like to make a circular button, which on a click would launch a Javascript script.

like image 383
Steven Matthews Avatar asked Dec 09 '11 13:12

Steven Matthews


2 Answers

With border-radius.

http://jsfiddle.net/12w83vtn/

button {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    border: 1px solid #000;
}
like image 172
Andreas Eriksson Avatar answered Sep 22 '22 16:09

Andreas Eriksson


You can do this quite simply with css3:

HTML -

<div id="button">
</div>

CSS -

#button {
    width:100px;
    height: 100px;
    border-radius:100%;
    background-color:red;
}

And use an onclicked event to make it a button.

like image 41
Kevin Anthony Oppegaard Rose Avatar answered Sep 22 '22 16:09

Kevin Anthony Oppegaard Rose