The following text codes are the ones that start with the word "text". For example,
To do things like change font, set it to bold or italics etc, see these font codes.
text-align
, text-indent
, text-shadow
etc. To change the font, see the font codes.Aligning Text
Use the CSStext-align
property to align your text (or any other inline element of a block-level element):Source Code | Result |
---|---|
Left
Center
Right
|
Decorating Text
Below are examples of the CSStext-decoration
property for:Source Code | Result |
---|---|
Link with no underline...
Normal text with underline
Text with a line through the middle
Text with an overline
Blinking text (doesn't work on all browsers)
|
Indenting Text
Indent the first line of text in a paragraph with thetext-indent
property:Source Code | Result |
---|---|
The first line of this paragraph is indented by 18 pixels. Each subsequent line is not indented.
The first line of this paragraph is indented by 2.8 em. An em defines the proportion of the letter width and height with respect to the point size of the current font.
The first line of this paragraph is indented by 35% (i.e. 35% of the containing block - not this paragraph).
The first line of this paragraph is indented by a negative amount (-8 pixels).
|
Create a Drop Shadow
The CSStext-shadow
property accepts 4 values. The first two specify the vertical and horizontal offsets, the third one specifies the radius of the blur. The fourth value specifies the color of the drop shadow. Here are some examples:Source Code | Result |
---|---|
Drop shadow 1
Drop shadow 2
Drop shadow 3
Drop shadow 4
Drop shadow 5
|
Transform Text
To change the case of your text, use thetext-transform
property. For example, you can Capitalize Text or change it from lowercase to UPPERCASE (or vice-versa). Here are examples:Source Code | Result |
---|---|
capitalized text (also known as title case)
uppercase text
TALK QUIETLY
|
0 comments:
Post a Comment