Professional Documents
Culture Documents
CSS Part 2
CSS Part 2
HTML id attribute
• Each ID must be unique; can only be used once on the page • يجب أن يكون كل معرّ ف فريدًا ؛ يمكن:Commented [s2]
استخدامها مرة واحدة فقط في الصفحة
• Link target can include an ID at the end, preceded by a # • يمكن أن يتضمن هدف االرتباط معرّ فًا في:Commented [s3]
# مسبوقًا بعالمة، النهاية
• Browser will load that page and scroll to the element with the given ID • سيقوم المستعرض بتحميل تلك الصفحة:Commented [s4]
والتمرير إلى العنصر بالمعرف المحدد
CSS ID selectors
• Applies style only to the paragraph that has the ID of mission • يطبق النمط فقط على الفقرة التي تحتوي:Commented [s5]
على معرف المهمة
• A way to group some elements and give a style to only that group • طريقة لتجميع بعض العناصر وإعطاء نمط:Commented [s6]
لتلك المجموعة فقط
• Unlike an id, a class can be reused as much as you like on the page يمكن إعادة استخدام، • على عكس المعرف:Commented [s7]
فئة بقدر ما تريد على الصفحة
CSS class selectors
CSS ID selectors
• Tag used to indicate a logical section or area of a page • العالمة المستخدمة لإلشارة إلى قسم منطقي:Commented [s14]
أو منطقة من الصفحة
• Has no appearance by default, but you can apply styles to it ولكن يمكنك، • ليس له مظهر افتراضيًا:Commented [s15]
تطبيق األنماط عليه
• applies the given properties to selector2 only if it is inside a selector1 on the page selector2 • يطبق الخصائص المحددة على:Commented [s17]
على الصفحةselector1 فقط إذا كان داخل
• applies the given properties to selector2 only if it is directly inside a selector1 on the
page selector2 • يطبق الخصائص المحددة على:Commented [s18]
مباشرة على الصفحةselector1 فقط إذا كان داخل
Context selector example
• each side's border properties can be set individually • يمكن تعيين خصائص حدود كل جانب على:Commented [s20]
حدة
• if you omit some properties, they receive default فإنها تتلقى، • إذا حذفت بعض الخصائص:Commented [s21]
بشكل افتراضي
CSS properties for padding
Padding example 1
Padding example 2
• each side's padding can be set individually • يمكن ضبط حشوة كل جانب على حدة:Commented [s22]
• notice that padding shares the background color of the element • الحظ أن الحشو يشترك في لون خلفية:Commented [s23]
العنصر
CSS properties for margins
Margin Example 1
• notice that margins are always transparent • الحظ أن الهوامش شفافة دائ ًما:Commented [s24]
Margin Example 2
• each side's margin can be set individually • يمكن تحديد هامش كل جانب على حدة:Commented [s25]
• works best if the width is set (otherwise, may occupy the entire width of the page) • يعمل بشكل أفضل إذا تم تعيين العرض:Commented [s26]
)(وإال فقد يشغل عرض الصفحة بالكامل
• to center inline elements within a block element, use text-align: center; • لتوسيط العناصر المضمنة داخل عنصر:Commented [s27]
مركز ؛: استخدم محاذاة النص، كتلة