Validation inference error: no attribute "leftmargin"

no attribute "leftmargin"

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheig
Run codeHide result

<!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" xml:lang="en" lang="en">
<head>
Run codeHide result

Not sure what happened, any tips?

+4
source share
3 answers

leftmarginwas a non-standard extension for HTML by the browser provider. This was never standardized because CSS came about (almost two decades ago). Since it is not standard, it is not part of the XHTML 1.0 Transitional DTD.

Use CSS instead (for all attributes that you have in the body start tag in this example).

NB: Transitional DTD , HTML 3.2 Strict DTD. , , . HTML 5 ( ).

+5

:

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheig…

CSS , -:

<style type="text/css">
    body {
        margin: 0;
        padding: 0;
        background: #FFFFFF;
    }
</style>
+1

Use css style="margin-left:0px;"

0
source

All Articles