HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming...

9
HTML syntax By Ana Drinceanu

Transcript of HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming...

Page 1: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

HTML syntax

By Ana Drinceanu

Page 2: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

Definition:

Syntax refers to the spelling and grammar of a

programming language. Computers are inflexible

machines that understand what you type only if you type

in the exact form that the computer expects. The expected

form is called the syntax.

Page 3: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

HTML uses elements to describe the structure of pages. There are several basic elements that are present in most HTML documents. Each element has an opening and closing tag.

Some examples of these elements are:

<!doctype, <html>, <body>, <p>, <h1>, etc.

The closing tags for these elements are:

</html>, </body>, </p>, </h1>, etc.

Note: !doctype is a special instruction that does not require a closing tag.

Page 4: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

TagsTags are used to delimit the start and end of elements in markup. Elements have a start tag to indicate where they begin. Non-void elements have an end tag to indicate where they end.

Starting tags consist of a “<“ character, the element’s tag name, and a “>” character.

Ending tags consist of a “<“character, a “/” character, the element’s tag name, and a “>” character.

Page 5: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

A doctype (sometimes capitalized as “DOCTYPE”) is a special instruction which, for legacy reasons that have to do with processing models in browsers, is a required part of any document in the HTML syntax.

Example: <!DOCTYPE HTML>

Page 6: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

<head>

The <head> element is a container for all the head elements.The <head> element can include a title for the document, scripts, styles, meta information, and more.The following elements can go inside the <head> element:• <title> (this element is required in an HTML document)• <style>• <base>• <link>• <meta>• <script>• <noscript>

Page 7: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

<body>

• The <body> tag defines the document's body.

• The <body> element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc.

• Included in the <body> element are the <p>, <h1>, <h2>, <h3> <img>, etc.

Page 8: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

HTML Syntax is crucial

part of Web Design.

Computers only

understand a programing

language when syntax is

followed.

Picture: http://sdelaemblog.ru/wp-content/uploads/2013/03/doctype-zachem-on-nuzhen-i-kakoj-vybrat.png

Page 9: HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.

References:

Jon Duckett, HTML & CSS design and build websites

http://www.webopedia.com/TERM/S/syntax.html)

http://www.w3.org/TR/html-markup/syntax.html

http://www.w3schools.com/tags/tag_head.asp

http://www.w3schools.com/tags/tag_body.asp