Project / Support Center
Welcome, Guest. Please login or register. May 22, 2012, 10:27: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  CSS Related  |  Topic: CSS Buttons nice 0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: CSS Buttons nice  (Read 536 times)
Web Global Net
Administrator
******
Offline Offline

Posts: 1,685


« on: December 14, 2011, 03:03: PM »

These buttons use the sliding doors technique of CSS, plus two sliced background images with "on" and "off" states, to create flexible oval shaped CSS buttons, similar to CSS Square Buttons. Each button can accommodate text of variable widths and supports a hover effect when the mouse rolls over it. The only limitation is the height of the button, which is fixed based on the background image's height.

For your convenience,2 different colored ovals buttons are attached to get you on your way! You can use a graphics program to change the Hue-Saturation - Lightness to change them to what you like - just save them as different names and adjust the style code to the file name.

Code:
<style type="text/css">

a.ovalbutton{
background: transparent url('media/oval-gray-left.gif') no-repeat top left;
display: block;
float: left;
font: normal 13px Tahoma; /* Change 13px as desired */
line-height: 16px; /* This value + 4px + 4px (top and bottom padding of SPAN) must equal height of button background (default is 24px) */
height: 24px; /* Height of button background height */
padding-left: 11px; /* Width of left menu image */
text-decoration: none;
}

a:link.ovalbutton, a:visited.ovalbutton, a:active.ovalbutton{
color: #494949; /*button text color*/
}

a.ovalbutton span{
background: transparent url('media/oval-gray-right.gif') no-repeat top right;
display: block;
padding: 4px 11px 4px 0; /*Set 11px below to match value of 'padding-left' value above*/
}

a.ovalbutton:hover{ /* Hover state CSS */
background-position: bottom left;
}

a.ovalbutton:hover span{ /* Hover state CSS */
background-position: bottom right;
color: black;
}

.buttonwrapper{ /* Container you can use to surround a CSS button to clear float */
overflow: hidden; /*See: http://www.quirksmode.org/css/clearing.html */
width: 100%;
}

</style>

Note: The image paths referenced in the CSS above assumes you're using the gray ovals. If you're using another, be sure to update the image paths accordingly.

The trick here is to use the <span></span> Tag around the text with no class attached to it.

<h4>Single button:</h4>

<div class="buttonwrapper">
<a class="ovalbutton" href="http://reunionmanager.net"><span>CSS Library</span>[/url]
</div>

<h4>Side by Side:</h4>

<div class="buttonwrapper">
<a class="ovalbutton" href="#"><span>Submit</span>[/url] <a class="ovalbutton" href="#" style="margin-left: 6px"><span>Reset</span>[/url]
</div>


* oval-blue-left.gif (0.81 KB, 11x48 - viewed 99 times.)

* oval-blue-right.gif (3.2 KB, 312x48 - viewed 85 times.)

* oval-gray-left.gif (0.73 KB, 11x48 - viewed 95 times.)

* oval-gray-right.gif (3.2 KB, 312x48 - viewed 76 times.)
« Last Edit: December 14, 2011, 04:19: PM by Web Global Net » Report to moderator   Logged
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  CSS Related  |  Topic: CSS Buttons nice « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!