[HTML] It's actually just a template.
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.
HTML Code:
<!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>
Re: [HTML] It's actually just a template.
You should really have a doctype included and meta tags. Something like this would be better:
HTML Code:
<!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:
HTML Code:
<script type="text/javascript" src="externalJS.js"></script>
or have it within the html code like:
HTML Code:
<script type="text/javascript">
// Your javascript goes in here.
</script>
The same applies for Cascading Style Sheets (CSS)
External file:
HTML Code:
<link rel="stylesheet" type="text/css" href="style.css">
Internal CSS:
HTML Code:
<style type="text/css">
</style>
Re: [HTML] It's actually just a template.
Um... I already included external/internal scripts/styles, and I think DOCTYPE is a waste.
Re: [HTML] It's actually just a template.
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
Re: [HTML] It's actually just a template.
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.
Re: [HTML] It's actually just a template.
Well, there are standards. Thats why certain HTML is considered "valid", check out the W3C validator.
Re: [HTML] It's actually just a template.
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.
Re: [HTML] It's actually just a template.
Well,
Quote:
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 ;)
Re: [HTML] It's actually just a template.
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.
Re: [HTML] It's actually just a template.
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:
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.
Re: [HTML] It's actually just a template.
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.
Re: [HTML] It's actually just a template.
Yes, they do. How is that proof it's needed?
Quote:
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.)
Re: [HTML] It's actually just a template.
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 ;)
Bookmarked.
Re: [HTML] It's actually just a template.
I give in (edited) :)
I still don't understand what banjo meant about not having external CSS, though...
Re: [HTML] It's actually just a template.
Yeh sorry I missed that in your code.