CSS – border-color
0Description:
The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element’s border using the properties:
-
border-bottom-color changes the color of bottom border.
-
border-top-color changes the color of top border.
-
border-left-color changes the color of left border.
-
border-right-color changes the color of right border.
Possible Values:
- color: Any valid color value.
- transparent: Sets the border to be invisible.
Applies to:
All the HTML elements.
DOM Syntax:
object.style.borderColor=”red”;Example:
Here is the example which shows effect of all these properties:
p.example1{ border:1px solid; border-bottom-color:#009900; /* Green */ border-top-color:#FF0000; /* Red */ border-left-color:#330000; /* Black */ border-right-color:#0000CC; /* Blue */}p.example2{ border:1px solid; border-color:#009900; /* Green */}
This example is showing all borders in different colors.
CSS Generated Content Reference Guide
0This is a complete reference guide for web developers where haved we listed all the CSS properties related to generated content defined in the World Wide Web Consortium’s Recommended Specification for Cascading Style Sheets, Level 2
Click any property to see its description with examples:
Property Description content Inserts generated content around an element. counter-increment Increments a counter by 1; value is a list of counter names, with each name optionally followed by a value by which it is incremented. counter-reset Resets a counter to zero; value is a list of counter names, with each name optionally followed by a value to which it is reset. quotes Sets the quote symbols used to quote textWhitespace: the ‘white-space’ property
0- ‘white-space’
- Value: normal | pre | nowrap | inherit Initial: normal Applies to: block-level elements Inherited: yes Percentages: N/A Media: visual
This property declares how whitespace inside the element is handled. Values have the following meanings:
- normal
- This value directs user agents to collapse sequences of whitespace, and break lines as necessary to fill line boxes. Additional line breaks may be created by occurrences of “\A” in generated content (e.g., for the BR element in HTML).
- pre
- This value prevents user agents from collapsing sequences of whitespace. Lines are only broken at newlines in the source, or at occurrences of “\A” in generated content.
- nowrap
- This value collapses whitespace as for ‘normal’, but suppresses line breaks within text except for those created by “\A” in generated content (e.g., for the BR
Capitalization: the ‘text-transform’ property
0- ‘text-transform’
- Value: capitalize | uppercase | lowercase | none | inherit Initial: none Applies to: all elements Inherited: yes Percentages: N/A Media: visual
This property controls capitalization effects of an element’s text. Values have the following meanings:
- capitalize
- Puts the first character of each word in uppercase.
- uppercase
- Puts all characters of each word in uppercase.
- lowercase
- Puts all characters of each word in lowercase.
- none
- No capitalization effects.
The actual transformation in each case is written language dependent. See RFC 2070 ([RFC2070]) for ways to find the language of an element.
Conforming user agents may consider the value of ‘text-transform’ to be ‘none’ for characters that are not from the Latin-1 repertoire and for elements in languages for which the transformation is different from More >
Text shadows: the ‘text-shadow’ property
0- ‘text-shadow’
- Value: none | [ || ? ,]* [ || ?] | inherit Initial: none Applies to: all elements Inherited: no (see prose) Percentages: N/A Media: visual
This property accepts a comma-separated list of shadow effects to be applied to the text of the element. The shadow effects are applied in the order specified and may thus overlay each other, but they will never overlay the text itself. Shadow effects do not alter the size of a box, but may extend beyond its boundaries. The stack level of the shadow effects is the same as for the element itself.
Each shadow effect must specify a shadow offset and may optionally specify a blur radius and a shadow color. More >
Letter and word spacing: the ‘letter-spacing’ and ‘word-spacing’ properties
0- ‘letter-spacing’
- Value: normal | | inherit Initial: normal Applies to: all elements Inherited: yes Percentages: N/A Media: visual
This property specifies spacing behavior between text characters. Values have the following meanings:
- normal
- The spacing is the normal spacing for the current font. This value allows the user agent to alter the space between characters in order to justify text.
- “>
- This value indicates inter-character space in addition to the default space between characters. Values may be negative, but there may be implementation-specific limits. User agents may not further increase or decrease the inter-character space in order to justify text.
Character spacing algorithms are user agent-dependent. Character spacing may also be influenced by justification (see the ‘text-align’ property).
In this example, the
CSS3 Decoration
016.3.1 Underlining, overlining, striking, and blinking: the ‘text-decoration’ property
- ‘text-decoration’
- Value: none | [ underline || overline || line-through || blink ] | inherit Initial: none Applies to: all elements Inherited: no (see prose) Percentages: N/A Media: visual
This property describes decorations that are added to the text of an element. If the property is specified for a block-level element, it affects all inline-level descendants of the element. If it is specified for (or affects) an inline-level element, it affects all boxes generated by the element. If the element has no content or no text content (e.g., the IMG element in HTML), user agents must ignore this property.
Values have the following meanings:
- none
- Produces no text decoration.
- underline
- Each line of text is underlined.
- overline
Indentation: the ‘text-indent’ property
0- ‘text-indent’
- Value: | | inherit Initial: 0 Applies to: block-level elements Inherited: yes Percentages: refer to width of containing block Media: visual
This property specifies the indentation of the first line of text in a block. More precisely, it specifies the indentation of the first box that flows into the block’s first line box. The box is indented with respect to the left (or right, for right-to-left layout) edge of the line box. User agents should render this indentation as blank space.
Values have the following meanings:
- “>
- The indentation is a fixed length.
- “>
- The indentation is a percentage of the containing block width.
The value of ‘text-indent’ may be negative, but there may be implementation-specific limits.
The following example causes a ’3em’ text indent.
P { text-indent: 3em }
