Cascading Style Sheets, or CSS is a common application used to style web pages. It has been known to reduce bandwidth, increase uniformity among different browsers, and even add some stylistic flair to web pages. Here are a couple of tips to help you along the way.

1. CSS and Text Overflow

If text has been cut off and you want to leave a visual clue to the user, use CSS to leave an ellipses to inform them that there is more to read.
example code:
text-overflow: ellipsis-word;

2. Rotating Text With CSS

By using the “transform” property in Webkit and Firefox, and the BasicImage filter in Internet Explorer, web designers have the ability to rotate text as they please. Designers can use this tool to rotate images as well making it a valuable asset for almost any design.
example codes:
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

3. Using CSS to Center Layouts

For web sites that rely heavily on large pictures, it is crucial to present the pictures correctly to prevent any problems. This code allows for proper centering, fixing problems associated with overlapping images, repeating images, or images that cut off neat the edges of the screen.
example code:
#container {margin: 0 auto; width: 30px; text-align: left;}

4. Resetting CSS

Resetting CSS gives users the ability to work uniformly across multiple browsers and platforms, fixing problems with margins, font size, headings, default line heights and other variables that often change between browsers.
example code:
{padding: 0; margin: 0;}

5. Using Shorthand CSS

Especially in larger projects, using shorthand CSS helps to keep file size small, which greatly benefits users as web pages don’t take as long to load. The biggest benefit, however, is its large boost in efficiency. When coding takes a significantly short time, you can do more work in a shorter amount of time.
example code:
#box p {margin-top: 15px; margin-right: 5px; margin-bottom: 15px; margin-left: 5px; }

Text Shadow Examples

will turn something like this:That the quick brown fox jumps over the lazy dog
into this:That the quick brown fox jumps over the lazy dog

There are a number of creative and interesting effects you could achieve with this, such as using the same color as the background for the text and adding a shadow:p {color: white; text-shadow: #888 2px 2px 0.12em;}That the quick brown fox jumps over the lazy dog

Be careful. The text-shadow property will only work for browsers that support CSS 3 (which is most decent browsers these days). It will be ignored by those that don’t so your text above will be invisible. Should take that into account.

Welcome to the new CSS Button site. In addition to providing tips and techniques related to Cascading Style Sheets, this site will showcase useful methods and code that would be invaluable to any webmaster, developer or designer.

You will still find loads of buttons that you may use on your own website for free. Sites offering free buttons are already quite plentiful on the Internet, but what makes CSS buttons special is their speed, simplicity and elegance. We have buttons made entirely out of CSS/HTML that load instantly and you’ll also find buttons enhanced with CSS.

CSSButton

Visit the CSS forms page for ways to improve on the plain HTML forms for your site.

CSS-based buttons offer numerous advantages:
They’re smaller and hence quicker to load
They can be modified much easier than an image can
They are more easily accessible by text-based browsers and web crawlers, giving your site a wider audience and better SEO.
Here are a couple of examples of buttons created or enhanced using plain CSS and HTML. I decided to use inline CSS to make it simpler to use the buttons and cater for different types of buttons on a single page. This does increase the size and you can make the code even smaller by including the CSS in a separate .css file.

xmlatom feed

Browse the collection that we have on this site or create your own and simply paste the code into your page, wherever you want it. It’s as simple as that. I would also appreciate any comments on these.
(Note: The buttons on this site are tested to work correctly with Mozilla Firefox and Opera browsers. Users with IE or other browsers may experience varying results)