CSS div样式在HTML中不起作用

CSS div样式在HTML中不起作用,html,css,border,Html,Css,Border,我正在尝试使用以下CSS将边框应用于我网页中的几个div: .column-left{ float: left; width: 20%;} .column-right{ float: right; width: 20%; visible:false;} .column-center{ display: inline-block; width: 60%;} a:link, a:visited { background-color: #f44336; color: white;

我正在尝试使用以下CSS将边框应用于我网页中的几个div:

.column-left{ float: left; width: 20%;}
.column-right{ float: right; width: 20%; visible:false;}
.column-center{ display: inline-block; width: 60%;}

a:link, a:visited {
    background-color: #f44336;
    color: white;
    padding: 14px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

a:hover, a:active {
    background-color: red;
}

#test{         margin-left:auto;
               margin-right:auto;
               margin-top:0px;
               margin-bottom:0px;
               border-style:solid;
               border-left:1px;
               border-right:1px;
               border-top:0px;
               border-bottom:1px;
               border-color:#000000;    
               background-color: yellow;
}
在我的html中有如下内容:

<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="cols.css">
<title>Test</title>
</head>
<body>
<div>
   <div class="column-center">...</div>
   <div class="column-left"><a href="#"> Link 1 </a><br><a href="#"> Link 2 </a><br><a href="#"> Link 3 </a><br><a href="#"> Link 4 </a><br>
</div>
   <div class="column-right"> ... </div>
</div><div id="test"> ... </div>
</body>
</html> 

试验
...




... ...
#test中的设置不起作用,我无法找出原因。有什么想法吗

编辑:如果我将#test的属性放在另一个CSS文件中,它会正常工作。
编辑:添加相关的HTML代码。

您的边框样式属性应该是所有边框属性的下一个: 例如:

margin-left:auto;
margin-right:auto;
margin-top:0px;
margin-bottom:0px;
border-left:1px;
border-right:1px;
border-top:0px;
border-bottom:1px;
height: 100px;
border-style:solid;
border-color:#000000;    
background-color: yellow;
最好使用速记值:

margin:0 auto;
height: 100px;
border:1px solid #000;
border-top:0;
background: rgb(255,255,0);

边框样式属性应该是所有边框属性中的下一个: 例如:

margin-left:auto;
margin-right:auto;
margin-top:0px;
margin-bottom:0px;
border-left:1px;
border-right:1px;
border-top:0px;
border-bottom:1px;
height: 100px;
border-style:solid;
border-color:#000000;    
background-color: yellow;
最好使用速记值:

margin:0 auto;
height: 100px;
border:1px solid #000;
border-top:0;
background: rgb(255,255,0);

与锚定类和列类相匹配的html在哪里?plz提供JSFIDLE以获得有用的答案:)寻求代码帮助的问题必须包含在问题本身中重现它所需的最短代码。查看与锚定类和列类匹配的html在哪里?plz提供JSFIDLE以获得有用的答案:)寻求代码帮助的问题必须包含在问题本身中重现它所需的最短代码。看见