学习css中的摘录
链接方法:
外部链接样表:<head><link rel="stylesheet" type="text/css" href="*.css"></head>
内部的:1:<head><style type="text/css"> example css </style></head>
2:<p style="color: sienna; margin-left: 20px">
使用方法:
类选择器:.center {text-align: center}
<h1 class="center">
This heading will be center-aligned
</h1>
id选择器:#center {text-align: center}
<h1 id="center">
This heading will be center-aligned
</h1>
派生:
基于大类的使用,只要更大的元素内部的表格单元: .fancy td
类名为 fancy 的表格单元: td.fancy <td class="fancy">
background-position 的默认值是 0% 0%,在功能上相当于 top left。
background-attachment:fixed:图像固定不动
body
{
background-image:url(/i/eg_bg_02.gif);
background-repeat:no-repeat;
background-attachment:fixed
}
background
简写属性,作用是将背景属性设置在一个声明中。
background-attachment
背景图像是否固定或者随着页面的其余部分滚动。
background-c
相关文档:
网上关于突出显示当前页面的文章有不少,但是基本都是关于实现静态菜单的高亮,讲到动态生成菜单高亮的文章至少我没有找到,在csdn上问了两天都没有答案,最后在一位朋友的回答中找到思路,先利用一个函数判断菜单是否是正在浏览的当前页,然后付给li一个id,利用css层叠id大于class的关系,把这个id定义成高亮样式。
aspx ......
1.在页面HEAD中引入一个特殊的CSS
<link rel="stylesheet" type="text/css" href="${contextPath}/styles/print.css" media="print" />
2.在print.css中通过将页面中显示的区域DISPLAY设置为NONE,打印区域设定DISPLAY为BLOCK
另外可以加入一个特殊的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=gbk" />
......
注释用/**/。
不要在属性值与单位之间留有空格。假如你使用 “margin-left:20 px” 而不是 “margin-left:20px” (20和px之间有空格),它仅在 IE 6 中有效,但是在 Mozilla/Firefox 或 Netscape 中却无法正常工作。
外部样式表引用方式:<link rel="stylesheet" type="text/css" href="mystyle.cs ......
1. 在FireFox下,导航栏居中,但主体内容栏却是左对齐。
在div里的内容,IE默认为center,而FireFox默认为left。如果想要让其居中,刚需要在CSS中添加:
margin-left: auto; margin-right: auto;
这样就是告诉FireFox,左右一致,实现居中。(据说,这不是万能的。但我的皮肤居中了。)
2. 在FireFox下,有些效果不能兼 ......