开发者

height for form element "select" displayed incorrectly in IE on server but on local machine is ok

I have next code for element form "select":

<div style="width: 300px; margin: 0 auto; background: yellow;">
<form>
    <select style="width:100%; height: 24px; line-height: 16px; padding: 2px; background: none repeat scroll 0 0 #FFFFEA; border: 1px solid #B7AB8C; color: #605436; font-family: Arial,Tahoma,Verdana,sans-serif; font-size: 12px;">
        <option>item 1</option>
        <option>item 2</option>
    </sele开发者_Go百科ct>
</form>

The element is displayed differently on the local machine and the server for IE. I can't change height for element "select" for IE on server, while on the local machine display everything correctly.

Thanks.


displayed differently on the local machine and the server for IE

This problem is always to do with the "Document Mode" that IE is using to render the page.

Open your page on both your local machine and the server, then hit F12 in both of them to bring up the Developer Tools. Compare the "Browser Mode" and "Document Mode" between the two pages.

You can probably fix it by adding this inside the <head>:

<meta http-equiv="X-UA-Compatible" content="IE=edge">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜