边框不显示 [英] Border does not show up
问题描述
我的图像周围没有显示边框,我不太确定问题可能出在哪里.我只需要在照片周围留一个黑色小边框即可.我的网站是 http://www.welovetile.com .我不知道可能是什么问题.谢谢.
My border is not showing up around my image, I'm not quite sure what the issue could be. I just need a small black border around the photo. My website is http://www.welovetile.com. I can't figure out what the problem could be. Thanks.
CSS:
#kitchen {
height:250px;
width:346px;
background-image:url(images/kitchenbg.jpg);
}
#kitchen img
{
top: 50%;
left: 50%;
width: 316px;
height: 228px;
margin-top:11px;
margin-left:15px;
border-color:#000000;
border-width:thin;
}
HTML:
<div id="kitchen">
<img src="images/kitchen.jpg" alt="Kitchen Tile Job"/>
</div>
推荐答案
边框主要包括三个部分:宽度,样式和颜色;该样式是其他任何样式都需要的.
Borders have three main pieces: a width, a style, and a color; the style is required for any of the others to work.
尝试添加样式:
border-style: solid;
此外,您可以在css的同一行中指定所有这些内容:
Also, you can specify all these in the same line of css:
border: thin solid black;
已更新
Wesley指出,边框样式是唯一需要的样式.
As pointed out by Wesley, border-style is the only required one.
来自 http://www.w3schools.com/css/css_border.asp :
除非设置了 border-style 属性,否则所有border属性都不会具有任何作用!
None of the border properties will have ANY effect unless the border-style property is set!
这篇关于边框不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!