1

テキスト ファイルが埋め込まれた Web ページがあります。テキスト ファイルの名前は "Broadcast.txt" で、先頭行に .LOG があり、開くたびにタイムスタンプを入力します。それ以外に特別な機能はありません。埋め込みオブジェクトの表示フォントを変更する方法が見つかりません。Dreamweaver を調べて、より大きなフォントを表示できる設定を見つけましたが、役に立ちませんでした。ここに私が持っているコードのスニペットがあります: フォントを 42pt に変更しようとしましたが、それでも効果があります。CSSで設定を変更してみましたが、小さい表示フォントへの変更には影響しません。何か案は?

<div class="container">
  <div class="header"><a href="#"><img src="" alt="Insert Logo Here" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background: #C6D580; display:block;" /></a> 
    <!-- end .header --></div>
  <div class="content">
    <h1>&nbsp;</h1>
<h2>&nbsp;</h2>
    <p>  <OBJECT DATA="Broadcast.txt" TYPE="text/html" WIDTH="600" HEIGHT="400" ALIGN="bottom" STYLE="width:96%;margin:2%;">
        <EMBED SRC="U:\Web Pages\Web Templates\greeny_blu\Broadcast.txt" WIDTH="600" HEIGHT="400" ALIGN="bottom"></EMBED>
      </OBJECT> </p>
    <p>&nbsp;</p>
  <!-- end .content --></div>

よし、こうすれば?私はJSを介してそれを読んでいます.それは今フレームにあります. 私はまだフォントを分離することはできません。これが私が持っているものです:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <!-- TemplateBeginEditable name="doctitle" -->
  <title>ISC Impact Summary</title>
  <!-- TemplateEndEditable -->
  <META HTTP-EQUIV="REFRESH" CONTENT="10"> <!--
  This is the automatic refresh setting for this web page. It is in seconds. 
  -->
  <html>  
  <style type="text/css">
  body {
    background-color: #06F;
  }
  .Style1 {
    font-family: Calibri;
    font-size: 24em;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    background-color: #C0C0C0;
}
  body,td,th {
    color: #CF0;
}
  </style>
  <head>  
  <script type="text/javascript">   
  function init(){      
  var extText = window.frames[0].document.getElementsByTagName("HTML")[0].outerHTML; 
  document.getElementById("nMessage").innerText = extText; }
  </script>
  <!-- TemplateBeginEditable name="head" -->
  <!-- TemplateEndEditable -->
  </head>  
  <body>
  <div>
    <div align="center">
      <h2>ISC Critical Alert Summary</h2>
    </div>
  </div>


   <div>
  </div>
  <div align="center" style="font-size:42;"><!-- TemplateBeginEditable name="EditRegion1" -->
  <iframe src="Broadcast.txt" width="96%" marginwidth="2%" height="400" marginheight="2%" align="middle"     scrolling="Yes" class="Style1" id="messageTxt" style="font-size:42pt" >ISC Critical status</iframe>
    <!-- TemplateEndEditable -->
  </div>   </body>  
</html>
4

1 に答える 1

2

「メイン」htmlからパラメータを変更することはできません。ブラウザは、iframeと埋め込みドキュメントを親から分離します。

javascriptを介してテキストをロードするか、txtではなくhtmlを使用できます。


技術の詳細:)

t.txt-テキスト付きのファイルです。フルURLを設定するか、このページの近くに配置して名前のみを設定できます。

    <!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <title>ISC Impact Summary</title>
    <style type="text/css">
        .b-box_with_grand_text{
            font-size: 42px;
        }
    </style>
    <!--copy this block. jQuery is get from google servers-->
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
        // this possible write on clean JS
        $(document).ready(function(){
            $.get('t.txt', function(data) {
                // #echo_file = id from div
                $('#echo_file').html(data);
                alert('Load was performed.');
            });
        })
    </script>
    <!--end copy-->
</head>
<body>
<!--in this block txt file content will be posted. 
Just copy id in place where you want place text-->
<div id="echo_file" class="b-box_with_grand_text"></div>
</body>
</html>

これは機能しますが、高価なライブラリjQueryをロードします。

于 2012-07-06T21:29:06.793 に答える