Understanding HTML Syntax and Rules
http://www.w3schools.com/html/html_intro.asp

The HTML language is simple language for describing Web page content. HTML stands for Hyper Text Markup Language. HTML is not a programming language, it is a markup language. A markup language is a set of markup tags to describe web pages. HTML rules, called syntax, govern the way in which code is written. Learning the right way to write your code can save you confusion and errors later.

Below are other resource links:

HTML Getting Started at w3schools.com

How to Plan Building your Web Site?

Syntax Rules Reminders:

  1. Writing HTML
  2. Elements
  3. Attributes and Values
  4. Entities
  5. Avoid Syntax Errors

1. Writing HTML

The instructions you write in HTML are called tags. Tags are surrounded by angle brackets < >. You can write tags in upper or lower case. Many users prefer to write their tags in uppercase to make them easier to identify on the document page. If you create a page in XHTML, a stricter variation of HTML, you need to use lowercase letters for your tags.


2. Elements

Elements identify the different parts of your HTML document. For example, <BODY> and </BODY> are tags defining the body text element on a page. The browser reads any text between the two tags as part of the body element. Many elements use tag pairs, an opening and closing tag, such as < P>and < /P>, while others, such as the Image tag < IMG> do not. Closing tags must always include a slash (/).< /P>

3. Attributes and Values

Each element has unique attributes you can assign. Many attributes require that you set a value, such as a measurement or specification. For example, you can set a paragraph’s alignment on the page use the ALIGN attribute and set a value for the alignment by specifying the value as left, right or center. < P ALIGN=“center”>My paragraph text.< /P>. Values are always enclosed in quotation marks and appear within the element’s start tag. /P>

4. Entities

Any special characters you add to a page, such as a copyright symbol or a fraction, are called entities. HTML use entities to represent characters not readily available on the keyboard. All entities are preceded with an ampersand (&) and ended with a semicolon (;). For example, to add a copyright symbol to your page, the code looks like this: ©.


5. Avoid Syntax Errors

Image of error.gif

To avoid HTML erros, always take time to proofread your code. Make sure you have brackets on your tags and that your closing tags include a slash. You must surround any values you define for attributes with quotation marks. It also helps to write your closing tags in reverse order of the opening tags. For example: <P ALIGN=“center”> <B> My Text </B></P>. To help make your HTML readable, consider using new lines to enter code instead of running everything together on one long line. Using white space can also help, without increasing the file size.

Go to Top