El que se puedan hacer así tiene varias ventajas. Por un lado serán visibles para las arañas de los navegadores (las imágenes no lo son tanto), pero quizás las más importantes son la facilidad para cambiar el diseño o la redimensión automática.
Como hablamos de CSS sólo tendremos que crear una clase, darle propiedades y por último añadírsela al enlace que queremos convertir en botón. Nuestra clase se llamaráboton -somos así de originales- y para que se entienda le iremos añadiendo propiedades poco a poco.
Un enlace básico sería así:
Como la clase boton todavía no existe, el enlace se verá con las propiedades por defecto que tengamos en nuestra plantilla. Lo primero que le incorporamos es un borde, un margen interno (padding), colores para fondo, texto y tamaño de este último. Por si los enlaces aparecen con un subrayado, también forzamos la eliminación de este detalle para que el aspecto sea más limpio.
border: 1px solid #cccccc;
padding: 10px;
color: #ffffff;
background: #999999;
font-size: 28px;
line-height: 30px;
text-decoration: none;
}
Ahora le añadimos un efecto redondeado en las esquinas. Si todos los navegadores trabajaran igual nos bastaría con la primera propiedad. Las otras dos son para aumentar la compatibilidad:
border: 1px solid #cccccc;
padding: 10px;
color: #ffffff;
background: #999999;
font-size: 28px;
line-height: 30px;
text-decoration: none;
border-radius: 16px;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
}
Ya va tomando forma la cosa. Ahora es el momento de incorporar unas sombras que le den realismo y "altura". Al igual que con los bordes redondeados, las sombras hay que declararlas de tres maneras para que se puedan interpretar en más navegadores distintos. Y ya que estamos, también añadimos una sombra al texto context-shadow.
border: 1px solid #cccccc;
padding: 10px;
color: #ffffff;
background: #999999;
font-size: 28px;
line-height: 30px;
text-decoration: none;
border-radius: 16px;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
box-shadow: 1px 1px 2px rgba(0,0,0,.5);
-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
-moz-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
text-shadow: #000000 0px 1px 1px;
}
Nos falta un último toque que será el degradado del fondo.
border: 1px solid #cccccc;
padding: 10px;
color: #ffffff;
background: #999999;
font-size: 28px;
line-height: 30px;
text-decoration: none;
border-radius: 16px;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
box-shadow: 1px 1px 2px rgba(0,0,0,.5);
-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
-moz-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
text-shadow: #000000 0px 1px 1px;
background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#999999));
background: -moz-linear-gradient(top, #eeeeee, #999999);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#999999');
}
Mola ¿verdad? Pues ya el último detalle es que el botón sea "pulsable". Esto es, que cuando pinchemos haga algo. Para eso eliminaremos las sombras y desplazaremos 1 píxel abajo-derecha. La pseudoclaseactive es lo que nos permite hacer esto, ya que es la que detecta esa pulsación.
border: 1px solid #cccccc;
padding: 10px;
color: #ffffff;
background: #999999;
font-size: 28px;
line-height: 30px;
text-decoration: none;
border-radius: 16px;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
box-shadow: 1px 1px 2px rgba(0,0,0,.5);
-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
-moz-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
text-shadow: #000000 0px 1px 1px;
background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#999999));
background: -moz-linear-gradient(top, #eeeeee, #999999);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#999999');
}
.boton:active {
box-shadow: 0px 0px 0px rgba(0,0,0,.5);
-webkit-box-shadow: 0px 0px 0px rgba(0,0,0,.5);
-moz-box-shadow: 0px 0px 0px rgba(0,0,0,.5);
position: relative;
top: 1px;
left: 1px;
}
En este último podéis pinchar y ver el efecto.
A partir de aquí vuestra imaginación es la que os permitirá cambiar la apariencia normal y la activa, así como también incorporar otra pseudoclasehover para cuando simplemente se pase el puntero por encima. Estos tres tienen tres estados: normal,hover yactive. A probar...
life insurance co lincoln Service business software domain registration yahoo Dayton freight lines FUTURISTIC ARCHITECTURE Donate your Car for Money Futuristic architecture Forensics online course mesothelioma drug cash out annuity EMAIL BULK SERVICE Car insurance quotes Utah Donating a car in Maryland hosted predictive dialers mesothelioma lawsuit Car Insurance in South Dakota Seo company Best social media platforms for business structered settlement Casino register free domains mesothelioma charities Dwi lawyer Dedicated Hosting Dedicated Server Hosting donate your car for kids Proud Italian cook Online casino Bankruptcy lawyer canada personals yahoo personal injury attorney springfield mo Donate Car for Tax Credit mesothelioma attorneys california Criminal lawyer Motor replacements WordPress theme designers Criminal defense lawyer Donating Used Cars to Charity Cheap auto insurance in VA Donate a Car in Maryland Mobile casino mesothelioma lawyer asbestos cancer lawsuit structured settlemen royalty free images stock buyers of structured settlements Virtual Data Rooms car donate mesothelioma attorney directory ANNUITY SETTLEMENT Car Insurance Quotes Utah personal injury attorney torrance DUI lawyer dallas mesothelioma attorneys Insurance Custom Christmas cards Motor Replacements Online Classes offshore accident lawyer Futuristic Architecture Car Insurance Quotes MN Massage School Dallas Texas Register free domains car insurance quotes pa cheap auto insurance in va Make money online Australia DONATE CAR FOR TAX CREDIT Hard drive Data Recovery Services Casino reviews Online motor insurance quotes Best Criminal Lawyers in Arizona Live casino Donating a Car in Maryland world trade center footage Photo Christmas cards Business finance group WordPress hosting Claim windows phone for business mesothelioma lawsuits domain name yahoo LIFE INSURANCE CO LINCOLN Forex Trading Platform Structures Annuity Settlement Hire php developers Donate Your Car for Kids Hire php programmers Personal Injury Lawyers PHD IN COUNSELING EDUCATION CHEAP CAR INSURANCE IN VIRGINIA NEUSON Automobile Accident Attorney Computer science classes online Php programmers for hire DONATE YOUR CAR FOR MONEY google affiliate Hire php developer Donate Cars in MA New social media platforms Asbestos Lung Cancer Php programmers Seo companies Car Insurance Quotes PA Psd to html mesothelioma personal injury lawyers Donate car to charity California Mortgage Adviser houston mesothelioma attorney semi truck accident lawyers Webex Costs personal injury firm criminal defense federal lawyer Online Motor Insurance Quotes Mortgage Online Colleges structured settlement broker Social media platforms for business Custom WordPress theme designer Seo services Best Seo company Business management software Best social media platforms Online Christmas cards washington mesothelioma attorney PhD in counseling education refinance with bad credit WordPress themes for designers How to Donate A Car in California Psd to WordPress Social media examiner motorcycle accident lawyer san diego Social media management CAR INSURANCE QUOTES COLORADO Tech school Cheap Domain Registration Hosting Html email Psychic for Free purchase structured settlements Cheap Auto Insurance in VA Social media platforms Christmas cards houston tx auto insurance Mesothelioma Law Firm philadelphia mesothelioma lawyer Dayton Freight Lines ONLINECLASSES ROYALTY FREE IMAGES STOCK Annuity Settlements Learning adobe illustrator mesothelioma claims saskatchewan auto insurance Life Insurance Co Lincoln business voip solutions Italian cooking school Adobe illustrator classes car insurance quotes colorado accident lawyers in los angeles online motor insurance quotes Social media strategies Business VOIP Solutions Social media tools Social media campaigns Paperport Promotional Code Donate Car to Charity California mesothelioma settlements workplace accident attorney injury lawyer houston tx personal accident attorney car crash attorneys Donate Your Car Sacramento futuristic architecture Sell Annuity Payment webex costs data recovery raid structured settlement buyer Asbestos Lawyers Car Insurance Quotes Colorado Auto Accident Attorney Nunavut Culture online criminal justice degree anti spam appliance personal injury lawyer how to donate a car in california MET AUTO best structured settlement companies accident attorney in los angeles Dallas Mesothelioma Attorneys auto accident attorney new york mesothelioma law firm dallas mesothelioma lawyer Donate Cars Illinois car accident lawyer michigan Criminal Defense Attorneys Florida auto accident lawyer san francisco Injury Lawyers workers compensation lawyer los angeles Holland Michigan College automobile accident attorney sell annuity payment fortis health insurance temporary World Trade Center Footage google adsense HARDDRIVE DATA RECOVERY SERVICES domains yahoo mesothelioma Donate Old Cars to Charity asbestos lawyers Low Credit Line Credit Cards tennessee mesothelioma lawyer Health Records Personal Health Record Forensics Online Course ONLINE COLLEDGES