iframe没有收到Maven源代码的<a>

时间:2016-01-14 14:57:32

标签: html iframe

I created a menu with five options and if I click in this options, my iframe created below will open a page designed in my tag <a>.

But when I click nothing happens. The iframe does not change the src.

Code:

@charset "UTF-8";

html {
  height: 100%;
}

body {
  background-color: rgb(255,255,255);
  height: 100%;
}

div#header{
  width: 100%;
  height: 10%;
  background: linear-gradient(#61a9e8, #0b5d8a);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}


img#idlogo {
  height: 85%;
  margin-left: 15px;
  margin-top: 3px;
}

div#menu{
  background-color: #bababa;
  width: 100%;
  height: 6%;
}

iframe#frame{
  float: left;
  width: 70%;
  height: 84%;
  border-bottom-left-radius: 5px;
}

div#latmenu{
  float: right;
  width: 30%;
  height: 84%;
  background-color: blue;
  border-bottom-right-radius: 5px;
}

div#optionmenu{
  float: left;
  background-color: #dedede;
  box-shadow: 0px 0px 15px rgba(0,0,0,.6);
  border-radius: 8px;
  height: 70%;
  width: 550px;
  margin-left: 10px;
  margin-bottom: 6px;
  margin-top: 6px;
}

nav#navmenu ul{
   	  list-style: none;
  text-transform: uppercase;
  float: left;
  position: absolute;
  left: 0%;
  margin: 6px auto auto -20px;
}

nav#navmenu li{
  display: inline-block;
  font-size: 11pt;
  margin-right: 3px;
  margin-left: 3px;
  text-shadow: 0px 0px 8px #FFFFFF;
  transition: text-shadow .3s;
}

nav#navmenu li:hover{
  text-shadow: 0px 0px 8px rgba(0,0,0,.8);
}

nav#navmenu li::first-letter {
  text-decoration: underline;   
}

nav#navmenu a{
  color: #000000;
  text-decoration: none;
  transition: color .3s;
}

nav#navmenu a:hover{
  color: #FFFFFF;
}

nav#navmenu{
  display: block;
  float: left;
}
<html>
  <head>
    <meta charset="UTF-8">
    <title>Site name</title>
    <link rel="stylesheet" type="text/css" href="_css/home.css">
  </head>

  <body lang="pt-br">

    <div id="header">
      <img src="_image/logoshadow.png" id="idlogo">
    </div>

    <div id="menu">
      <div id="optionmenu">
        <nav id="navmenu">
          <ul>
            <li><a href="http://google.com.br" target="nframe">Register</a></li>
            <li><a href="http://youtube.com.br" target="nframe">Update</a></li>
            <li><a href="http://facebook.com.br" target="nframe">Database</a></li>
            <li><a href="http://mail.google.com.br" target="nframe">Profile</a></li>
            <li><a href="index.html" target="_self">Exit</a></li>
          </ul>
        </nav>
      </div>
    </div>
  
    <iframe src="index.html" id="frame" name="nframe" frameBorder="0"></iframe>
  
    <div id="latmenu"></div>
  </body>

</html>

1 个答案:

答案 0 :(得分:0)

这里有两个不同的问题。

您尝试加载的三个页面告诉浏览器它们不应该显示在一个框架中,浏览器会尊重它。

另一方面,你只是弄错了网址。

来自我的浏览器的开发者&#39;工具控制台:

Refused to display 'https://www.google.com.br/?gws_rd=ssl' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Refused to display 'https://www.youtube.com/?hl=pt&gl=BR' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Refused to display 'https://www.facebook.com/' in a frame because it set 'X-Frame-Options' to 'DENY'.
GET http://mail.google.com.br/ net::ERR_NAME_NOT_RESOLVED