Order of statements

T

tshad

I just want to see if I have this in the correct order.

This is the way all my pages are set up.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<!-- #include file="..\includes\slidemenus.inc" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="../css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>

Does it matter where the <link> or #include statements are?

I assume the #includes can go anywhere as they are preprocessed files that
become part of the html file.

Metas go in the head section.

I assume <script> goes anywhere also.

Thanks,

Tom
 
M

Mark Parnell

Previously in alt.html said:
Does it matter where the <link> or #include statements are?

<link> has to be in the <head>.
http://www.w3.org/TR/html4/struct/links.html#edef-LINK

#include can be anywhere in the file as far as the server is concerned,
but...
I assume the #includes can go anywhere as they are preprocessed files that
become part of the html file.

....as long as the end result is still valid. In your example, that is
extremely unlikely, unless the include file is blank, or contains only
comments.
Metas go in the head section.
Yes.

I assume <script> goes anywhere also.

<script> can go either in the head or the body.
http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1
 
T

tshad

Mark Parnell said:
<link> has to be in the <head>.
http://www.w3.org/TR/html4/struct/links.html#edef-LINK

#include can be anywhere in the file as far as the server is concerned,
but...


...as long as the end result is still valid. In your example, that is
extremely unlikely, unless the include file is blank, or contains only
comments.

Actually, it contains javascript. So I suppose it is not valid (even though
it does work).

Thanks,

Tom
 
T

Toby Inkster

tshad said:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<!-- #include file="..\includes\slidemenus.inc" -->
<html>

You are unlikely to really want to put an include file there. (It is
possible if it only does some server side processing without printing out
any results.)

Assuming that the contents of this include file are to be displayed on
screen, put it in the BODY.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top