Title: RE: [WSG] Center aligning links with a specified height

I think I’ve found a solution it requires a separate padding style for IE though.

http://labs.flog.co.nz/css-help/solution.htm

ul {

        list-style-type:none;

        background: #cfc;

height: 40px;

overflow: hidden;

}

li a {

        background: #eee;

        display: inline-block;

        padding: 0 20px;

        line-height: 40px;

}

li > a {

        padding: 20px;

}

Could somebody please check it in Safari?


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Kenny Graham
Sent: Tuesday, 23 August 2005 10:22 a.m.
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Center aligning links with a specified height

I got it working in firefox and almost in IE/Win (height is way bigger than it's supposed to be in IE) by changing the "li a" in Nick's example to:

li a {
    background: #eee;
    display: inline-block ;
    /*height: 50px;*/
    line-height: 50px;
    font-size: 14px;
    padding: 17px 20px;
}

Now, keep in mind as soon as someone resizes the text, it won't work anymore. So I'd keep looking, even if you fix it in IE. But maybe it's a step in the right direction? I stopped trying to make stuff work in IE when it started to give me ulcers and gray hairs (and I'm only 21).  Good luck.

Reply via email to