To create an HTML page and view it, we will use your pre-installed programs, such as a text editor and a browser.
- First step: you need to create a file "index.html" with the ".html" extension. To do this, use this instruction to enable file extensions:
MacOS https://support.apple.com/guide/mac-help/show-or-hide-filename-extensions-on-mac-mchlp2304/mac
Create a file: index.html
- The second step is to place this code in an index.html file. To do this, open your index.html file in a text editor or in a code editor, copy this code, paste it into the editor, and save the changes or save file (or save as "index.html").
code:
<!DOCTYPE html>
<html>
<head>
<title>This is a title</title>
</head>
<body>
<p>Hello world!</p>
</body>
</html>
- Done. Open your index.html file in a browser, such as Chrome, Firefox, Edge, or Safari, to see the result.
Sources:
- HTML - Wikipedia - https://en.wikipedia.org/wiki/HTML
- Windows file extension - https://stackoverflow.com/a/71899738/22625440
- MacOS file extension - https://support.apple.com/guide/mac-help/show-or-hide-filename-extensions-on-mac-mchlp2304/mac
Top comments (0)