0% found this document useful (0 votes)
4 views

CSS_Text_Properties_Notes

CSS Text properties

Uploaded by

krishna0001226
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

CSS_Text_Properties_Notes

CSS Text properties

Uploaded by

krishna0001226
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CSS Text Properties - Detailed Notes

1. color

- Sets the color of the text.

- Accepts named colors, hexadecimal values, RGB, RGBA, HSL, or HSLA formats.

2. direction

- Specifies the text direction.

- Values:

- ltr: Left-to-right text direction.

- rtl: Right-to-left text direction.

3. letter-spacing

- Defines the spacing between characters in a text.

- Measured in length units (e.g., px, em).

4. line-height

- Sets the space between lines of text.

- Can be a number (multiplier of font size), length, percentage, or normal.

5. text-align

- Controls the horizontal alignment of text.

- Values:

- left: Aligns text to the left.

- right: Aligns text to the right.

- center: Centers the text.


- justify: Stretches text to align with both margins.

6. text-decoration

- Specifies text decoration (e.g., underline, line-through).

- Common values:

- none: No decoration.

- underline: Underlines the text.

- overline: Adds a line above the text.

- line-through: Adds a strike-through line.

7. text-indent

- Specifies the indentation of the first line of a text block.

- Measured in length or percentage.

8. text-transform

- Controls the capitalization of text.

- Values:

- none: Default capitalization.

- capitalize: Capitalizes the first letter of each word.

- uppercase: Converts all characters to uppercase.

- lowercase: Converts all characters to lowercase.

9. unicode-bidi

- Controls how text is handled when using bidirectional languages (like Arabic or Hebrew).

- Common values:

- normal: Default behavior.

- embed: Embeds text in the specified direction.


- bidi-override: Overrides text directionality.

10. vertical-align

- Aligns an inline element relative to its parent element's baseline.

- Common values:

- baseline: Default alignment.

- top, middle, bottom: Align text to the top, middle, or bottom.

- sub, super: Aligns text as subscript or superscript.

11. white-space

- Controls how whitespace is handled.

- Values:

- normal: Collapses multiple spaces and wraps text.

- nowrap: Prevents wrapping and collapses spaces.

- pre: Preserves whitespace and line breaks.

- pre-line: Collapses spaces but preserves line breaks.

- pre-wrap: Preserves both spaces and line breaks.

12. word-spacing

- Sets the space between words.

- Measured in length units.

13. writing-mode

- Defines whether text is laid out horizontally or vertically and the direction of flow.

- Values:

- horizontal-tb: Horizontal text, top-to-bottom.

- vertical-rl: Vertical text, right-to-left.


- vertical-lr: Vertical text, left-to-right.

14. overflow-wrap

- Specifies whether a word should break onto the next line if it overflows the container.

- Values:

- normal: Breaks only at allowed points.

- break-word: Breaks within a word if necessary.

15. word-break

- Specifies how words should break when reaching the end of a line.

- Values:

- normal: Breaks according to language rules.

- break-all: Breaks words at any character.

- keep-all: Prevents breaking within words for CJK scripts.

16. text-shadow

- Adds shadow to text.

- Accepts offsets, blur radius, and color.

17. clip-path (For text containers)

- Clips the text to a specific shape or path.

- Used to create advanced text effects.

18. font-variant

- Controls the use of small-caps and other typographic features.

- Values:

- normal: Default font style.


- small-caps: Converts lowercase text to uppercase while maintaining smaller font size.

You might also like