学习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
相关文档:
一、CSS文件及样式命名
1、CSS文件命名规范
全局样式:global.css;
框架布局:layout.css;
字体样式:font.css;
链接样式:link.css;
打印样式:print.css;
2、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" />
<title>www.zishu.cn</t ......
在许多网站上我们可以看到很个性的鼠标指针(cursor),在网页设计中用CSS可以方便的实现这样个性鼠标指针的效果,该CSS属性就是"cursor"属性。
首先我们介绍一下系统自带的15个鼠标效果:
一般而言,鼠标以斜向上的箭头显示,移到文本上时变为有头的竖线,移到超级链接上变为手型。但用css可控制鼠标的显示效果,如可使鼠标 ......
1.在页面HEAD中引入一个特殊的CSS
<link rel="stylesheet" type="text/css" href="${contextPath}/styles/print.css" media="print" />
2.在print.css中通过将页面中显示的区域DISPLAY设置为NONE,打印区域设定DISPLAY为BLOCK
另外可以加入一个特殊的CSS来控制分页效果
. ......
一 关于css的id选择符
每个html的元素都包含一个id属性,该属性是唯一的,可以唯一标示一个元素,我们就可以选择更具体的元素。is属性由井号加id组成。
p#bulletinContent
{
color:Yellow ;
background-color:Maroon ;
}
html界面如下:
&l ......