為什么我做的不出效果????
<!DOCTYPE html>
<html>
??? <head>
??? <meta charset="UTF-8">
??? <title>實踐題 -tab 選項卡</title>
??? <script src="js/script.js" type="text/javascript"></script>
??? <link type="text/css" href="css/style.css" rel="stylesheet" ></link>
? </head>
??? <body>
<!-- HTML頁面布局 -->
<div id="notice">
?? ?<div id="notice-tit">
?? ??? ?<ul>
?????? ??? ?<li>
?????????? ??? ?<a href="#">公告</a>
??????????? </li>
?????? ??? ?<li>
?????????? ??? ?<a href="#">規則</a>
??????????? </li>
?????? ??? ?<li>
?????????? ??? ?<a href="#">論壇</a>
??????????? </li>
?????? ??? ?<li>
?????????? ??? ?<a href="#">安全</a>
??????????? </li>
?????? ??? ?<li>
?????????? ??? ?<a href="#">公益</a>
??????????? </li>
?????? ?
??????? </ul>
??? </div>
? ?
</div>
</body>
</html>
///////////////////////////css樣式部分
*{
?? ?margin:0;
?? ?padding:0;?? ?
?? ?list-style:none;
?? ?font-size:12px;
?? ?}
.notice{
?? ?width:298px;
?? ?height:98px;
?? ?border:1px solid #ddd;
?? ?overflow:hidden;
?? ?margin:0 auto;
?? ?}
.notice-tit?? ?{
?? ?height:27px;
?? ?position:relative;
?? ?background:#f7f7f7;
?? ?}
.notice-tit ul{
?? ?position:absolute;
?? ?width:301px;
?? ?left:-1;
?? ?}?? ?
.notice-tit li{
?? ?float:left;
?? ?width:58px;
?? ?height:26px;
?? ?line-height:26px;
?? ?text-align:center;
?? ?background:#fff;
?? ?padding:0 1px;
?? ?background:#f7f7f7;
?? ?border-bottom:1px solid #ddd;
?? ?}
.notice-tit li a{
?? ?text-decoration:none;
?? ?}
.notice-tit li.select{
?? ?background:#fff;
?? ?border-bottom-color:#fff;
?? ?border-left:1px solid #ddd;
?? ?border-right:1px solid #ddd;
?? ?padding:0;
?? ?}?? ?
.notice-tit li a:link,.notice-tit li a:visitied{
?? ?color:#000;
?? ?}
.notice-tit li a:hover{
?? ?color:#f90;
?? ?}?? ?
.notice-con .mod{
?? ?margin:10px 10px 10px 19px;
?? ?}
.notice-con .mod ul li{
?? ?float:left;
?? ?width:134px;
?? ?height:25px;
?? ?overflow:hidden;
?? ?}?? ?
.mod ul? a{
?? ?text-decoration:none;
?? ?color:#000;
?? ?}?? ??? ??? ?
2016-01-07
你的代碼很多細節錯誤。比如visited拼寫錯誤,還有給div設置樣式的時候,你的css是.notice,可是你的代碼里是id=“notice”,應該在div那里加上class=“notice”,上面還有很多諸如此類的錯誤,建議仔細看看視頻,然后核查。