Code:
56 |<a href="#" class="button">This is a Button</a> 57 |58 | 59 |
├── LICENSE.txt
├── README.md
├── demo.html
├── images
├── css3buttons_backgrounds.png
└── css3buttons_icons.png
└── stylesheets
├── css3buttons.css
├── demo.css
└── reset.css
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
26 | CSS3 Buttons is a simple framework for creating good-looking GitHub style button links. 27 |
28 | 29 |
30 | UPDATE 19th of Mar. Now you can also indicate a positive action by using the .positive
class, which
31 | will change the hover-state to green.
32 |
35 | UPDATE 19th of Mar. It is now possible to use <button>
tags to easily submit forms.
36 |
39 | UPDATE 26th of Feb. The icon sprite has been optimized and additional icons has been added. Scroll down to 40 | see what's new! 41 |
42 | 43 | 47 |To create a button, the only thing you have to do is this:
53 | 54 |<a href="#" class="button">This is a Button</a> 57 |58 | 59 |
You can also use the button tag:
66 | 67 |<button class="button">This is a Button</button> 70 |71 | 72 |
If you prefer a pill-like button with more rounded corners, you can add a .pill
class to the button
<a href="#" class="pill button">This is a Pill Button</a> 83 |84 | 85 |
92 | Sometimes when you have multiple buttons, it's considered good practice to highlight the button with the primary action in order to give
93 | the user a visual clue of what action to take if in doubt. This can be accomplished by adding a .primary
class
94 | to the button
95 |
<a href="#" class="primary button">Publish Post</a> or <a href="#" class="button">Save as Draft</a> 100 |101 | 102 |
113 | If you have a button that triggers a negative action, like deleting data, it's good practice to warn the user by
114 | styling the button differently than the normal buttons. Give a button the class .negative
and the hover-state
115 | will change to red
116 |
<a href="#" class="negative button">Divide by Zero</a> 121 |122 | 123 |
135 | If you have a button that triggers an action you want to encourage your users to do, you can give a button a .positive
class
136 | and the hover-state will change to green
137 |
<a href="#" class="positive button">Save the World</a> 142 |143 | 144 |
155 | You can create grouped buttons that are linked together, like seen at Gmail and other places, by using the .left
, .middle
and .right
classes:
156 |
<a href="#" class="left primary button">Archive</a> 161 | <a href="#" class="middle button">Report Spam</a> 162 | <a href="#" class="right negative button">Delete</a> 163 |164 | 165 |
170 | You can also add the pill class to grouped buttons if preferred: 171 |
172 | 173 |<a href="#" class="left primary pill button">Archive</a> 176 | <a href="#" class="middle pill button">Report Spam</a> 177 | <a href="#" class="right negative pill button">Delete</a> 178 |179 | 180 |
189 | CSS3 Buttons supports a wide range of icons that can easily be added to any button by adding a span
tag inside the anchor tag
190 | with the class of .icon
and any one of the provided icon classes:
191 |
<a href="#" class="button"><span class="magnifier icon"></span>Search</a> 196 |197 | 198 |
Here is a list of all the supported icon classes:
203 | 204 |Class | 209 |Example | 210 |
---|---|
.book |
214 | View Log | 215 |
.calendar |
218 | Add to Calendar | 219 |
.chat |
222 | Start Chat | 223 |
.check |
226 | Approve Registration | 227 |
.clock |
230 | Register Work Time | 231 |
.cog |
234 | Settings | 235 |
.comment |
238 | Add Comment | 239 |
.cross |
242 | Remove Item | 243 |
.downarrow |
246 | Move Down | 247 |
.fork |
250 | Create Branch | 251 |
.heart |
254 | Add to Favorites | 255 |
.home |
258 | Back to Frontpage | 259 |
.key |
262 | Password Protect | 263 |
.leftarrow |
266 | Move Left | 267 |
.lock |
270 | Lock Article | 271 |
.loop |
274 | Resend Message | 275 |
.magnifier |
278 | Search | 279 |
.mail |
282 | Send Newsletter | 283 |
.move |
286 | Move | 287 |
.pen |
290 | Edit Post | 291 |
.pin |
294 | Pin to Map | 295 |
.plus |
298 | Add Post | 299 |
.reload |
302 | Reload Page | 303 |
.rightarrow |
306 | Move Right | 307 |
.rss |
310 | Subscribe to RSS Feed | 311 |
.tag |
314 | Add Tag | 315 |
.trash |
318 | Delete Post | 319 |
.unlock |
322 | Unlock Article | 323 |
.uparrow |
326 | Move Up | 327 |
.user |
330 | Add New User | 331 |
340 | If you wish to emphasize a specific action you can add the .big
class to make a more prominent call-to-action
341 | button:
342 |
<a href="#" class="big button">Create Project</a> 347 |348 | 349 |
359 | CSS3 Buttons works in all major browsers 360 |
361 | 362 |363 | Note: Some CSS3 features used in CSS3 Buttons is not supported in Internet Explorer browsers! (IE 8 and under) 364 |
365 |css3buttons.css
in your stylesheets foldercss3buttons_backgrounds.png
and css3buttons_icons.png
in your images foldercss3buttons.css
in the head section of your HTML page (see code example below)<link rel="stylesheet" href="stylesheets/css3buttons.css" media="screen"> 379 |380 |
383 | CSS3 Buttons expects that some kind of CSS reset is in place in your project, otherwise the look might not be, as seen here 384 |
385 |393 |428 |394 | This is free and unencumbered software released into the public domain. 395 |
396 | 397 |398 | Anyone is free to copy, modify, publish, use, compile, sell, or 399 | distribute this software, either in source code form or as a compiled 400 | binary, for any purpose, commercial or non-commercial, and by any 401 | means. 402 |
403 | 404 |405 | In jurisdictions that recognize copyright laws, the author or authors 406 | of this software dedicate any and all copyright interest in the 407 | software to the public domain. We make this dedication for the benefit 408 | of the public at large and to the detriment of our heirs and 409 | successors. We intend this dedication to be an overt act of 410 | relinquishment in perpetuity of all present and future rights to this 411 | software under copyright law. 412 |
413 | 414 |415 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 416 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 417 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 418 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 419 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 420 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 421 | OTHER DEALINGS IN THE SOFTWARE. 422 |
423 | 424 |425 | For more information, please refer to <http://unlicense.org/> 426 |
427 |
444 | Please create a ticket on GitHub With a description of the problem, browser and operating system information and how to reproduce the problem. 445 |
446 | 447 |449 | You can send me a private message on GitHub and I'll do my best to help you. 450 |
451 |,. */ 60 | blockquote:before, blockquote:after, q:before, q:after { content: ''; } 61 | blockquote, q { quotes: "" ""; } 62 | 63 | /* Remove annoying border on linked images. */ 64 | a img { border: none; } 65 | 66 | /* Remember to define your own focus styles! */ 67 | :focus { outline: 0; } --------------------------------------------------------------------------------