The first HTML page
The first page is one file. Name it index.html. The browser opens it by itself. You do not need a framework, a library, or a site builder first.
Three places stand inside the file. html holds all of it. head keeps the name of the page. body is what the person sees. Put the visible text inside body.
Save the file and press it twice. The browser opens. If the text shows, the page is ready. Color and layout come later. That is CSS.
- Save the file on the desktop so you can find it.
<h1>Hello</h1>is a heading.<p>This is the first page.</p>is a paragraph.- The file must end in
.html. A.txtfile opens as code in the browser. - If a picture sits in the same folder,
imgpoints at its name. - You can put a button. It needs JavaScript before it does work.
- Do not copy a ready template. Write these three lines yourself first.
If the page does not open, look at the end of the file name. If it is not .html, the browser does not treat it as a page.