<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="js/common/jquery-1.9.1.min.js" type="text/javascript"></script>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
background:url(../img/leftbj.gif) repeat-y;
}
ul li{
list-style: none;
}
#leftDiv{
width: 100%;
overflow:hidden;
display: block;
height: 100%;
margin-top: 32px;
}
#leftDiv ul li span{
font-size: 14px;
background: url(../img/navbj01.jpg) no-repeat;
height: 28px;
display: inline-block;
line-height: 28px;
width: 100%;
padding-left: 25px;
color:white;
}
#leftDiv ul li{
margin-left: -40px;
width: 207px;
}
#leftDiv ul li ul li{
line-height: 28px;
height: 28px;
width: 207px;
background-color: #336f9c;
border-bottom: 1px solid #4183b4;
}
#leftDiv ul li ul li a{
text-decoration:none;
cursor:pointer;
color: white;
font-size: 13px;
padding-left: 50px;
}
#leftDiv ul li ul li a:hover{
text-decoration:underline;
}
</style>
<script type="text/javascript">
$(function(){
$("#leftDiv>ul>li>span").click(function(){
$(this).siblings("ul").toggle();
});
});
</script>
</head>
<body>
<div id="leftDiv">
<ul>
<li>
<span>统计</span>
<ul>
<li><a href="customer/sum.do" target="mainFrame">统计</a></li>
</ul>
</li>
<li>
<span>数据维护</span>
<ul>
<li><a href="admin/list.do" target="mainFrame">管理†</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>

上述通过设置span元素的行高、高度、宽度和 display 的inline-block可以让其填充整个span区间,这对于布局中的对齐(水平或垂直)很有作用,不用依赖table布局。

css块元素的 display 属性 inline-block 的应用的更多相关文章

  1. 转帖 css的块元素、内联元素、内联块元素、display属性、浮动、定位

    块元素 块元素,也可以称为行元素,布局中常用的标签如:div.p.ul.li.h1~h6.dl.dt.dd等等都是块元素,它在布局中的行为:1.支持全部的样式.2.如果没有设置宽度,默认的宽度为父级宽 ...

  2. 块级元素、行内元素、display属性

    块级元素 特点: 总是以一个块的形式表现出来,占领一整行.若干同级块元素会从上之下依次排列(使用float属性除外). 可以设置高度.宽度.各个方向的margin以及各个方向的padding. 当宽度 ...

  3. 块级元素行内元素以及display属性

    1.什么叫做标签语义化? ->合理的标签做合适的事情 ->HTML中常用的标签都有哪些? (块状标签和行内标签) ->块状标签和行内标签的区别? (常用的有8条区别) 1)内联元素: ...

  4. CSS块元素与内联元素(转)

    为什么<a><span>这种标签定义width,height等CSS属性时会发现完全不生效? 因为它们不是容器,它们是内联元素,不是块元素 CSS 块元素与内联元素 关键字: ...

  5. CSS学习笔记05 display属性

    HTML标记一般分为块标记和行内标记两种类型,它们也称块元素和行内元素. 块元素 每个块元素通常都会独自占据一整行或多整行,可以对其设置宽度.高度.对齐等属性,常用于网页布局和网页结构的搭建.并且块级 ...

  6. 实现span设置宽度(行内元素本来不支持调宽度高度这些样式)(变成行内块元素:display:inline-block;)

    实现span设置宽度(行内元素本来不支持调宽度高度这些样式)(变成行内块元素:display:inline-block;) 一.总结 1.将span从行内元素变成行内快元素就可以调了: 设置样式的时候 ...

  7. CSS学习笔记:display属性

    目录 一.display属性概述 1. 块级元素和行内元素的区别 2.常见的块级元素和行内元素 3. display属性常见的属性值 二.测试display取各属性值的效果 1. 测试inline和b ...

  8. CSS块元素、行内元素、行内块元素的转换

    一.块元素转行内元素:display:inline 二.行内元素转块元素:display:block div{ display: inline; /*无效 width: 500px; height: ...

  9. CSS 基础 例子 display属性:block、inline和inline-block的区别

    HTML中块级元素(block)和行级元素(inline):比如div就是常见的块级元素,span就是常见的行级元素. 可以通过css的display属性来设置一个元素到底是块级,还是行级元素:dis ...

随机推荐

  1. jquery 添加关键字小插件

    模块化封装,兼容seajs /** * User: c3t * Date: 14-3-25 * Time: 下午4:16 */ define(function (require, exports, m ...

  2. andoid 多线程断点下载

    本示例介绍在Android平台下通过HTTP协议实现断点续传下载. 我们编写的是Andorid的HTTP协议多线程断点下载应用程序.直接使用单线程下载HTTP文件对我们来说是一件非常简单的事.那么,多 ...

  3. vim创建新的命令

    转自:http://man.chinaunix.net/newsoft/vi/doc/usr_5F40.html#usr_40.txt *40.1* 键映射 简单的映射已经在 |05.3| 介绍过了. ...

  4. BNU34058——干了这桶冰红茶!——————【递推】

    干了这桶冰红茶! Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class nam ...

  5. 经典算法详解(1)斐波那契数列的n项

    斐波那契数列是一个常识性的知识,它指的是这样的一个数列,它的第一项是1,第二项是1,后面每一项都是它前面两项的和,如:1,1,2,3,5,8,13,21,34,55,89,144,233…… 说明:由 ...

  6. Excle 导入DataSet

    using System.Data.OleDb;using System.Data; public void ReadExcelFiless()        {            //strin ...

  7. 数组和矩阵(2)——Reshape the Matrix

    In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new o ...

  8. 微信小程序问题总结

    1.navigator不能跳转到tabBar所包含的页面 例如: tabbar包含center页面,不包含page1页面,使用如下跳转: <navigator url='../center/ce ...

  9. window.frames在不同浏览器中的用法

    document.frames 等同于 window.frames,用来取得当前页面内 window 对象的集合. 不支持Firefox,其他浏览器(chrome.opera.IE.360)均支持. ...

  10. Elipse plugin or Bundle & OSGI

    Develop and register service, lookup and use service! Android Design on service's publish-find-bind ...