Here’s a basic XHTML 1.0 Strict template showing the correct document structure. Getting this right matters because browsers switch to quirks mode when the doctype is missing or malformed, which causes all sorts of weird CSS rendering issues.

The order of elements in the <head> section matters too — put your meta charset declaration first so the browser knows the encoding before parsing anything else. Scripts and stylesheets come after. If you’re starting a new project today, you’d use the HTML5 doctype (<!DOCTYPE html>) instead, which is much simpler. But if you’re maintaining older XHTML sites, this is the structure you need to follow.

<!DOCTYPE html PUBLIC ?-//W3C//DTD XHTML 1.0 Strict//EN? ?http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd?>
<html xmlns=?http://www.w3.org/1999/xhtml?>
 <head>
 <meta http-equiv=?Content-Type? content=?text/html; charset=UTF-8? />
 <script type=?text/javascript? src=?javascript/javascriptfilename.js?></script>
 <title>Title goes here</title>
 <link href=?stylesheetname.css? rel=?stylesheet? type=?text/css? />
 </head>
 <body>
 Page content goes here
 </body>
</html>