'htm'확장명을 가진 파일에 다음 내용을 저장하면 해당 내용이 렌더링되고 표시됩니다. JavaScript 경고.html 또는 body 태그가없는 html 파일이지만 div 만 모든 브라우저에서 렌더링됩니다.
브라우저에서 html 파일을 렌더링하는 데 최소한 HTML 및 body 태그가 필요하다는 인상을 받았습니다.
브라우저가 정상적으로 작동합니까? 이로 인해 보안 관련 문제가 발생합니까?
<table width="100%" height="100%" border="1">
<tr>
<td style="margin:0 auto;">
<div style='color:red;height:100%;width:100%;margin:0 auto;text-align:center;border-width:1px;border-color:blue;border-style:solid;vertical-align:middle' id="div1">
Does this render in a Browser, since there are html, head and body tags?
<div id='div2' style='height"100%;width:100%;margin:0 auto;text-align:center;border-width:1px;border-color:green;border-style:solid;'>Hello! Will the browser show this?</div>
</div>
</td>
</tr>
</table>
<script type='text/javascript'> alert('showing without tags');</script>
대부분의 브라우저는 잘못 작성된 코드를 보완하려고 노력하며 이해할 수있는 코드를 실행하기 위해 최선을 다할 것입니다. – j08691
[Quirks Mode] (http://en.wikipedia.org/wiki/Quirks_mode)를 구하십시오! 또한 [whatwg] (http://quirks.spec.whatwg.org/)에도 나와 있습니다. – Oded
그러면 문제가 발생하지 않을까요? – Sunil