Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Simple and elegant <input button>, how?

    Hi guys,

    how do we make
    <input type="button" .../>
    look more attractive such as rounded corners with CSS without images files etc. (slow in loading...)
    ?

    thanks.

  • #2
    New Coder
    Join Date
    Mar 2012
    Location
    Somewhere over the Rainbow
    Posts
    96
    Thanks
    7
    Thanked 5 Times in 5 Posts
    What I use:

    html:
    Code:
    <form action="/" id="submitform">
    <input type="submit" value="Submit" />
    </form>
    css:
    Code:
    #submitform input[type="submit"] {
    	padding: 8 px 15px; 
    	font-family: Arial, Helvetica, sans-serif;
    	font-weight: bold;
    	line-height: 1;
    	color: #444;
    	border: none;
    	text-shadow: 0 1px 1px  rgba(225,255,255, 0.85);
    	background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to (#bbb));
    	background-image: -moz-linear-gradient(0% 100% 90deg, #bbb, #fff);
    	background-color: #fff;
    	-webkit-border-radius: 23px;
    	-moz-border-radius: 23px;
    	-o-border-radius: 23px;
    	border-radius: 23px;
    	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    	}

  • Users who have thanked achira for this post:

    knowledgenotebk (03-12-2012)

  • #3
    New Coder
    Join Date
    Feb 2012
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thank you. This is quite nice, however, it takes a while to load...

  • #4
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    As long as your not using images, the css should not effect the page load time, so feel free to go overboard.

    Preview:



    Code:
    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<title>Download Button</title>
    		<style type="text/css">
    			body {
    				font-family: tahoma, arial, helvetica, sans-serif;
    			}
    			
    			.button {
    				display: inline-block;
    				*display: inline; zoom: 1;
    				cursor: pointer;
    				border: 1px solid;
    				-webkit-box-sizing: content-box;
    				   -moz-box-sizing: content-box;
    				    -ms-box-sizing: content-box;
    				        box-sizing: content-box;
    				overflow: visible;
    			}
    			
    			form {
    				text-align: center;
    			}
    			.elegant-button {
    				padding: 5px 20px;
    				font-weight: bold;
    				font-size: 15px;
    				color: #fbfbfb;
    				outline: none;
    				text-shadow: 0 1px 0 #333;
    				text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
    				border-color: #307ABB !important;
    				border-bottom-color: #266093 !important;
    			 /* background: backup hex color value */
    				background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#62a4de), to(#3582c4));
    				background: -webkit-linear-gradient(top, #62a4de, #3582c4);
    				background:    -moz-linear-gradient(top, #62a4de, #3582c4);
    				background:     -ms-linear-gradient(top, #62a4de, #3582c4);
    				background:      -o-linear-gradient(top, #62a4de, #3582c4);
    				background:         linear-gradient(top, #62a4de, #3582c4);
    				    filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#62a4de, endColorstr=#3582c4);
    				-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#62a4de, endColorstr=#3582c4)";
    				-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 rgba(0, 0, 0, .12);
    				   -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 rgba(0, 0, 0, .12);
    				    -ms-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 rgba(0, 0, 0, .12);
    				     -o-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 rgba(0, 0, 0, .12);
    				        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 rgba(0, 0, 0, .12);
    				-webkit-border-radius: 4px;
    				   -moz-border-radius: 4px;
    				    -ms-border-radius: 4px;
    				        border-radius: 4px;
    			}
    			.elegant-button:hover, .elegant-button:active, .elegant-button:focus {
    			 /* background: backup hex color value */
    				background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#72b4ed), to(#3887cb));
    				background: -webkit-linear-gradient(top, #72b4ed, #3887cb);
    				background:    -moz-linear-gradient(top, #72b4ed, #3887cb);
    				background:     -ms-linear-gradient(top, #72b4ed, #3887cb);
    				background:      -o-linear-gradient(top, #72b4ed, #3887cb);
    				background:         linear-gradient(top, #72b4ed, #3887cb);
    				    filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#72b4ed, endColorstr=#3887cb);
    				-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#72b4ed, endColorstr=#3887cb)";
    			}
    			.elegant-button:hover {
    				-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .3);
    				   -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .3);
    				    -ms-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .3);
    				        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .3);
    			}
    			.elegant-button:active {
    				text-shadow: 0 1px 0 #222;
    				text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
    				border-top-color: #266093;
    				-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .1), inset 0 1px 2px rgba(0, 0, 0, .3);
    				   -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .1), inset 0 1px 2px rgba(0, 0, 0, .3);
    				    -ms-box-shadow: 0 1px 2px rgba(0, 0, 0, .1), inset 0 1px 2px rgba(0, 0, 0, .3);
    				        box-shadow: 0 1px 2px rgba(0, 0, 0, .1), inset 0 1px 2px rgba(0, 0, 0, .3);
    				-webkit-transition: box-shadow .03s ease-out;
    				   -moz-transition: box-shadow .03s ease-out;
    				    -ms-transition: box-shadow .03s ease-out;
    				     -o-transition: box-shadow .03s ease-out;
    				        transition: box-shadow .03s ease-out;
    			}
    		</style>
    	</head>
    	<body>
    		<form method="POST" action="">
    			<input type="submit" value="Download" class="elegant-button button" />
    		</form>
    	</body>
    </html>
    Last edited by Sammy12; 03-12-2012 at 05:55 AM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •