الجمعة، 15 أغسطس 2014

عناصر HTML

المشاركة رقم:54
سلسلة احتراف برمجة صفحات الويب  Web Pages Programming Tutorial
إتش تي إم إل 5  HTML5 
_________________________________
منقول ومترجم للعربية من Moved and Translated to Arabic From
http://www.w3schools.com

عناصر HTML
HTML Elements

- عناصر HTML
عناصر HTML تكتب باستخدام وسم البداية و وسم النهاية والمحتويات تكون بينهما
عنصر HTML هو كل شيء من وسم البداية إلى وسم النهاية
بعض عناصر HTML ليس لها وسم نهاية

- HTML Elements
HTML elements are written with a start tag, with an end tag, with the content in between:
<tagname>content</tagname>
The HTML element is everything from the start tag to the end tag:
<p>My first paragraph.</p>

Some HTML elements do not have an end tag.



---------------------------------------------------------
- وسم البداية غالبا ما يقال عنه.
وسم الفتح
 - The start tag is often called the. 
opening tag
---------------------------------------------------------
- وسم النهاية غالبا ما يقال عنه.
وسم النهاية
- The end tag is often called the. 
closing tag
---------------------------------------------------------

- تركيب عناصر HTML
* عنصر HTML يبدأ بـ وسم البداية / وسم الفتح
* عصر HTML ينتهي بـ وسم النهاية / وسم الإغلاق
* محتويات العنصر هو كل شيء بين وسم البداية و وسم النهاية
* بعض عناصر HTML يكون لها محتوى فارغ
* العناصر الفارغة مغلقة في وسم البداية
* معظم عناصر HTML لها سمات
- HTML Element Syntax
* An HTML element starts with a start tag / opening tag
* An HTML element ends with an end tag / closing tag
* The element content is everything between the start and the end tag
* Some HTML elements have empty content
* Empty elements are closed in the start tag
* Most HTML elements can have attributes
---------------------------------------------------------
- عناصر HTML المتداخلة
معظم عناصر HTML يمكن أن تكون متداخلة (يمكن أن تحتوي على عنصر HTML آخر(.
مستندات HTML تتألف من عناصر HTML متداخلة.
- Nested HTML Elements
Most HTML elements can be nested (can contain other HTML elements).
HTML documents consist of nested HTML elements.
---------------------------------------------------------
- مثال مستند إتش تي إم إل HTML Document Example

<!DOCTYPE html>
<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>
---------------------------------------------------------
- المثال في الأعلى يتألف من:
3 عناصر HTML.
- The example above contains.
3 HTML elements.
---------------------------------------------------------
- توضيح المثال:
العنصر <p>:
<p>This is my first paragraph.</p>

العنصر <p> يُعرف الفقرة في مستند الـ HTML.
العنصر بدأ بـ الوسم  <p> وانتهى بالوسم </p>.
محتويات العنصر هي: This is my first paragraph.

العنصر <body>:
<body>
<p>this is my first paragraph.</p>
</body>

العنصر <body> يعرف الجسم body الخاص بـمستند HTML.
العنصر بدأ بـ بالوسم <body> انتهى بالوسم </body>.
العنصر يحتوي على عنصر HTML آخر ( العنصر p).

العنصر <html>:
<html>
<body>
<p>this my first paragraph.</p>
</body>
</html>

العنصر <html> يُعرف كامل مستند HTML.
العنصر بدأ بالوسم <html> انتهى بالوسم </html>.
العنصر يحتوي على عنصر HTML   آخر ( العنصر body).
- HTML Example Explained

The <p> element:
<p>This is my first paragraph.</p>

The <p> element defines a paragraph in the HTML document.
The element has a start tag <p> and an end tag </p>.
The element content is: This is my first paragraph.

The <body> element:
<body>
<p>This is my first paragraph.</p>
</body>

The <body> element defines the body of the HTML document.
The element has a start tag <body> and an end tag </body>.
The element content is another HTML element (a p element).

The <html> element:
<html>
<body>
<p>This is my first paragraph.</p>
</body>
</html>

The <html> element defines the whole HTML document.
The element has a start tag <html> and an end tag </html>.
The element content is another HTML element (the body element).
---------------------------------------------------------
- لا تنسى وسم النهاية
بعض عناصر HTML يتم عرضها بشكل صحيح حتى لو نسيت وسم النهاية:
<p>This is a paragraph
<p>This is a paragraph
المثال في الأعلى يعمل على أغلب المتصفحات، لأن وسم النهاية يعتبر اختياري.
لا تعتمد على هذا. العديد من عناصر HTML ستنتج نتائج غير متوقعة و/أو أخطاء إذا نسيت وسم النهاية.  
- Don't Forget the End Tag
Some HTML elements might display correctly even if you forget the end tag:
<p>This is a paragraph
<p>This is a paragraph
The example above works in most browsers, because the closing tag is considered optional.
Never rely on this. Many HTML elements will produce unexpected results and/or errors if you forget the end tag .
---------------------------------------------------------
- عناصر HTML الفارغة
عناصر HTML من غير محتويات تُسمى عناصر فارغة.
<br> هو عنصر فارغ من غير وسم إغلاق ( الوسم <br> يُعرف على انه فاصل اسطر)
تلميح: في XHTML، يجب أن تكون كل العناصر مغلقة. إضافة خط مائل في وسم البداية، مثل <br />، هي الطريقة المناسبة لإغلاق العناصر الفارغة في XHTML ( و XML).
- Empty HTML Elements
HTML elements with no content are called empty elements.
<br> is an empty element without a closing tag (the <br> tag defines a line break).

Tip: In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br />, is the proper way of closing empty elements in XHTML (and XML).

هناك تعليق واحد: