# VBForums CodeBank > CodeBank - Other >  [HTML] It's actually just a template.

## minitech

A copy-and-paste template for people who are tired of writing all of the HTML, HEAD, TITLE, LINK, BODY and SCRIPT tags. Just delete the parts that don't apply to your page.



```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="" />
<title></title>
<script language="javascript" type="text/javascript" src=""> </script>
<script language="javascript" type="text/javascript">
</script>
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
```

----------


## Banjo

You should really have a doctype included and meta tags. Something like this would be better:



```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

   <link rel="stylesheet" type="text/css" href="style.css">

   <title>Site title here</title> 
</head>
<body>

<!-- Content here -->

</body>
</html>
```

Then if you wanted javascript in your page you could link to an external file like so:



```
<script type="text/javascript" src="externalJS.js"></script>
```

or have it within the html code like:



```
<script type="text/javascript">
// Your javascript goes in here.
</script>
```

The same applies for Cascading Style Sheets (CSS)

External file:



```
<link rel="stylesheet" type="text/css" href="style.css">
```

Internal CSS:



```
<style type="text/css">

</style>
```

----------


## minitech

Um... I already included external/internal scripts/styles, and I think DOCTYPE is a waste.

----------


## Banjo

You didn't include external style sheets. Also if you don't think DOCTYPE is important then you are very silly and also your html wont be valid :P

----------


## minitech

Yes, I did include extrenal style sheets. What do you think the <link> is for?

I believe that the DOCTYPE is useless and that everybody should just use a fixed standard. Go ahead and add it yourself if you want it. I can never remember what it is.

----------


## Atheist

Well, there are standards. Thats why certain HTML is considered "valid", check out the W3C validator.

----------


## minitech

Yeah, but I disagree. Why should you have to include a useless, long and hard to remember tag at the start of your HTML file? Why can't everyone just use XHTML, and browsers can compensate for people that don't? That's what they already do. What I see here is 70 characters of useless data.

----------


## Atheist

Well,




> Rhe doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.
> 
> The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers can render the content correctly.


It doesn't really matter wether you find it worthless or not, because apparently it is not  :Wink:

----------


## minitech

Hm, every page that I write, I test using a 52-browser tester. They all render correctly without the DOCTYPE info. Go ahead and add it, though.

----------


## Banjo

So you would rather your html be invalid than add a DOCTYPE ? If you really don't want to remember it you can always copy and paste it or use the html 5 one:



```
<!doctype html>
```

Either way they didn't make DOCTYPE's for no reason, I also find it hard to believe that it renders the same in all browsers without one. Say if you were writing a bit of html and all you had was _<strong>Text</strong>_ then obviously that wouldn't be the same, but if you were writing a layout with css etc.. then it would render differently.

----------


## Nightwalker83

Yes, if you need proof that doctype is infact needed (although, I am not sure why) check any web design/development software such as DreamWeaver and Expression Web they include the doctype in the page when you first create a html page.

----------


## minitech

Yes, they do. How is that proof it's needed?



> but if you were writing a layout with css etc.. then it would render differently.


Web page that renders the same on all browsers without using the DOCTYPE: http://minitech.webatu.com/
A forum I coded from scratch. It uses CSS, I've tried it personally on Firefox, Chrome, IE, and Epihphany, and on that browser-testing website that lets you test the other 52 browsers across 3 OSes. No change. (Apart from on Dillo, of course.)

----------


## TheBigB

That is because it's a very basic template.

When using a lot of DIV's you often get tangled up in the box modal.
Now the DOCTYPE should trigger correct rendering of that modal. Everything messed up after this is the browsers fault.
Without the DOCTYPE the browser switches to the default rendering which renders your site like it would look like in an early IE or Netscape version.

When you're building a really intricate template DOCTYPE is definitely a must.
It allows you to easily validate the HTML so you can spot mistakes easily and repair them during design.

Now can't we make a standard DOCTYPE? Basically no.
When you look at the future, you might want to consider a whole new approach to rendering for whatever reason. Now you have a different default rendering engine. A DOCTYPE provides full backwards compatibility.

An interesting read.

Now that aside; for some basic javascript testing that template works just fine  :Wink: 
Bookmarked.

----------


## minitech

I give in (edited)  :Smilie: 
I still don't understand what banjo meant about not having external CSS, though...

----------


## Banjo

Yeh sorry I missed that in your code.

----------

