开发者

Putting a Rectangular Border Around Text

For the class below, I am trying to put a rectangular border around the text, but the CSS is not doing what I expect. How do I put a border around the text?

Thanks in advance,

John

CSS:

.commentnotify { 
            position:absolute;
            width:310px;
            left:30px;
            top:240px;
            color: #004993;
            border: medium;
            border-color: #004993;
开发者_运维知识库            font-family:Arial, Helvetica, sans-serif;
            font-size: 10px;
            font-weight: bold;
            height: 15px;
            padding-bottom: 0px;
            padding-left: 2px;

}


you can combine all border attributes in single one:

border:1px solid #004993;


You need to add -width to this part and you need to defined border-style.

border-width: medium; /* Was: border: medium; */
border-style: solid;

border alone is used as a shorthand way to specify border-width, border-style, border-color. Like such:

border:medium solid #004993;


I don't see the border-size set.

e.g. border:2px solid #004993


syntax, border: [width] | [style] | [color]

in your class you have not set the size of the border and the style that you are trying to apply medium is not valid. The list of styles that you can use dashed, dotted, solid, double, groove, ridge, inset, outset

for your above class to work try this, border: 1px dotted #004993

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜