الاثنين، 18 أغسطس 2014

سمات HTML

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

سمات HTML
HTML Attributes

السمات تزود معلومات إضافية عن عناصر HTML.
Attributes provide additional information about HTML elements.
---------------------------------------------------------
- سمات HTML
* عناصر HTML يمكن أن تتضمن سمات
* السمات تزود معلومات إضافية عن عنصر
* السمات دائماً محدد في وسم البداية
* تأتي السمات على شكل مزدوج اسم/قيمة مثل: name="value"
- HTML Attributes
* HTML elements can have attributes
* Attributes provide additional information about an element
* Attributes are always specified in the start tag
* Attributes come in name/value pairs like: name="value"
---------------------------------------------------------


- مثال عن السمات
يتم تعريف الروابط بالوسم <a>. عنوان الرابط يتم تحديده بـ السمة  href:
مثال
<a href="www.3school.com">This is a link</a>
- Attribute Example
HTML links are defined with the <a> tag. The link address is specified in the href attribute:
Example
<a href="http://www.w3schools.com">This is a link</a>
---------------------------------------------------------
- دائما اقتبس قيم السمة
قيم السمات دائما يجب إغلاقها بعلامات اقتباس.
أسلوب علامات الاقتباس المزدوجة هو الأكثر شيوعاً.
تلميح: في بعض الحالات النادرة، عندما تحتوي قيمة السمة نفسها على علامات اقتباس، من الضروري استعمال علامات اقتباس مفردة: name='Johan "shotGun" Nelson'
- Always Quote Attribute Values
Attribute values should always be enclosed in quotes.
Double style quotes are the most common, but single style quotes are also allowed.
Tip: In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes: name='John "ShotGun" Nelson'
---------------------------------------------------------
- تلميح HTML: استخدام سمات بأحرف صغيرة
أسماء السمات وقيمها هي غير حساسة لحالة الأحرف.
مع ذلك، رابطة شبكة الويب العالمية (W3C) توصي بأحرف صغيرة لقيم السمات في الإصدار الرابع من HTML.
الإصدارات الجديدة من HTML(X) ستطالب بسمات بأحرف صغيرة.
- HTML Tip: Use Lowercase Attributes
Attribute names and attribute values are case-insensitive.
However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation.

Newer versions of (X)HTML will demand lowercase attributes.

---------------------------------------------------------
- سمات اللغة
لغة المستند يمكن تعريفها في الوسم <html>.
اللغة يتم تعريفها في السمة Lang.
تعريف اللغة مهم لتطبيقات الوصول (قارئ الشاشات) ومحراكات البحث
- The lang Attribute
The document language can be declared in the <html> tag.
The language is declared in the lang attribute.
Declaring a language is important for accessibility applications (screen readers) and search engines:

- مثال Example

<!DOCTYPE html>
<html lang="en-US">
<body>
<h1>My First Heading</h1>
<p>My First paragraph</p>
</body>
</html>
---------------------------------------------------------
- سمة الارتباط href
ارتباطات HTML يتم الاعلان عنها بواسطة الوسم <a>. يتم تحديد عنوان الارتباط في الوسم href.
- The href Attribute
HTML links are defined with the <a> tag. The link address is specified in the href attribute:

- مثال Example
<a href=http://www.w3school.com>this is a link</>
---------------------------------------------------------
- سمة العنوان
فقرة HTML يتم تعريفها باستخدام الوسم <p>.
في هذا المثال، العنصر <p> لديه السمة title. القيمة لهذه السمة هي "About W3schools".
- The title Attribute
HTML paragraphs are defined with the <p> tag.
In this example, the <p> element has a title attribute. The value of the attribute is "About W3Schools"

Example
<p title="About W3schools">
W3Schools is a web developer's site.
It provides tutorials and references covering
many aspects of web programming,
including HTML, CSS, JavaScript, XML, SQL, PHP, ASP, etc.
</p>
---------------------------------------------------------
- سمة الحجم
الصور في HTML يتم تعريفها بالوسم <img>.
اسم الملف للمصدر (src)، والحجم للصورة (العرض و الارتفاع) كلها يتم تزويدها كسمات:
- Size Attributes
HTML images are defined with the <img> tag.
The filename of the source (src), and the size of the image (width and height) are all provided as attributes:
Example
<img src="W3schools.jpg" width="104" height="142">
---------------------------------------------------------
- سمة البديل alt
تحدد السمة (بديل alt) نص بديل يمكن استخدامه، عند عدم إمكانية عرض عنصر HTML، قيمة السمة يمكن قراءتها من قبل "قارئات الشاشات"، بهذه الطريقة شخص يستمع إلى صفحة ويب "شخص أعمى" يمكنه سماع العنصر.
The alt Attribute
The alt attribute specifies an alternative text to be used, when an HTML element cannot be displayed.
The value of the attribute can be read by "screen readers". This way, someone "listening" to the webpage, i.e. a blind person, can "hear" the element.

Example
<img src="W3schools.jpg" alt="W3schools.com" width="104" height="142">


ليست هناك تعليقات:

إرسال تعليق