2012-06-23 2 views
4

저는 초보자입니다. iframe 태그가 포함 된 웹 페이지가 있습니다. 태그가 iframe 태그를 다음iframe 태그가 페이지의 다른 내용을 차단하고 있습니다.

<iframe src="http://mysite.com/l/5042/2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" /> 

HTML 콘텐츠처럼 닫혀있는 경우 표시되지 않습니다. 태그가

<iframe src="http://mysite.com/l/5042/2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" > </iframe> 

모든처럼 닫혀있는 경우 하지만 잘 작동합니다.

내가 왜 이상한 문제인지 모르겠다.

+1

'iframe'은' '와 작동하지 않지만' '으로 닫히면 작동합니까? –

+0

페이지의 DOCTYPE은 무엇입니까? – Karl

+0

@Karl :' ' 이 페이지는'.jsp' 페이지입니다. –

답변

0

은 iframe을 열고 닫는 태그 사이의 공간이 당신의 예를

<iframe src=... attributes=...></iframe>

에서하지만 당신의 예제에서 작동하는 것과 같은 태그가, 단지를 제거합니다.

+0

제 생각에 우주가 어떤 문제도 일으키지 않는다고 생각합니다. 사실,이 팁은 w3shools.com 사이트의 [iframe] (http://www.w3schools.com/tags/tag_iframe.asp) 항목에 있습니다. _Tip : 태그 사이에 원하는 텍스트를 넣으십시오 ._ – Karl

+0

iFrame에는 두 번째 예와 같이 닫는 태그가 있습니다. 그거야. 어쩌면 공간이 있든 없든, 현재 HTML을 표시 할 수있는 브라우저는 iframe을 지원하지 않습니다 (궁금한 심각한 질문)? – YvesR

1

복사 W3C markup validation service이 코드 :

<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> //--> 

<!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"> 
<head> 
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> 
    <title></title> 
</head> 
<body> 

    <iframe src="http://mysite.com/l/5042//2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" ></iframe> 

    <iframe src="http://mysite.com/l/5042//2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" /> 

</body> 
</html> 

주석과 주석이 적절하게 두 개의 서로 다른 DOCTYPE의를 테스트합니다.

DOCTYPE에는 iframe 태그가 지원되지 않습니다. DOCTYPE을 변경하거나 iframes을 사용하지 마십시오. (물론, 명시 적으로 닫힌 iframe 태그를 사용할 수는 있지만 유효하지 않으므로 가능한 한 많은 브라우저에서 작업하고 싶다면 위험한 옵션이라고 말할 수 있습니다.)

I don ' 의미는 iframe이 사용되지 않음을 의미합니다. W3C site

관련 문제