English 中文(简体)
为什么该页在IE的显示不同于Google chrome?
原标题:why does the page display differently in IE than google chrome?

某些网页在一般情况下非常可怕,解决这些问题的最佳办法是什么?

最佳回答

页: 1

Add this (the HTML5 doctype) as the very first line:

<!DOCTYPE html>

and it should look better.

虽然用人工方式修改文件(使用开发工具;打到F12),但它仍然看上去。 这页显然还有其他问题。


最为相关的问题(继基茨模式之后)是:

<body style="margin: 0; padding; 0;background-color: 4DA2CA;">

因特网探索者没有显示任何背景颜色,因为你在颜色之前放弃#。 (你有<条码>dding;0,有<条码>;代替<条码>:)

This will work:

<body style="margin: 0; padding: 0; background-color: #4DA2CA">

But you shouldn t be using inline styles in the first place..

This would be better:

<body>

with CSS in your stylesheet:

body {
    margin: 0;
    padding: 0;
    background-color: #4DA2CA
}
问题回答

you mean that in IE the Div s are smaller.Thats because in IE css border,margin are included in the width declared.So, if you have given a div width of 100px and a margin of 10px both sides then in IE the actual visible width of this div will be 100-10-10=80px.To solve the problem you can use child css decleration. Considering our example if you want to show this div 100px width in both the browsers do the following

    .mydiv{       /*This deceleration will be understood by all the browsers*/
     margin:10px;
     width:120px;       
    }

    html>body .mydiv{  /*This deceleration will not be understood by IE browsers so other will override the width*/
     width:100px;          
    }

Using this you can uniform the width of your Divs across both IE and non-ie browsers

我不指出每个要素在独立实体中产生不同方式的原因,而是强烈建议,在你创造新的网页内容时,不要再造轮椅。

即使在现代标准原告浏览器中,CSS也可能非常难以预测,因此,它能更好地利用来自可靠来源的防弹束码,例如,

CSS 失踪手册

CSS: Definitive Guide

https://rads.stackoverflow.com/amzn/click/com/059615593X”rel=“nofollow noreferer”>CSS Cookbook

开始使用超文本/特别安全局的工作区块,并将之修改给您的称呼和测试从那里交叉浏览器。 整个进程将大大降低沮丧。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签