Zoeken in Support

Vermijd ondersteuningsscams. We zullen u nooit vragen een telefoonnummer te bellen, er een sms naar te sturen of persoonlijke gegevens te delen. Meld verdachte activiteit met de optie ‘Misbruik melden’.

Meer info

Deze conversatie is gearchiveerd. Stel een nieuwe vraag als u hulp nodig hebt.

Improper display with <!DOCTYPE html

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

Bewerkt door the-edmeister op

Alle antwoorden (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).