The Show Syntax
Values
When 0, it is notable that properties like 3 and 4 (on actual borders) don’t do anything. You’ll need 5 if you need either of those things. CSS border-style property sets the style of all four sides of an element’s borders. It is a shorthand property for defining the border-top-style, border-bottom-style, border-left-style, border-right-style. This property takes from one to four values. So each side can have its own value. The default value of border-style is none. Borders are put on top of the element’s background. You also need to know that some browsers do not support some styles. Usually, when a style is not supported, the browser draws the border as a solid one. The border-style property is defined using one, two, three, or four values. When one value is defined, it applies the same style to all four sides. When two values are defined, the first style applies to the top and bottom sides, the second to the left and right sides. When three values are specified, the first style applies to the top, the second to the left and right, the third to the bottom side. When four values are specified, the styles apply to the top, right, bottom, and left, like a clockwise order. In this chapter you will learn: Description
Syntax and Property Values
The property values are listed in the following table. Example
Click to view the demo Next chapter...What you will learn in the next chapter: The Show demo ❯ Default value:separateInherited:yesAnimatable:no. Read about animatableVersion:CSS2JavaScript syntax:object.style.borderCollapse="collapse" Try it Browser SupportThe numbers in the table specify the first browser version that fully supports the property. Propertyborder-collapse1.05.01.01.24.0 CSS Syntaxborder-collapse: separate|collapse|initial|inherit; Property ValuesValueDescriptionDemoseparateBorders are separated; each cell will display its own borders. This is default.Demo ❯collapseBorders are collapsed into a single border when possible (border-spacing and empty-cells properties have no effect)Demo ❯initialSets this property to its default value. Read about initialinheritInherits this property from its parent element. Read about inherit More ExamplesExampleWhen using "border-collapse: separate", the border-spacing property can be used to set the space between the cells: What is borderThe border-collapse CSS property sets whether cells inside a <table> have shared or separate borders.
What value for Borderseparate: It is the default value that separates the border of the table cell.
What is the default border value in table structure?Typically the BORDER attribute (with nonzero value) sets the default value of CELLSPACING to 1. This means that by setting a border for the entire table you also set borders of one pixel for the individual cells.
What is the use of borderThe border-spacing CSS property specifies the distance between the borders of adjacent table cells (only for the separated borders model). This is equivalent to the cellspacing attribute in presentational HTML, but an optional second value can be used to set different horizontal and vertical spacing.
|