Professional Documents
Culture Documents
CSS Part 1
CSS Part 1
• Describes how information is to be displayed, not what is being displayed وليس ما، • يصف كيفية عرض المعلومات:Commented [s2]
يتم عرضه
• Can be embedded in an HTML document or placed into a separate .css file أو وضعهاHTML • يمكن تضمينها في مستند:Commented [s3]
منفصلcss. في ملف
Basic CSS rule syntax
• A CSS file consists of one or more rules من قاعدة واحدة أو أكثرCSS • يتكون ملف:Commented [s4]
• A selector specifies an HTML element(s) and then applies style properties to them ثمHTML ) • يحدد المحدد عنصر (عناصر:Commented [s6]
يطبق خصائص النمط عليها
- a selector of * selects all elements
Attaching a CSS file <link>
• A page can link to multiple style sheet files • يمكن أن ترتبط الصفحة بملفات متعددة لورقة:Commented [s7]
األنماط
- In case of a conflict (two sheets define a style for the same HTML element), the properties of the
latter sheets will be used ً في حالة وجود تعارض (تحدد ورقتان نم- :Commented [s8]
طا
سيتم استخدام خصائص األوراق األخيرة، )HTML لنفس عنصر
Embedding style sheets: <style>
• CSS code can be embedded within the head of an HTML page داخل رأس صفحةCSS • يمكن تضمين كود:Commented [s9]
HTML
• Bad style and should be avoided • أسلوب سيء ويجب تجنبه:Commented [s10]
• Higher precedence than embedded or linked styles • أسبقية أعلى من األنماط المضمنة أو:Commented [s11]
المرتبطة
• Used for one-time overrides and styling a particular element • تستخدم لمرة واحدة للتخطي وتصميم:Commented [s12]
عنصر معين
• Bad style and should be avoided • أسلوب سيء ويجب تجنبه:Commented [s13]
• color names: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red,
silver, teal, white (white), yellow ، أزرق، أسود، أكوا: • أسماء األلوان:Commented [s14]
، زيتوني، بحري، كستنائي، ليموني، أخضر، رمادي، فوشيا
• RGB codes: red, green, and blue values from O (none) to 255 (full) أصفر، ) أبيض (أبيض، أزرق مخضر، فضي، أحمر، أرجواني
قيم حمراء وخضراء وزرقاء:RGB • رموز:Commented [s15]
• hex codes: RGB values in base-16 from OO (0, none) to FF (255, full) ) (ممتلئ255 (بال) إلىO من
16 في األساسRGB قيم: • الرموز السداسية:Commented [s16]
) ممتلئ، 255( FF ال شيء) إلى، 0( OO من
Grouping styles
• A style can select multiple elements separated by commas • يمكن للنمط تحديد عدة عناصر مفصولة:Commented [s17]
بفواصل
• The individual elements can also have their own styles • يمكن أن يكون للعناصر الفردية أيضًا:Commented [s18]
أنماطها الخاصة
CSS comments /*...*/
• CSS (like HTML) is usually not commented as rigorously as programming languages such
as Java )HTML (مثلCSS • ال يتم عادة ً التعليق على:Commented [s19]
Java بشكل صارم مثل لغات البرمجة مثل
• The // single-line comment style is NOT supported in CSS نمط التعليق أحادي السطر في// • ال يتم دعم:Commented [s20]
CSS
• The <!-- ... --> HTML comment style is also NOT supported in CSS غيرHTML >- ... - !< • نمط التعليق:Commented [s21]
CSS مدعوم أيضًا في
font-family
• Enclose multi-word font names in quotes • إحاطة أسماء الخطوط متعددة الكلمات بين:Commented [s22]
عالمتي اقتباس
More about font-family
• We can specify multiple fonts from highest to lowest priority • يمكننا تحديد خطوط متعددة من أعلى إلى:Commented [s23]
أدنى أولوية
• Generic font names:
- serif, sans-serif, cursive, FANTASY, monospace
• If the first font is not found on the user's computer, the next is tried • إذا لم يتم العثور على الخط األول على:Commented [s24]
تتم تجربة الخط التالي، كمبيوتر المستخدم
• Placing a generic font name at the end of your font-family value ensures that every
computer will use a valid font • يضمن وضع اسم خط عام في نهاية قيمة:Commented [s25]
ً مجموعة الخطوط أن يستخدم كل جهاز كمبيوتر خ
طا صالحًا
font-size
font-weight, font-style
• Either of the above can be set to normal to turn them off (e.g. headings) • يمكن ضبط أي مما سبق على الوضع:Commented [s29]
) العناوين، العادي إليقاف تشغيلهما (على سبيل المثال
CSS properties for text
text-align
• text-align can be left, right, center, or justify • يمكن محاذاة النص إلى اليسار أو اليمين أو:Commented [s30]
الوسط أو ضبط
text-decoration
• Possible values:
i. none: No marker
ii, disc (default), circle, square
ili, Decimal: 1, 2, 3, etc.
iv. decimal-leading-zero: 01, 02, 03, etc.
v. Lower-roman: i, ii, iii, iv, v, etc.
vi. upper-roman: I, II, III, IV, V, etc.
vii. Lower alpha: a, b, c, d, e, etc.
viii. upper alpha: A, B, C, D, E, etc.
x. lower-Greek: alpha, beta, gamma, etc.
others: Hebrew, Armenian, Georgian, cik-ideographic, hiragana...
Body styles
• Applies a style to the entire body of your page • تطبيق نمط على النص األساسي لصفحتك:Commented [s31]
بالكامل
• Saves you from manually applying a style to each element • يحميك من تطبيق نمط يدويًا على كل:Commented [s32]
عنصر
Inheriting styles
• when multiple styles apply to an element, they are inherited • عندما يتم تطبيق أنماط متعددة على عنصر:Commented [s33]
فإنها موروثة،
• a more tightly matching rule can override a more general inherited rule • يمكن أن تتجاوز قاعدة المطابقة األكثر:Commented [s34]
إحكا ًما قاعدة موروثة أكثر عمومية
Styles that conflict
• when two styles set conflicting values for the same property, the latter style takes
precedence • عندما يعين نمطين قي ًما متعارضة لنفس:Commented [s35]
يكون للنمط األخير األسبقية، الخاصية
background-image
• background image/color fills the element's content area لون يمأل منطقة محتوى/ • صورة الخلفية:Commented [s36]
العنصر
background-repeat
• can be repeat (default), repeat-x, repeat-y, or no-repeat ، x تكرار، ) • يمكن التكرار (افتراضي:Commented [s37]
أو عدم التكرار، y تكرار
background-position
• value consists of two tokens, each of which can be top, left, right, bottom, center, a
percentage, or a length value in px, pt, etc. يمكن أن، • تتكون القيمة من رمزين مميزين:Commented [s38]
أو، أو مركز، أو أسفل، أو يمين، أو يسار، يكون كل منهما أعلى
• value can be negative to shift left/up by a given amount . وما إلى ذلك، أو نقطة، أو قيمة طول بوحدة بكسل، نسبة مئوية
• يمكن أن تكون القيمة سالبة لإلزاحة لليسار:Commented [s39]
ألعلى بمقدار معين/
Aside: Favorites icon (“favicon”}
• The link tag, placed in the HTML page's head section, can specify an icon • يمكن أن تحدد عالمة االرتباط الموضوعة:Commented [s40]
رمزً اHTML في قسم رأس صفحة
- this icon will be placed in the browser title bar and bookmark /favorite سيتم وضع هذا الرمز في شريط عنوان- :Commented [s41]
المفضلة/ المتصفح واإلشارة المرجعية