css选择器
dojo.query()函数要用到各种css选择器来寻找dom元素,下面就常见的css3选择器进行简略的介绍。
1、 基本选择器:根据标签。
例如:P{color:blue}
2、 选择器组:多个标签之间用逗号隔开。
例如:P,h{color:blue}
3、 Id选择器:用#id名表示。
例如:<div id=”d”>111</div>, #d{color:blue}
4、 类选择器:用.类名的方式
例如:定义一个类样式:.c{color:blue}
应用到所有标识有该类名的标签中,如<div class=”c”>
5、 结构化选择器:根据元素之间的包含关系选择,最高层的排在最前面,中间用空格
例如:div p{color:blue} 寻找外层是div标签的p标签元素
6、 属性选择器:用[属性]的方式指定拥有该属性的元素列表
例如:[height]{color:blue}
7、 其他选择器。
例如:
全局选择器 * :匹配所有的元素
E>F:孩子选择器
E F:后代选择器
E[height]:匹配E且拥有height属性
E[height=200]
E#myid:匹配E且拥有“myid”的id
相关文档:
自动换行问题,正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大,挺让人头疼,下面介绍的是CSS如何实现换行的方法
对于div,p等块级元素
正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义的宽度之后自动换行
html
css
1.(IE浏览器)连续的英文字符和阿拉伯数字,使用word ......
盒子标签和属性对照
CSS语法(不区分大小写)
JavaScript语法(区分大小写)
border
border
border-bottom
borderBottom
border-bottom-color
borderBottomColor
border-bottom-style
borderBottomStyle
border-bottom-width
borderBottomWidth
border-color
borderColor
border-left
borderLeft
border ......
在JSP页面上加入
<%String path = request.getContextPath();%>
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css">
下列方式貌似不行:
<link href="../css/style.css" rel="stylesheet" type="text/css">
<link href="../../css/style.css" rel ......
转自:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片跑马灯</title>
</head>
<body>
<div style="overflow:hidden; width:350px" id='div'>
<!-- 这里是第一个关键点,o ......
1. CSS字体定义简写规则
一般的写法会是这样:
font-weight: bold;
font-style: italic;
font-varient: small-caps;
font-size: 1em;
line-height: 1.5em;
font-family: verdana,sans-serif
而实际上你可以用更简洁的写法:
font: bold italic small-caps 1em/1.5em verdana,sans-serif
是不是更省事?不过使用这 ......