I'm trying to create a very basic HTML code in GitHub and I'm curious if I even need to include a !DOCTYPE html tag? I'd like to add some CSS eventually and I'm curious what the best course of action is here. Thank you very much for any assistance you can provide.
-
1What are you trying to do? What do you mean by 'include a tag'? – Msonic May 05 '15 at 19:29
-
I think I made an improper statement here referring to DOCTYPE as a tag. I'm trying to create a very simple HTML web page for personal use initially and then hope to add some basic CSS for styling. I've tried using but, when I commit the code the text appears on my page. I'm the rookiest of rookies trying to learn on my own so I really appreciate your help. – Sacha May 05 '15 at 19:52
2 Answers
There are plenty of resources online when you search for 'html beginner tutorials'. Like this one. Or this one. Stackoverflow is not a tutorial site, you should ask more specific questions here.
I will briefly answer your question though. Here's a very basic structure of a html website.
<!DOCTYPE html>
<html>
<head>
<title>This is my website title</title>
</head>
<body>
<h1>This is my content in a heading</h1>
</body>
</html>
Briefly, the Doctype tells the browser how to parse the content. Here's more info if you want to learn more about it.
In the 'head' tag, you put everything that describes your page, like the title, the links to the css, your meta tags, etc.
In the body tag, you put your content, what you want displayed.
As Msonic stated, The DOCTYPE
declaration tells the browser how to parse the content.
Which DOCTYPE
declaration you would use depends on what you are trying to do.
Strict - usually used with css, especially when the css is in a separate stylesheet
Transitional - when those features are included in the document and not in a css stylesheet
Frameset - used when a page contains frames.

- 2,214
- 2
- 23
- 47