导航页面样式

用一下的代码为例:

<body>

<ul class="nav">
    <li><a class="on" href="#">首  页</a></li>
    <li><a href="#">新闻快讯</a></li>
    <li><a href="#">产品展示</a></li>
    <li><a href="#">售后服务</a></li>
    <li><a href="#">联系我们</a></li>
  </ul>

</body>

1.水平菜单的制作:

*{margin:0; padding:0; font-size:14px;}
ul{ list-style:none;}
a{color:#333;text-decoration:none}
.nav li{ float:left;}
.nav li a{ display:block; text-indent:20px; height:30px; line-height:30px; width:100px; background-color:#efefef; margin-bottom:1px;}
.nav li a:hover{ background-color:#F60; color:#fff}

2.圆角菜单的制作:

  *{margin:0; padding:0; font-size:14px;}
        a{color:#333;text-decoration:none}
        .nav{list-style:none; height:30px; border-bottom:10px solid #F60; margin-top:20px; padding-left:50px;}
        .nav li{float:left}
        .nav li a{display:block; height:30px;text-align:center; line-height:30px; width:120px; border-radius:12px 12px 0 0; margin-left:1px;background-color:#ddd;}
        .nav li a.on, .nav li a:hover{background-color:#F60; color:#fff;}

3.高度改变的伸缩导航:

*{margin:0; padding:0; font-size:14px;}
a{color:#333;text-decoration:none}
ul{list-style:none; height:50px; border-bottom:5px solid #F60; padding-left:30px;}
ul li{float:left; margin-top:20px;}
a{display:block;height:30px;text-align:center; line-height:30px; width:120px; background-color:#ccc;}
a.on, a:hover{ color:#fff;background-color:#F60;height:40px; line-height:40px;margin-top:-10px;}

4.水平伸缩导航:

* { margin: 0; padding: 0; font-size: 14px; }
a { color: #333; text-decoration: none }
ul { list-style: none; height: 30px; border-bottom: 5px solid #F60; margin-top: 20px; padding-left: 50px; }
ul li { float: left }
ul li a { display: block; height: 30px; text-align: center; line-height: 30px; width:120px; background: #efefef; margin-left: 1px; }
a.on, a:hover { background: #F60; color: #fff; }
<script>
window.onload=function(){
    var aA=document.getElementsByTagName(‘a‘);
    for(var i=0; i<aA.length; i++){
        aA[i].onmouseover=function(){
            var This=this;
            clearInterval (This.time);
            This.time= setInterval (function(){
                    This.style.width=This.offsetWidth+8+"px";
                    if(This.offsetWidth >=160)
                    clearInterval(This.time);
                },30)
        }
        aA[i].onmouseout=function(){
                clearInterval(this.time);
                var This=this;
                this.time=setInterval(function(){
                    This.style.width=This.offsetWidth-8+"px";
                    if(This.offsetWidth<=120){
                        This.style.width=‘120px‘;
                        clearInterval(This.time);
                    }
                },30)
        }
    }
}
</script>
时间: 2024-08-09 23:58:29

导航页面样式的相关文章

百度地图导航算路成功但是无法进入导航页面

百度地图导航算路成功但是无法进入导航页面Warning: Attempt to present <UINavigationController: 0x163852800> on <UIViewCont 在导航页面.m中增加 -(id)naviPresentedViewController { return self; }

django admin页面样式丢失问题

wamp 配置django admin页面样式丢失问题 第一种方法:在apache配置文件httpd.conf中加入如下代码:Alias /static "E:\Python27\Lib\site-packages\django\contrib\admin\static"<Directory "E:\Python27\Lib\site-packages\django\contrib\admin"> Options Indexes FollowSymLin

ios 导航页面

//  AppDelegate.m#import "AppDelegate.h"#import "ViewController.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

信息化系统导航菜单样式实现

实现的菜单效果:  选中的是绿色的菜单,其余为灰色的. 实现方法:具体菜单使用图片代替,不采用文字和css组合实现. 主要JS代码: 点击菜单的时候,先遍历移除已有的选中菜单样式,然后再添加新的菜单对应样式 changeC(id,img); var index=img.indexOf("."); var imgPath='<%=basePath %>images/menu/'+img.substring(0,index)+'w.png'; document.getEle

s:actionmessage页面样式失效

1,  s:actionmessage页面样式失效: 2,解决方案: 将样式直接写入s:actionmessage标签中:<span><s:actionmessage cssStyle="margin-left:350px;margin-top:15px;color:red"/><span>

jQ禁止右键点击、隐藏搜索文本框文字、在新窗口中打开链接、检测浏览器、预加载图片、页面样式切换、所有列等高、动态控制页面字体大小、获得鼠标指针的X值Y值、验证元素是否为空、替换元素、延迟加载、验证元素是否存在于Jquery集合中、使DIV可点击、克隆对象、使元素居中、计算元素个数、使用Google主机上的Jquery类库、禁用Jquery效果、解决Jquery类库与其他Javascript类库冲突

1. 禁止右键点击 代码如下: $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); 2. 隐藏搜索文本框文字 代码如下: $(document).ready(function() { $("input.text1").val("Enter your search text here"); textFill($

Selenium2学习-024-WebUI自动化实战实例-022-网站不同分辨率下页面样式展示兼容性问题解决方案 -- 设置浏览器显示区域大小(无人值守,节约测试成本的福音,BOSS 最爱)

在 Web UI 自动化测试的过程中,通常会测试页面在不同分辨率下的显示效果,即在不同大小的显示器上全屏浏览器后的页面展示,此种测试方法需要购置不同大小的显示器,或者频繁的设置屏幕分辨率,不仅浪费了大量的金钱,同时也需要有人值守,从而使测试变成了半自动化,背离了自动化测试的初衷,也在一定程度上困扰了一定的自动化测试人员. 其实,不同分辨率下的测试,在一定程度上可以看做是浏览器窗口最大化后,浏览器可显示区域的页面样式兼容性测试.此文通过设置浏览器页面显示区域大小,从而摆脱上述种种问题的束缚.只需要

HTML5 移动开发(CSS3设计移动页面样式)

1.如何创建CSS样式表 2.CSS3的卓越特性 3.基于设备属性改变样式的媒体查询 4.如何使用属性改变元标签创建更美观移动页面   层叠样式表是移动WEB开发中的一个重要组成部分,本次分享将学到如何编写CSS并用它为移动页面定制样式,其中包括媒体查询为特定设备定制样式表.此外还将了解一些影响移动设备内容显示的元标签 创建好的样式,可通过三种方法附加到样式表里 1.内联到标签中   [建议在测试的时候这么做] 2.内嵌于HTML的开头 3.放在一个独立文档中作为样式表  [推荐的做法]*能够提

手机页面样式小问题收集

1. 伪类  :after 1. 清楚浮动 div:after{ overflow:hidden; } 2. 制作三角形 div:after{ content:''; display:block; width:0; border-top:8px solid #000; border-left:8px solid transparent; border-right:8px solid transparent; } 2. 设置表单标签placeholder属性的样式 input[type="text