‏הצגת רשומות עם תוויות font. הצג את כל הרשומות
‏הצגת רשומות עם תוויות font. הצג את כל הרשומות

יום שני, 13 באפריל 2009

6.1 Font-family

סוג הגופן: רשימה של סוגי גופנים מופרדים בפסיקים. רושמים מספר גופנים מפני שלא בכל מחשב מותקנים כל הגופנים. 
הדפדפן משתמש בגופן הראשון מתוך הגופנים המותקנים במחשב הלקוח. אם אף אחד מהגופנים המבוקשים לא קיים, ישתמש הדפדפן בגופן ברירת המחדל של הדפדפן. מסיבה זו, כדאי לבדוק את תצוגת הדף עם מספר פונטים רבים ככל האפשר ולמצוא ולכתוב לפי סדר את המתאימים ביותר. 
כמובן שגופנים המכונים בשם בעל יותר ממילה אחת חייבים להיות מוקפים במרכאות(או גרשיים).
ישנם שני סוגי ערכים למאפיין זה:
family-name: השם של הגופן (כמו "arial", "times" , "courier" וכו')
generic-family: השם של המשפחה הגנרית של הגופן (כמו "serif", "sans-serif", "cursive", "fantasy", "monospace" וכו').

<p style="font-family:'times New Roman', Arial, verdana, 'sans serif';">

► הקודם  הבא  ◄



6.2 font-size

את גודל הפונט אפשר להגדיר באופן אבסולוטי או יחסי.

Td{font-size:16pt;}
Td{font-size:150%;}
Td{font-size:medium;}
Td{font-size:+2pt;}
Td{font-size:larger;}
צורת הכיתוב הראשונה, נמצאת בשימוש נפוץ, וקובעת את גודל האותיות לקבוע מסויים. הצורה השניה גם היא קבועה ל1.5 מגודל הגופן שנקבע כברירת מחדל.
הדוגמה השלישית מתייחסת לגודל קבוע שנקבע ע"י הדפדפן וניתן להשתמש בו באחד מהערכים הבאים: xx-small, x-small, small, medium, large, x-large, וכן xx-large. אלו מותאמים לגדלי הכותרות הנפוצים.<7-1H>.
הצורה הרביעית היא הגדלה של הפונט העכשוי בשני פיקסלים, ואילו הצורה האחרונה, נותנת את הגודל הבא אחרי הגודל הקיים (אם הוגדר small, יקבל האלמנט גודל של medium).

Description

Value

Sets the size of the font to different sizes, from xx-small to xx-large.

Default value: medium

xx-small
x-small
small
medium
large
x-large
xx-large

Sets the font-size to a smaller size than the parent element

smaller

Sets the font-size to a larger size than the parent element

larger

Sets the font-size to a fixed size

length

Sets the font-size to a % of the parent element

%


► הקודם  הבא  ◄

6.3 font-style

יכולה לקבל אחד משלושה ערכים: italic, oblique, normal.
Normal הינו כתב רגיל ואילו בין שני האחרים קשה להבדיל, שניהם נטויים. 

body {font-style: italic} 

Description

Value

Default. The browser displays a normal font

normal

The browser displays an italic font

italic

The browser displays an oblique font

oblique


► הקודם  הבא  ◄

6.4 Font-weight

font-weight הוא מאפיין המאפשר לעבות את האותיות.
ערך ברירת המחדל הוא normal אולם ניתן לתת את הערך bold כדי לקבוע אות עבה או להשתמש בערכים היחסיים bolder או lighter באופן יחסי לאלמנט ההורה.
במקום מילים, אפשר להשתמש במספרים: 100 הוא העדין ביותר, 900 הוא המודגש ביותר. 400 הוא הערך הרגיל, ו-700 הוא הערך הקבוע בדפדפנים כ-bold.

p {font-weight: bold}


Description

Value

Default. Defines normal characters

normal

Defines thick characters

bold

Defines thicker characters

bolder

Defines lighter characters

lighter

Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold

100
200
300
400
500
600
700
800
900



► הקודם  הבא  ◄


6.5 Line-height

גובה שורת האותיות, המיוצגת באמצעות מידת אורך כמוזכר להלן. לתכונה זו אפשר לתת ערכים מספריים, אחוזים, או יחסיים (2pt+). 

p {line-height: 1.4}
p {line-height: 14pt} 
p {line-height: 140%}

Value

Description

normal

Default. Sets a reasonable distance between lines

number

Sets a number that will be multiplied with the current font-size to set the distance between the lines

length

Sets a fixed distance between the lines

%

Sets a distance between the lines in % of the current font size


► הקודם  הבא  ◄

6.6 font-variant

נתמכת רק על ידי אקספלורר ויכולה לקבל שני ערכים: normal ו- small-caps. האפשרות האחרונה הופכת את האותיות הכתובות לאותיות גדולות (מa לA).

p {font-variant: small-caps}

Value

Description

normal

Default. The browser displays a normal font

small-caps

The browser displays a small-caps font


► הקודם  הבא  ◄



6.7 font-stretch

מאפיין נוסף ופחות מוכר (משום שרוב הדפדפנים אינם תומכים בו עדיין) היא font-stretch. מאפיין זה מאפשר להציג את האותיות מכווצות או רחבות לפי בחירתך. 
ניתן להשתמש  בערכים:
  • Ultra-condensed
  • extra-condensed
  • condensed
  • semi-condensed
  • semi-expanded
  • expanded
  • extra-expanded
  • ultra-expanded

Font-size-adjust היא תכונה המעניקה פרופורציה שונה של יחסי רוחב/גובה לאותיות. 

h2 {font-stretch: ultra-condensed}

כדי לעשות זאת באופן חסכוני יותר אפשר להשתמש בתכונה font כך:

P{font: bold 14pt/16pt Arial,verdana,'sans serif'}

סדר כתיבת הדברים מאוד חשוב: ראשית יש לציין את הערכים - style, weight, variant . שנית באים font-size וכן line-height, מופרדים בקו נטוי (slash) /. לבסוף רשימת סוגי הגופן הרצויים. מבין כל התכונות גודל הגופן (font-size) וכן משפחות הגופן (font-family) חייבים להיות בהגדרת תכונות font.

P{font:12pt 'times new roman',serif, Paris;}  
Em{font:italic bolder +6pt/+10pt Courier,Monospace;}
גם הגדרות אלה יתקבלו ויתבצעו.

Value

Description

normal

Default. Sets the scale of condensation or expansion  to normal

wider

Sets the scale of expansion to the next expanded value

narrower

Sets the scale of condensation to the next condensed value

ultra-condensed
extra-condensed
condensed
semi-condensed
semi-expanded
expanded
extra-expanded
ultra-expanded

Sets the scale of condensation or expansion of the font-family. "ultra-condensed" is the most condensed (narrowest) value, and "ultra-expanded" is the most expanded (widest) value




► הקודם  הבא  ◄


8.1 סגנונות לטקסט - מבוא

המאפיינים לטקטס ב- CSS מאפשרים לך לשלוט בצורת הצגתו של טקסט בדפדפן.
מאפייני הסגנון של טקסט מאפשרים לשנות צבע בטקסט, לשנות מרווחים בין תווים, ליישר טקסט, לאתר טקסט, להזיח את השורה הראשונה של הטקסט פנימה ועוד.

הטבלה הבאה תציג את המאפיינים העיקריים ואת תמיכת הדפדפנים בכל מאפיין (IE=אקספלורר, F=פיירפוקס, N=נטסקייפ). המספרים בעמודות הדפדפן, מציינים את הגירסה הראשונה התומכת של הדפדפן.

Property

Description

Values

דפדפן

IE

F

N

color

Sets the color of a text

color

3

1

4

direction

Sets the text direction

ltr
rtl

6

1

6

line-height

Sets the distance between lines

normal
number
length
%

4

1

4

letter-spacing

Increase or decrease the space between characters

normal
length

4

1

6

text-align

Aligns the text in an element

left
right
center
justify

4

1

4

text-decoration

Adds decoration to text

none
underline
overline
line-through
blink

4

1

4

text-indent

Indents the first line of text in an element

length
%

4

1

4

text-transform

Controls the letters in an element

none
capitalize
uppercase
lowercase

4

1

4

white-space

Sets how white space inside an element is handled

normal
pre
nowrap

5

1

4

word-spacing

Increase or decrease the space between words

normal
length

6

1

6

text-shadow

 

none
color
length

 

 

 

unicode-bidi

 

normal
embed
bidi-override

5

 

 



► הקודם  הבא  ◄

8.2 Letter-spacing

תכונות טקסט מגדירות כיצד טקסט ממוקם בדף וכיצד הוא מוגש למשתמש.
Letter-spacing מוסיפה רווחים בין האותיות בדף. זו תכונה שימושית במיוחד כאשר רוצים להדגיש חלקי טקסטים חשובים. 

p {letter-spacing: 12px}
p {letter-spacing: -0.5px}  

Value

Description

normal

Default. Defines normal space between characters

length

Defines a fixed space between characters


► הקודם  הבא  ◄