Creating your first HTML document is one of the most satisfying moments for any new web designer. Here’s how to do it in 60 seconds!
Your First HTML Document
Begin by creating a new file and name it “index.html”. Open the file in a plain text editor like Notepad or ideally a code editor like Sublime Text.
On the first line add this doctype code.
<!DOCTYPE html>
Now add opening and closing HTML tags, like this:
<!DOCTYPE html> <html> </html>
The forward slash indicates a closing tag. Now add a head section with <head>
tags:
<!DOCTYPE html> <html> <head> </head> </html>
These head tags are going to contain meta data about our document.
Now add a body section with <body>
tags:
<!DOCTYPE html> <html> <head> </head> <body> </body> </html>
These tags are going to hold what gets displayed in the browser window. Now in the head add <title>
tags and type “My First HTML Document” inside them.
<!DOCTYPE html> <html> <head> <title>My First HTML Document</title> </head> <body> </body> </html>
In the body add <p>
tags and type “This is a paragraph” inside.
<!DOCTYPE html> <html> <head> <title>My First HTML Document</title> </head> <body> <p>This is a paragraph.</p> </body> </html>
Now go to a browser, open your file, and check out what you’ve just made!
Further Reading
Learn more about HTML on Envato Tuts+.
Comments