CSS: Border
Border syntax
border: style width color
border is shorthand for
border-styleborder-widthborder-color
Sample code:
.x { border: solid 2px red; }
Default values
if a value is missing, it default to:
border-style→noneborder-width→medium(which is 3px)border-color→ current color.
border-style
Border on just one side
Border can be applied to a side only.
The properties are:
border-top: solid 5px redborder-bottom: solid 5px redborder-left: solid 5px redborder-right: solid 5px red
Example
something in the water does not compute
.border3072 { display: inline-block; border-bottom: dotted 5px red; }
sample. border with round corners
border-width
border-width: thin;-
same as 1px.
border-width: medium;-
same as 3px.
border-width: thick;-
same as 5px.
border-image
xtodo
border-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-width
other border properties
border-collapseborder-colorborder-radiusborder-spacingborder-styleborder-widthborder
border side properties
border-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-rightborder-right-colorborder-right-styleborder-right-widthborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-width