iframeタグ間の正しい書き方について

このQ&Aのポイント
  • iframeタグ間の正しい書き方について疑問があります。具体的には<iframe>と</iframe>の間に含めるhtmlタグについてです。
  • 対象のiframeは「http://www.good-house.jp/new/index.html」を呼び出しており、<iframe>タグの属性として「src」を使用しています。
  • 正規表現の観点からは、<iframe>と</iframe>の間にhtmlタグを含めることは問題ありませんが、セキュリティの観点からは慎重に検討する必要があります。
回答を見る
  • ベストアンサー

iframeタグ間の正しい書き方で疑問があります。

iframeタグ間の正しい書き方で疑問があります。 iframeで http://www.good-house.jp/new/index.html を呼び出しているのですが、 <iframe>と</iframe>の間に上記のnew/index.htmlのhtmlタグを入れるのは正規表現テキにOKなのでしょうか?NGなのでしょうか? 具体的には次のように書いています。 <iframe src="new/index.html" width="850" height="45" title="新着情報"> <table border="0" summary="ハウスクリーニングの新着情報"> <tr valign="top"> <td><img src="image/common/renew.gif" alt="new!" width="44" height="16"></td> <td><a href="infotop/index.html" id="INFOTOP" target="INFOTOP"><strong>格安!</strong> 僅か10,290円でエアコンクリーニング : (Infotopで新発売)<br> 年に一度の<strong>プロ・エアコンクリーニング</strong>で、エアコン内の<strong>汚れ・カビ・ダニを一掃</strong>!エアコン<strong>電気代の節約</strong>にも・・</a> </td> </tr> </table> </iframe> ご存知の方がいらっしゃいましたら、教えてください。お願いします。

  • SEO
  • 回答数1
  • ありがとう数2

質問者が選んだベストアンサー

  • ベストアンサー
  • intto
  • ベストアンサー率100% (1/1)
回答No.1

「正規表現テキ」というのはよく分かりませんが、 フレームに関するHTMLタグ「http://itref.fc2web.com/html/frame.html」によると ====== 開始タグと終了タグの間には、インラインフレームに対応していないブラウザのためのメッセージを記述します。インラインフレームに対応しているブラウザでは、開始タグと終了タグの間の文字列は表示されません。 ====== とあるのでインラインフレームタグ<iframe>と</iframe>のあいだにタグや文章を入れても大丈夫だと思います。

参考URL:
http://itref.fc2web.com/html/frame.html
reyyazawa
質問者

お礼

ご回答ありがとうございます。判断に迷っていたのですが、これですっきりました!

関連するQ&A

  • 一つのテーブル内の情報を、iframeではなく、非同期通信で行うには?

    一つのテーブル内の情報を、iframeではなく、非同期通信で行うには? 現在、トップページ内の一つのコンテンツを、 iframeで一定時間毎に自動リロードさせる形で演出しているのですが、 SEO的に良くないと聞き、それと同時に解決策として 「非同期通信」の存在を知りました。Ajaxを利用すれば、iframeを使わずに 今のような演出が可能らしいのですが、どのような形で記述すれば宜しいでしょうか? 例を書きます。 トップページ … index.php コンテンツの入ったページ … contents.php(テーブルレイアウトで作成) 現状は、index.phpに置かれたiframeの場所に、contents.phpを読み込んでいます。 iframeは5分毎に自動更新させていますが、これを非同期通信で5分毎に呼び出したいです。 付け焼刃の知識でイメージしている仕組みは、 まず、prototype.jsなどのライブラリをindex.php内で読み込ませ、 指定したtableやdivにcontents.phpを呼び出す仕組みなのかなと勝手に想像しています。 参考になる記述方法をどなたかご教授頂けませんでしょうか… 現状はこのような記述方法で対応しています。 index.php内 ----------------------- <body> <table width="300" height="300"> <tr> <td width="300" height="300"> <iframe src="contents.php" width="300" height="300"></iframe> </td> </tr> </table> </body> ----------------------- contents.php ----------------------- <body> <table width="300" height="300"> <tr> <td width="300" height="300"> ここはコンテンツページです </td> </tr> </table> </body> -----------------------

  • <iframe>内にHTMLをランダム表示するには?続きです。

    先日の<iframe>内にHTMLをランダム表示するには?の続きなのですが、 http://questionbox.msn.co.jp/qa2962976.htmlの疑問は 皆様のお力で解決しました。 誠にありがとうございました。 もう一つ教えて頂きたいことがあるのですが、 かなりの素人なので説明不足など分かりづらいところが多々あると思いますが、 何卒宜しくお願い致します。 同じhtmlに複数のiframeを配置し、 各iframeをランダムにしたいのです。 その際、各iframeは別々のフォルダーに収納されているhtmlを 表示するようにしたいです。 例えば、同じhtmlに iframe1、iframe2、iframe3があるとし、 01、02、03という3つのフォルダーの中に 01.html、02.html、03.htmlがそれぞれ収納されているとした場合、 iframe1は01のフォルダーの中のhtmlをランダムで表示し、 iframe2は02のフォルダーの中のhtmlをランダムで、 iframe3は03のフォルダーの中のhtmlをランダムで、 といったランダム表示にしたいです。 あまりの素人なので全く分かりませんので、 大変申し訳ありませんが、 多少いじってコピペするくらいまで完成されたソースを教えて頂けますでしょうか? 宜しくお願い致します。 ------------------------------------------------------------------------- 以下のソースは、 3つのiframeに同じフォルダー内のhtmlをランダムで表示させることができたソースです。 教えてもらいました。 こちらは参考までに載せました。_ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> <title></title> <script type="text/javascript"> <!-- function RndmSubFlame(){ rlURL= new Array(); rlURL[0]="01.html" rlURL[1]="02.html" rlURL[2]="03.html" n=rlURL.length; x1=Math.floor(Math.random()*n); x2=Math.floor(Math.random()*n); x3=Math.floor(Math.random()*n); s01.location.href = rlURL[x1]; s02.location.href = rlURL[x2]; s03.location.href = rlURL[x3]; } //--> </script> </head> <body onload="RndmSubFlame()"> <table border="1" width="84%" height="87"> <tr> <td width="33%" height="81"><iframe src="a01.html" frameborder="0" width="100%" height="190" name="s01" scrolling="no"></iframe></td> <td width="33%" height="81"><iframe src="a01.html" frameborder="0" width="100%" height="190" name="s02" scrolling="no"></iframe></td> <td width="34%" height="81"><iframe src="a01.html" frameborder="0" width="100%" height="190" name="s03" scrolling="no"></iframe></td> </tr> </table> </body> </html> ------------------------------------------------------------------------- 以下のhtmlソースに書き加えてもらえると大変助かります。 何卒、宜しくお願い致します。 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> <title></title> </head> <body> <table border="1" width="45%" height="448"> <tr> <td width="46%" height="210"><iframe src="01/01.html" frameborder="0" width="100%" height="190" name="01" scrolling="no"></iframe></td> <td width="54%" height="442" rowspan="2"><iframe src="03/01.html" frameborder="0" width="100%" height="190" name="03" scrolling="no"></iframe></td> </tr> <tr> <td width="46%" height="226"><iframe src="02/01.html" frameborder="0" width="100%" height="190" name="02" scrolling="no"></iframe></td> </tr> </table> </body> </html>

  • Iframeとして呼び出すページを120px以下を表示したい

    Iframeを使いたいのですが、A.htmlの高さ120pixから下をIframeで指定したいときはどうしたらいいでしょうか。 <html> <head> <title>testtitle> </head> <body> <div width:100%; height:120px;> <table> <tr> <td><iframe src="A.htm" width="100%" height="100%" frameborder="0" scrolling="no" overflow:no></iframe><td> </tr> </table> </div> </body> </html> 呼び出すIframeの中身のページについて 高さを120pix以下を表示したいのですが。 よろしくおねがします。

  • <iframe>内にHTMLをランダム表示するには?

    かなりの素人なので説明不足などで分かりづらいところが多々あると思いますが、 何卒宜しくお願い致します。 同じhtmlに複数のiframeがあるのですが、 その全てのiframeをランダムにしたいのですが、 あまりの素人なので全く分かりません。 申し訳ありませんが、 多少いじってコピペするくらいまでのソースを教えて頂けますでしょうか? 宜しくお願い致します。 iframe一つだけのランダムは以下のソースでできました。 <head> <script type="text/javascript"> <!-- function RndmSubFlame(){ rlURL= new Array(); rlURL[0]="01.html" rlURL[1]="02.html" rlURL[2]="03.html" n=rlURL.length; x=Math.floor(Math.random()*n); sub_flame.location.href = rlURL[x]; } //--> </script> </head> <body TopMargin=0 LeftMargin=0 RightMargin=0 BottomMargin=0 STYLE="overflow:auto;height:100%;" onLoad="RndmOpen()"> <script><!-- document.write("<iframe src=\""+riURL[x]+"\"></iframe>"); //--> </body> 以下のhtmlのようなページです。 できましたら、このソースに書き加え頂けますと 大変助かります。 宜しくお願い致します。 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> <title></title> </head> <body> <table border="1" width="84%" height="87"> <tr> <td width="33%" height="81"><iframe src="a01.html" frameborder="0" width="100%" height="190" name="01" scrolling="no"></iframe></td> <td width="33%" height="81"><iframe src="a01.html" frameborder="0" width="100%" height="190" name="02" scrolling="no"></iframe></td> <td width="34%" height="81"><iframe src="a01.html" frameborder="0" width="100%" height="190" name="03" scrolling="no"></iframe></td> </tr> </table> </body> </html>

  • Netscape6.02におけるiframeの%表示について

    インラインフレームを使って、下の例のように%指定で表示させたいのですが、 Netscape7では問題なく表示されるのですが、Netscape6.02では表示されません。 (表示されないというか、0%と解釈されるようです。) サイズを%ではなくピクセルで指定すれば問題ないのですが、画面サイズにかかわらずフルサイズで表示されるようにしたいため、パーセンテージで指定したいのです。 何かいい方法をご存じの方がいたら、教えて下さい。 無理な場合は、Netscapeのバージョン7未満では別のページにジャンプさせるという方法でもかまいません。 よろしくお願いします。 (例) <html> <head></head> <body> <table width="100%" height="100%"> <tr> <td width="100%" height="100%"> <iframe src="http://www.okweb.ne.jp/" width="100%" height="100%"></iframe> </td> </tr> </table> </body> </html>

    • ベストアンサー
    • HTML
  • table内でiframeを表示

    table内でiframeを表示するとき、iframeの幅をtableのセルの幅に合わせるにはどうすればいいでしょうか? <table> <tr> <td>…</td> <td><iframe src="…"></iframe></td> <td>…</td> </tr> </table>

    • ベストアンサー
    • HTML
  • テーブルの中にiframe

    テーブルの中にiframeをしているのですが どうしてもボタンが右側に少しはみ出ますし iframeは縦400pxを超えるページを表示すると 縦スクロールバーが表示されますが それも右側にはみ出ます。 どうにか800pxの中に収まらないものでしょうか? また、ボタンのボーダを下記ソースでは消していますが デフォルトで表示される立体感のあるボタンのまま 800pxの中に収めたいです。 HTML5、CSS2.1です。 ご相談お願いします。 <table> <tr style="width: 800px; height: 50px"> <td><input type="button" value="1"/></td> <td><input type="button" value="2"/></td> <td><input type="button" value="3"/></td> <td><input type="button" value="4"/></td> <td><input type="button" value="5"/></td> </tr> <tr style="width: 800px; height: 400px"> <td colspan="5" style="width: 800px; height: 400px"> <iframe src="hoge.htm"></iframe> </td> </tr> <tr style="width: 800px; height: 50px"> <td colspan="5" style="width: 800px; height: 50px"> <p>hoge</p> </td> </tr> </table> ------------------------------------------------------------ table { padding: 0px; margin: 0px; border-style: none; border-width: 0px; } tr td { padding: 0px; margin: 0px; border-style: none; border-width: 0px; } input { border-style: none; border-width: 0px; padding: 0px; margin: 0px; color: Red; width: 160px; height: 50px; font-size: 20px; font-family: HGS明朝B; background-color: transparent; } iframe { padding: 0px; margin: 0px; border-style: none; border-width: 0px; background-color: transparent; width: 800px; height: 400px; }

    • ベストアンサー
    • HTML
  • テーブル高さ指定タグについて

    テーブル高さ指定タグについて サイズがバラバラの4枚の画像をテーブルを使って同じ幅・高さ縦横各2枚並べて表示したいと思っています。 下記のとおり高さ・幅300と指定をしているにもかかわらず、400×400pixの画像が高さを超えて目いっぱい表示してしまいます。 <table border="1" width="600" height="600" cellspacing="0" cellpadding="0"> <tr> <td width="300" height="300" align="center"> <IMG border="0" src="http://○○○○/f000000_1.jpg"></td> <td width="300" height="300" align="center"> <IMG border="0" src="http://○○○○/f000000_2.jpg"></td> </tr> <tr> <td width="300" height="300" align="center"> <IMG border="0" src="http://○○○○/f000000_3.jpg"></td> <td width="300" height="300" align="center"> <IMG border="0" src="http://○○○○/f000000_4.jpg"></td> </tr> </table> どうすれば、すべて300×300pixの範囲内におさめることができるのでしょうか?

    • ベストアンサー
    • HTML
  • 助けてください><IE上で1pxのズレ

    こんにちわ。 組んだテーブルに謎の1pxがはいってしまいます。 ファイヤーフォックスでは正常なのですがIEでは1pxの隙間ができてしまうようで。 どなたか分かる方いらっしゃたらお願いします>< <table width="660" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" valign="top"> <img src="img/test_01.jpg" width="660" height="177" alt=""></td> </tr> <tr><td rowspan="2" valign="top"> <table width="316" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"> <img src="img/test_02.jpg" width="316" height="46" alt=""></td> </tr> <tr> <td> <img src="img/test_05.jpg" width="144" height="47" alt=""></td> <td> <img src="img/test_06.jpg" width="172" height="47" alt=""></td> </tr> <tr> <td colspan="2"> <img src="img/test_08.jpg" width="316" height="169" alt=""></td> </tr> </table> </td></tr> <tr><td valign="top"> <table width="344" border="0" cellpadding="0" cellspacing="0"> <tr><td> <table width="344" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <img src="img/test_03.jpg" width="181" height="62" alt=""></td> <td> <img src="img/test_04.jpg" width="163" height="62" alt=""></td> </tr> <tr> <td colspan="2"> <img src="img/test_07.jpg" width="344" height="83" alt=""></td> </tr> </table> </td></tr> <tr><td> <table width="344" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <img src="img/test_09.jpg" width="160" height="62" alt=""></td> <td> <img src="img/test_10.jpg" width="184" height="62" alt=""></td> </tr> <tr> <td colspan="2"> <img src="img/test_11.jpg" width="344" height="23" alt=""></td> </tr> <tr> <td> <img src="img/test_12.jpg" width="160" height="32" alt=""></td> <td> <img src="img/test_13.jpg" width="184" height="32" alt=""></td> </tr> </table> </td></tr> </table> </td></tr> <tr><td colspan="2"> <table width="660" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="5"> <img src="img/test_14.jpg" width="660" height="141" alt=""></td> </tr> <tr> <td> <img src="img/test_15.jpg" width="130" height="150" alt=""></td> <td> <img src="img/test_16.jpg" width="130" height="150" alt=""></td> <td> <img src="img/test_17.jpg" width="140" height="150" alt=""></td> <td> <img src="img/test_18.jpg" width="130" height="150" alt=""></td> <td> <img src="img/test_19.jpg" width="130" height="150" alt=""></td> </tr> <tr> <td colspan="5"> <img src="img/test_20.jpg" width="660" height="40" alt=""></td> </tr> </table> </td></tr> </table>

  • HTML::テーブルのセルスペーシング、セルパディングについて

    テーブルについてお聞きします。どうか助けてください。 以下のようなソースがあります。 <table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#DED6BF"> <tr> <td><table width="600" border="0" cellpadding="3" cellspacing="1" bgcolor="#DED6BF"> <tr> <td width="150" valign="top" bgcolor="#F7F7F7"><font size="2"><strong>通話開始時間</strong></font><img src="image/spacer.gif" width="136" height="1"></td> <td width="150" valign="top" bgcolor="#F7F7F7"><font size="2"><strong>通話終了時間</strong></font><img src="image/spacer.gif" width="136" height="1"></td> <td width="100" valign="top" bgcolor="#F7F7F7"><font size="2"><strong>通話先</strong></font><img src="image/spacer.gif" width="86" height="1"></td> <td width="100" valign="top" bgcolor="#F7F7F7"><font size="2"><strong>通話時間</strong></font><img src="image/spacer.gif" width="86" height="1"></td> <td width="100" valign="top" bgcolor="#F7F7F7"><font size="2"><strong>料金</strong></font><img src="image/spacer.gif" width="86" height="1"></td> </tr> </table></td> </tr> </table> 一番左のセル(通話開始時間)の幅は150で、そのセルに透明gifをいれて、テーブルがくずれないようにしています。その透明gifの長さは"136"です。 なぜ透明gifの長さは136なのでしょうか?14を引く理由がわかりません。 テーブルのcellpadding="3"とcellspacing="1"なので透明gifの長さは"143"なのではないでしょうか?