Writing and displaying HTML is done in several ways, for this course we are going to use notepad and would introduce you to the other ways later. You are going to needed two things, note pad and a browser e.g Firefox.
Write HTML Using Notepad.
Web pages can be created and modified by using professional HTML editors. However, for learning HTML we recommend a simple text editor like Notepad (PC) or Textedit (Mac). We believe using a simple text editor is a good way to learn HTML.
Follow the four steps below to create your first web page with Notepad or Textedit.
Step 1: Open Notepad (PC) Windows 8 or later: Open the Start Screen(the window symbol at the bottom left on your screen). Type Notepad.
Windows 7 or earlier: Open Start > Programs >Accessories > Notepad Step
1: Open TextEdit (Mac)OpenFinder > Applications > TextEditAlso change some preferences to get the application to save files correctly.InPreferences > Format >choose “Plain Text”. Then under. “Open and Save”, check the box that says”Ignore rich text commands in HTML files”.Then open a new document to place the code.
Step 2: Write Some HTMLWrite or copy some HTML into Notepad. <!DOCTYPE html> <html> <body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>
Step 3: Save the HTML. On File Menu, Click File , Click Save As. Choose your desire name eg index.html -The actual name of the file is index but the . html is standing as a file extension indicating that it is an HTML file. You can use either .htm or .html as file extension. There is no difference, it is up to you.
Step 4: View the HTML Page in Your Browser. Open the saved HTML file in your favorite browser (double click on the file, or right-click – and choose “Open with”).
HTMLBasic Examples Don’t worry if these examples use tags you have not learned.You will learn about them in the next chapters.HTML DocumentsAll HTML documents must start with a document type declaration:<!DOCTYPE html>.
The HTML document itself begins with<html>and ends with</html>.The visible part of the HTML document is between<body>and</body>.
<!DOCTYPEhtml><html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>