George Kourtis George Kourtis - 6 months ago 18
HTML Question

positioning of iframe with <!doctype html> active

<!doctype html>
<html>
<head>
<title>NAPL</title>
</head>

<body>
<form id="main" method="post" enctype="text/plain" accept-charset="UTF-8">
<iframe id="dict" align="right" src="dict.html" width="15%" height="80%"></iframe>
</form>
</body>
</html>


Just starting to learn html.
If I issue from the server the text bellow and I ommit
<!doctype html>
then everything works as expected regarding the positioning and size of the iframe.
Actually if I put
<!docttype html>
everything changes and I don't know more how to have the same previous effect in the simplest way.

Answer

Without the doctype, browsers switch to quirks mode. I don't know the exact intricacies of these horrendous behaviors, but the standard equivalent CSS seems something like

body {
  margin: 8px; /* Usually the default value */
}
#dict {
  position: absolute;
  right: 8px;
  width: 15%;
  height: 80%;
}