Improper display with <!DOCTYPE html
This is the code at the top of the page:
<!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" lang="en-US" xml:lang="en-US"> The body code starts like this: <body topmargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
The page is displayed with margins top, left and right. Why? The page displays correctly when on "html" is noted at the top and nothing else prior to the head.
added formatting to display the code.
この投稿は the-edmeister により
すべての返信 (1)
Is there a particular reason you're using those antiquated attributes instead of CSS?
<head> … <style type="text/css"> body { margin: 0 0 auto 0; background-color: white; } </style>
The attributes you mention are non-standard (specific to Internet Explorer), and as such Firefox only supports them in Quirks Mode. To trigger quirks mode, omit the DOCTYPE declaration from your document (presumably you use a malformed DOCTYPE, which had the same effect).