Reputation: 1
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.
Upvotes: 0
Views: 784
Reputation: 2214
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.
Upvotes: 1
Reputation: 1456
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.
Upvotes: 2