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 in that using a simple text editor is a good way to learn HTML.
Follow the steps below to create your first web page with Notepad or TextEdit.
p {
color: red;
text-align: center;
}
HTML elements can be nested (this means that elements can contain other elements).
All HTML documents consist of nested HTML elements.
The following example contains four HTML elements (html, body, h1 and p)
The body element defines the document's body.
It has a start tag body and an end tag (/body).
function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");
HTML Display
You cannot be sure how HTML will be displayed.
Large or small screens, and resized windows will create different results.
With HTML, you cannot change the display by adding extra spaces or extra lines in your HTML code.
The browser will automatically remove any extra spaces and lines when the page is displayed
function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");
The HTML Style Attribute
Setting the style of an HTML element, can be done with the style attribute.
The CSS background-color property defines the background color for an HTML element.
function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");