إشترك معنا ليصلك جديد الموقع

بريدك الإلكترونى فى أمان معنا

السبت، 4 أكتوبر 2014

Syntax

Syntax
HTML pages consist of markup tags and plain text. These pages are structured into parts.

Document Structure
An HTML document is structured into three parts:

DOCTYPE
The DOCTYPE indicates what HTML version to use 

HEAD
The HEAD contains mostly non-visual content 

BODY
The BODY contains the visual content of the page 

Within the body of a modern web page, headers, footers, sidebars, navigation menus, main content sections, and individual articles have been marked up by the catch-all <div> element. HTML5 adds new elements to specifically identify each of these common constructs:

section - a part or chapter in a book, a section in a chapter, or essentially anything that has its own heading
header - the page header shown on the page (not the same as the head element)
footer - the page footer where copyright or the fine print goes
nav - a collection of links to other pages
article - an independent entry in a blog, magazine, etc
Syntax
HTML rules, or syntax, govern the way in which code is written. HTML tags are keywords surrounded by angle brackets, e.g. <html>. Most HTML tags come in pairs, the opening tag (<title>) and the closing tag (</title>). The two tags make up an HTML element. As a best practice, all HTML tags should be closed, i.e. have an opening and closing tag.

<tag>content</tag>
In between the HTML tag pairs is the content in plain text, e.g.

<h1>My Heading</h1>
<p>My Paragraph</p>
Be aware that not all HTML tags have closing tags. Some tags, which do not wrap around content will close themselves, e.g. <br />. These are also known asemptyor void tags. To close empty tags, place a forward slash (/) before the final bracket, as shown in the following code sample:

<emptytag />
Required Tags
All HTML documents need to have the <html>, <head>, and <body> tags, along with the <!DOCTYPE> identifier as the first line. At a minimum, HTML pages should include the following elements:

<!DOCTYPE html>
<html>
  <head>
    <title>page title goes here</title>
  </head>
  <body>
    content goes here
  </body>
</html>
The following table lists the required tags and a description of each:

Element Description
<!DOCTYPE> Specifies to the browser which set of standards the document adheres to
<html>
</html> Frames the entire HTML page
<head>
</head> Frames information for the page. Can contain the following tags:
<base>, <link>, <meta>, <object>, <script>, <style>, and <title>.
<body>
</body> Frames the content of the page to be displayed in the browser
<title>
</title> Sets the title of the page (appears at the top of the browser window). The <title> element is contained within <head> element.
Attributes and Values
Many tags have additional aspects that can be customized. These options are called attributes and appear inside the opening tag and their value is always inside quotation marks. The following example shows a tag which contains two attributes:

<tag attribute1="value" attribute2="value">Text</tag>
Attributes always appear inside the opening HTML tag. Multiple attributes may be specified by separating each with a space character.

In addition to the tag specific attributes, there are standard attributes that apply to almost all tags. Refer to the Standard Attributes section for a list of these attributes.

شارك هذه الصفحة وتابعنا على صفحاتنا الرسمية
شارك الموضوع →
تابعنا →
إنشر الموضوع →

0 التعليقات:

إرسال تعليق

افلام اون لاين

 
Related Posts Plugin for WordPress, Blogger...