Property Name | Some Possible Values | What It Does |
---|---|---|
border | 1px solid black | Defines all borders |
border-top | 1px solid black | Defines top border |
border-bottom | 1px solid black | Defines bottom border |
border-left | 1px solid black | Defines left border |
border-right | 1px solid black | Defines right border |
px
. border: 1px solid;
DIV {
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-top-color: black;
border-bottom-color: black;
border-left-color: black;
border-right-color: black;
}
DIV {
border: 1px solid black;
}
border
and border-top
as examples, the shorthand syntax is written as follows:border: width style color;
border-top: width style color;
border: width style;
border-top: width style;
width
= Any CSS measurement but it's easiest to use pixels - e.g., 1px
style
= Any one of the following:none
- No border. Same as setting the border-width to 0px.dotted
- The border is drawn as a series of dots. dashed
- The border is drawn as a series of dashes. solid
- The border is drawn as a solid line. double
- The border is drawn as two solid lines. groove
- The border appears carved into the canvas. ridge
- The opposite of 'groove': the border appears as though it were coming out of the canvas. inset
- The border is drawn to apply a 3D inset appearance to the block element. outset
- The opposite of 'inset': The border is drawn to apply a 3D outset appearance to the block element.(NOTE: Whenstyle
is omitted, the border style defaults tonone
. Hence if you want to actually create a border, it is necessary to declarestyle
[andwidth
if you don't want to use browser defaults (usually around 2 pixels)]. Values declaringcolor
may be omitted.)
color
= Any named color or hexadecimal color code, e.g., red
, green
, blue
, #ffffcc
, etc. (Please see font color for more about what colors you can use for any HTML or CSS code.)
(NOTE: Whencolor
is omitted, the border is rendered in the same color as the element's defined or inherited color. (See Font Styles properties for more information about thecolor
property.)
<p style="border: 3px double red;">How now brown cow</p>
<style type="text/css">
<!--
p {
border: 3px double red;
}
-->
</style>
<p>How now brown cow</p>
How now brown cow
Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates
See also:
Best Free Web Hosting
How to Make a Web Page
If you need a .COM web address, you can get one quick and easy at...
<~ BACK | TOP | NEXT ~> |