编辑菜单栏的css脚本
问题描述:
我有一个用于制作jquery菜单栏的css脚本.. 我希望它可以显示在左上方并且没有边框... so..it只显示一个菜单栏... 我有一个文本标志,我想把它放在菜单栏下面... 但实际上的标志位于菜单栏身体下方... 如何改变它......?编辑菜单栏的css脚本
<head>
<style type="text/css">
* { margin:0 auto;
padding:0;
}
html { background:#ffffff; }
body{ margin:40px auto;
width:560px;
height:552px;
overflow:hidden;
background:#ffffff;
}
div#menu {
margin:40px 0 0 95px;
position:left;
}
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>
</head>
<body>
<p align="left"><img src="coollogo_com-30735352.gif" border="0"></p>
</body>
答
很难说没有看到任何HTML标记就要做什么。要使用wood.jpg作为您的身体背景,请使用背景:#ffffff url(/images/wood.jpg);在车身风格定义在地方背景:#FFFFFF
除此之外,这里有一些一般的指针:
- 对于通配符样式(·),你只需要保证金:0;
- 为html和body添加背景颜色是多余的。你只需要它在身上
- 因为你已经用通配符定义了它,所以你不需要在身体上留下任何余量
- 我会建议反对使用overflow:隐藏固定高度的身体,除非那正是你想。任何长时间运行的内容都会被切断。考虑使用overflow:auto;
- 风格“position:left”无效。如果您希望#menu的内容与左侧对齐,请使用text-align:left或将内容浮动到左侧,并使用“更清晰的div”或溢出自动清除div;
答
<head>
<style type="text/css">
* { margin:0 auto;
padding:0;
}
html { background:#ffffff; }
body{ margin:0px;
width:1600px;
height:800px;
overflow:auto;
background-image:url("wood_texture2.jpg");
}
div#menu {
margin:40px 0 0 95px;
position:absolute;
text-align:left;
}
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>
</head>
<body>
<p align="left"><img src="coollogo_com-30735352.gif" border="0"></p>
</body>
我改变我的问题.. – klox 2010-07-15 05:29:35