CSS边框未显示 [英] CSS border not displayed

查看:396
本文介绍了CSS边框未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< pre lang =HTML> 



 <   html  >  
< head >
< / head >
< body >
< div = 正文 > ;
< div id = ContactDetailsOuterBlock >
< div > 联系地址:-Jitendra garam sargawa post sakalo gila sarguja ambikapur < / div >
< / div >
< / div >
< / body >
< / html >







 



正文 
{
border 2px绿色常亮;
width 50em;
height 50em;
margin-left 10em;
margin-top 5em;
}
ContactDetailsOuterBlock
{

border 2px纯黑;
}





我有CSS和HTML都是单独的文件。

css用于在文本周围显示边框(ContactDetailsOuterBlock)没有显示任何边框。



当我在新文件中复制相同的代码时,一切正常。

请让我知道是什么可能是以前文件中的问题。

解决方案

将外部CSS文件链接到HTML文件,如下所示:

http://www.w3schools.com/tags/tag_link.asp [ ^ ]


你必须永久链接css文件在html文件中。 
示例:
< head>
< link rel =stylesheethref =example.css> //提供您的css文件名而不是example.css
< / head>


<pre lang="HTML">


<html>
    <head>
    </head>
    <body>
        <div class="Body">
            <div id="ContactDetailsOuterBlock">
                <div > Contact Address:-Jitendra garam sargawa post sakalo gila sarguja ambikapur</div>
            </div>
        </div>
    </body>
</html>





.Body
{
    border:2px solid green;
    width:50em;
    height:50em;
    margin-left:10em;
    margin-top:5em;
}
#ContactDetailsOuterBlock
{

    border:2px solid black;
}



I have both the CSS and HTML is seperate files.
The css used to display border( ContactDetailsOuterBlock ) around the text does'nt display any border.

When I copied the same code in new files, everything worked fine.
Please let me know what might be the problem in previous files.

解决方案

Link the external CSS file to the HTML file like this:
http://www.w3schools.com/tags/tag_link.asp[^]


you have to link css file extrenally in html file.
example:
<head>
	<link rel="stylesheet" href="example.css">//give your css file name instead of example.css
</head>


这篇关于CSS边框未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆