Search code examples
cssinternet-explorerinternet-explorer-7internet-explorer-6

IE 7 changes height of block element when using css border


<div class="navi-buttons">
                <div class="box"> <a href="#" id="c1f" class="simple">1</a></div>
                <div class="box"><a href="#" id="c2f" class="simple">2</a></div>
                <div class="box"> <a href="#" id="c3f" class="simple">3</a></div>
                <div class="box"> <a href="#" id="c4f" class="simple">4</a></div>
                <div class="box"> <a href="#" id="c5f" class="simple">5</a></div>
                <div class="box-hover"><a href="#" id="c6f" class="hover">6</a></div>
            </div>

 .navi-buttons
{
margin-top:8px;
height:auto;
}

.navi-buttons .box{ background-color: #FF9900; display:block; padding:4px;margin-right:2px;float:left;width:10; height:13px;}
.navi-buttons .box-hover{ border: thin solid #FF9900; display:block; padding:3px;margin-right:2px;   float:left;width:10; height:13px;}
.navi-buttons .hover
{

padding: 3px;
color: #FF9900;

}
.navi-buttons .simple
{
background-color: #FF9900;
padding: 3px;
color: #FFFFFF;
}

.navi-buttons a:hover
 {

text-decoration: underline;
}   

Outcome:enter image description here

If u see the image below in IE 7 the selected button in this case 4 height changes , in other browsers it works fine , i have included the markup and css , Can anyone provide any assistance with it , where am I getting it wrong.

Thnx


Solution

  • may be you have to write 1px instead of thin . Like this :

    .navi-buttons .box-hover {
        border: 1px solid #FF9900; 
        display:block; 
        padding:3px;
        margin-right:2px;   
        float:left;
        width:10; 
        height:13px;
    }