0
我有一個PHP頁面,它有CSS腳本。 我想把菜單欄放在該頁面中,如何在該頁面顯示菜單欄而不會打擾該頁面的CSS設置? 菜單欄的設置:如何將menubar的代碼與頁面的代碼結合起來?
<style type="text/css">
.menubar { margin:0 auto;
padding:0;
}
html { background:#ffffff; }
body{
width:900px;
height:1000px;
overflow:auto;
background:#ffffff;
}
div#menu {
margin:40px 0 0 95px;
text-align:center;
position:absolute;
}
div#menu span {
font-size:22px;
padding-left:14px;
}
div#copyright {
font:11px 'Trebuchet MS';
color:#fff;
text-align:center;
clear:left;
position:absolute;
top:546px;
width:560px;
}
div#copyright a { color:#425B7B; }
div#copyright a:hover { color:#fff; }
</style>
頁的設置:
<style type="text/css">
body
{
font-family:Times new roman, verdana;
font-size:22px;
width: 900px;
height:70px;
margin-left: auto;
margin-right: auto;
margin-top: 6px;
background-image:url("wood_texture2.jpg");
}
</style>
我必須在哪裏放置class =「menubar」?在身體或該css腳本? – klox 2010-07-20 04:13:19
在體內。它應該像 ... ...
在衝突的唯一代碼爲主體元素,在這種情況下你將不得不做出決定哪個值你想要每個屬性。例如,您需要選擇是否希望頁面寬度爲800或900px。
來源
2010-07-20 04:06:37
我決定在900px .. 我想要菜單背景在頁面背景之後,或者可能變得透明。 – klox 2010-07-20 04:10:46
相關問題