2017-06-08 19 views
0

所以,我一直在尋找解決我的問題的地方,但我想我已經嘗試了一切,但我的代碼根本不工作。框架文檔的字符編碼沒有聲明

我試圖把一些txt文件的文本放在一個iframe中,它實際上是在讀它,但是當我嘗試更改css時,在標題中出現了這樣一條消息:「一個幀的字符編碼文件沒有被宣佈。「

這是我的代碼:

<!DOCTYPE html> 
<html lang = "pt"> 
<head> 
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> 
    <meta content="utf-8" http-equiv="encoding"> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
<style> 
h1{ 
    position: absolute; 
    left:85px; 
    top:0px; 
} 
.LOGO{ 
    position: absolute; 
    width:70px; 
    height:70px; 
    z-index: 2; 
} 
.portugal{ 
    position: absolute; 
    top: 65px; 
    left: 0px; 
    width:auto; 
    height:auto; 
    z-index: 1; 
} 
.PT01{ 
    position: relative; 
    top: 438px; 
    left:560px; 
    width:20px; 
    height:20px; 
    z-index: 3; 
} 

</style> 
</head> 
<body> 
<script> 
    var x = document.getElementsByTagName("PT01"); 
    if(x.id == 'PT01'){ 
     $("#div1").css("border-style","none"); 
     $("#div1").css("position",'relative'); 
     $("#div1").css("top",'315px'); 
     $("#div1").css("left",'535px'); 
     $("#div1").css("width",'auto'); 
     $("#div1").css("height",'auto'); 
     $("#div1").css("zIndex",'4'); 
    } 

</script> 

    <img class = "LOGO" src = "http://www.chronopost.pt/sites/all/themes/custom/quimera/favicon.ico"/> <h1> Informações Package Chronopost </h1> 
    <img class = "portugal" src = "http://s2.thingpic.com/images/HV/9N2YRDXBuosfkppy9Jut8Tvx.png"/> 
    <img class = "PT01" name = "PT01" src = "http://www.chronopost.pt/sites/all/themes/custom/quimera/favicon.ico"/> 
    <iframe id='div1' src = "PT01.txt"> 
    </iframe> 

</body> 
</html> 

我希望你能幫助我解決這個!我只是一名學生,我正在努力學習更多。 謝謝!

回答

2

可能重複here

你可以試試這個,你iframe標籤之間補充一點:

<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> 
+0

非常感謝您的回答!你的意思是這樣嗎? :