Export (0) Print
Expand All
top
Expand Minimize

borderTopColor property

Specifies the foreground color of the top border of an object.

CSS Backgrounds and Borders Module Level 3, Section 4.1

 

Syntax

Integer value = object.put_borderTopColor(Variant v);Integer value = object.get_borderTopColor(Variant* sColor);

Property values

Type: VARIANT

One of the color names or RGB values in the Color Table.

String format

<color> | currentColor | transparent | inherit

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial ValuecurrentColor

Standards information

Remarks

Some browsers do not recognize color names, but all browsers should recognize RGB color values and display them correctly.

Examples

This example uses IHTMLCSSStyleDeclaration::borderTopColor to set the top border color to a different color than the rest of the border.


<body>
   <div class="box"></div>
   <div class="rounded"></div>
</body>

The CSS below sets the top border color for two div elements. The remaining border sides retain the color specified by the IHTMLCSSStyleDeclaration::borderColor property.

Two elements using the border-top-color property


.box {
   border-color: #BBBBBB;
   border-top-color: blue;
   border-style: solid;
   
}
.rounded {
   border-color: #C20000;
   border-top-color: #BBBBBB;
   border-style: dashed;	
   border-radius: 10px;
}

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IHTMLCSSStyleDeclaration::border
IHTMLCSSStyleDeclaration::borderRightColor
IHTMLCSSStyleDeclaration::borderLeftColor
IHTMLCSSStyleDeclaration::borderBottomColor

 

 

Community Additions

ADD
Show:
© 2014 Microsoft