Html not making a border
I have this style
<div style="width: 285px; float: right; border: 1px;">
I am expecting there to be a bor开发者_如何学Pythonder, but there isn't. Did I do something wrong?
Thanks!
You seem to be using border-width
. Use border:1px solid black
instead (or something similar).
If you check the CSS reference you will see that border
requires 3 parameters:
border: [width] [style] [color]
border Definition and Usage
The border shorthand property sets all the border properties in one declaration.
The properties that can be set, are (in order): border-width, border-style, and border-color.
It does not matter if one of the values above are missing, e.g. border:solid #ff0000; is allowed.
See also
- border-width
- border-style
- border-color
Have to give it a type and a color like border: 1px solid #000
If you don't specify all three border attributes, then you get default values. For the width this happens to be medium
. For the style this is none
, which means you get no border, no matter what the width is. I'm not sure that CSS defines a name for the default colour, but Firefox uses the current text colour.
精彩评论