/*para centrar verticalmente se usa el mismo valor del height elemento padre en el elmeento hijo
asi
{height:35px;line-height:35px;}
muy importante que el line-height lo coloques luego del font-size
y si usas un fondo puedes colocar la propiedad
background-position: 0px center;
*/
* {margin:0;padding:0;}
body {font:normal 14px/20px arial;color:#444;}
#menu {overflow: hidden;}
#menu li {display: inline;}
#menu li a {
font-size:16px;
display:block;
float:left;
height:50px;
padding:0px 10px 0px 40px;
line-height:50px;
color:#FFF;
background: #222 url(http://cdn1.iconfinder.com/data/icons/prettyoffice/24/info-.png) no-repeat 10px center scroll;
text-decoration:none;
}
#menu li a:hover {background-color:#aaa;}
JavaScript
/*
reconocimiento de autorĂa:
McPinkY18, http://www.forosdelweb.com/f53/alinear-texto-vertical-915249-post3865361/#post3865366
*/
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.