css导航菜单(包含横向子菜单)
强烈推荐一款CSS导航菜单,用到政府学校类网站上超级不错。
有点类似站长网菜单的味道,只不过颜色不一样而已,这种菜单还不是真正意义上的“下拉”菜单,应该叫滑出菜单<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>导航菜单</title>
<mce:style><!--
body,td,th {
font-family: Tahoma, Verdana, Arial, sans-serif;
font-size: 12px;
color: #333333;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a {
color: #333333;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: none;
}
a:active{
color: #FF0000;
text-decoration: none;
}
#menu{
height:32px;
margin-top:8px; background-color:#990000;
}
#menu ul{
margin:auto; width:778px; height:32px;
list-style-type:none; padding:0px; margin-top:0px; margin-bottom:0px;
}
.m_li{
float:left; width:114px; line-height:32px; text-align:center; margin-right:-2px; margin-left:-2px;
}
.m_li a{
display:block; color:#FFFFFF; width:114px;
}
.m_line{
float:left; width:1px; height:32px;
line-height:32px; /*ff下有效(图片垂直居中)*/
}
.m_line img{
margin-top:expression(( 32 - this.height ) / 2); /*ie下有效(图片垂直居中)*/
}
.m_li_a{
float:left; width:114px; line-height:32px; text-align:center; padding-top:3px; font-weight:bold;
background-image:url(http://www.codefans.net/jscss/demoimg/200904/menu_bg2.jpg); position:relative; height:32px; margin-top:-3px; margin-right:-2px; margin-left:-2px;
}
.m_li_a a{
display:block; color:#FF0000; width:114px;
}
.smenu{
width:774px; margin:0px auto 0px auto; padding:0px; list-style-type:none; height:32px;
}
相关文档:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
body{position:relative; border:solid 1px #30F; height:600px; }
.box{ position:ab ......
CSS对浏览器器的兼容性具有很高的价值,通常情况下IE和Firefox存在很大的解析差异,这里介绍一下兼容要点。
常见兼容问题:
1、DOCTYPE 影响 CSS 处理
2、FF:div 设置 margin-left, margin-right 为 auto 时已经居中,IE 不行
3、FF: body 设置 text-align 时, div 需要设置 margin: auto(主要是 margin-left,margi ......
解决方法:
1、
用css滤镜。
<td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='bg_img.jpg', sizingMethod='scale'" >
2、
你可以考虑用css滤镜来做背景渐变效果,设置td的css
style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FFFFFF' ......
现在给大家献上颜色对照码:
FFFFFF
#DDDDDD
#AAAAAA
#888888
#666666
#444444
#000000
#FFB7DD
#FF88C2
#FF44AA
#FF0088&n ......
CSS filter:RevealTrans 用法:
Filter:revealtrans(duration=转换的秒数,transition=转换的类型)
CSS的RevealTrans动态滤镜是一个神奇的滤镜,它能产生23种动态效果,更为奇妙的是它还能在23种动态效果中随机抽用其中的一种。
两个参数Transition和Duration,分别是变换效果和持续时间,其中Duration是浮点数。
......