2014-09-28 50 views
0

我有通過打開一個DIV中的網址導航索引頁HTML CSS樣式高度:100%工作在Chrome,但不是在IE或Firefox罰款[!變得抓狂]

在Chrome中工作正常,但不任何其他瀏覽器。

的代碼如下:

<!-- This is a part of index.php who redirects the browser to another site inside a div.--> 

    <div style="width:100%; height:100%; overflow:hidden;"> 
    <object type="text/html" data="http://*****.com/home.php" style="width:100%; height:100%; margin:1%;"> 
    </object> 
</div> 

我怎樣才能解決這個問題,我在做什麼錯!?

回答

0

高度是相對父,所以你需要添加的高度:100%以身體和HTML來得到它的工作。不知道爲什麼它在Chrome瀏覽器...

0

在你的CSS的開頭加入這將重置像主要內容保證金瀏覽器的默認參數:

/* CSS reset */ 
html, body, div, span, applet, object, iframe, 
h1, h2, h3, h4, h5, h6, p, blockquote, pre, 
a, abbr, acronym, address, big, cite, code, 
del, dfn, em, img, ins, kbd, q, s, samp, 
small, strike, strong, sub, sup, tt, var, 
b, u, i, center, 
dl, dt, dd, ol, ul, li, 
fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td, 
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary, 
time, mark, audio, video { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    font-size: 100%; 
    font: inherit; 
    vertical-align: baseline; 
} 
/* HTML5 display-role reset for older browsers */ 
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section { 
    display: block; 
} 
body { 
    line-height: 1; 
} 
ol, ul { 
    list-style: none; 
} 
blockquote, q { 
    quotes: none; 
} 
blockquote:before, blockquote:after, 
q:before, q:after { 
    content: ''; 
    content: none; 
} 
table { 
    border-collapse: collapse; 
    border-spacing: 0; 
} 
0

在你想要的header.css聲明:

html, body { height: 100% } 

第7行的它,你只是把寬度

+0

都做到了,但可惜的問題仍然存在。謝謝 ! – 2014-09-28 16:45:44

+0

似乎很奇怪...你是否刷新瀏覽器緩存? – pna 2014-09-28 16:49:49

+0

重點是,我header.css不是主要的CSS,即時通訊使用另一個,我做了同樣的,它運行完美,謝謝。 – 2014-09-28 16:54:16

相關問題