1 Ul li 竖排 2 3 4 5 6 7 CSS练习 8 9 10 11 /*--------------------------公共样式------------------*/ 12 .com-left 13 { 14 float: left; 15 } 16 /*公用分割线 宽度自行指定*/ 17 .com_divhr_solid 18 { 19 margin: 10px; 20 height: 1px; 21 border-top: 1px solid #D2CFCA; 22 margin-top: 0px; 23 } 24 /*公用分割线虚线 宽度自行指定*/ 25 .com_div_dashedhr 26 { 27 margin: 10px; 28 height: 1px; 29 border-top: 1px dashed #D2CFCA; 30 margin-top: 0px; 31 } 32 33 .align-center 34 { 35 margin: 0 auto; /* 居中 这个是必须的,,其它的属性非必须 */ 36 width: 1024px; /* 给个宽度 顶到浏览器的两边就看不出居中效果了 */ 37 margin-top: 70px; 38 margin-bottom: 10px; /*text-align:center; 文字等内容居中 */ 39 } 40 .nav 41 { 42 width: 180px; /* 控制导航总宽度 */ 43 } 44 /* 取消列表样式,内外补间为零 */ 45 .nav ul 46 { 47 list-style: none; 48 margin: 0; 49 padding: 0; 50 } 51 /* 竖排:控制导航高度*/ 52 .nav li 53 { 54 height: 35px; 55 line-height: 35px; /* 文字垂直居中 指定行高为li高度 自动垂直居中 */ 56 } 57 /* 鼠标放上效果 */ 58 59 .nav a:hover 60 { 61 background-color: #007ACC; 62 color: #FFFFFF; 63 cursor: hand; 64 } 65 66 67 /* 将a标签区块化就可以指定高度 */ 68 .nav a 69 { 70 display: block; 71 height: 100%; 72 text-decoration: none; /* 取消a标签下划线 */ 73 background-color: #fff; 74 color: #000; 75 text-align: left; /* 文字水平居中显示 */ 76 } 77 .nav a span 78 { 79 text-align: left; /* 文字水平居中显示 */ 80 margin-left: 20px; 81 font-size: 14px; 82 font-family: '微软雅黑'; 83 } 84 /*-点击后选中-*/ 85 li.current a 86 { 87 background-color: #007ACC; 88 color: #FFFFFF; 89 cursor: hand; 90 } 91 92 93 94 96 $(function () { 98 $("#ulMenu> li").click(function () {100 $("#ulMenu> li.current").attr("class", "")102 $(this).attr("class", "current")104 /*-设置要显示的DIV链接-*/106 // $("div[name='" + div.attr('id') + "']").show();108 });110 });112 113 114 115117
查看更多关于Ulli竖排菜单_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did105958
Ulli竖排菜单_html/css_WEB-ITnose
阅读:31次