Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Learn More

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Improper display with <!DOCTYPE html

  • 1 відповідь
  • 1 має цю проблему
  • 8 переглядів
  • Остання відповідь від Gingerbread Man

more options

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.

This is the code at the top of the page: <pre><nowiki><!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"> </nowiki></pre> 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)

more options

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).