CSS常用操作
注释用/**/。
不要在属性值与单位之间留有空格。假如你使用 “margin-left:20 px” 而不是 “margin-left:20px” (20和px之间有空格),它仅在 IE 6 中有效,但是在 Mozilla/Firefox 或 Netscape 中却无法正常工作。
外部样式表引用方式:<link rel="stylesheet" type="text/css" href="mystyle.css" mce_href="mystyle.css" />
内部样式表:
<head>
<mce:style type="text/css"><!--
hr {color: sienna;}
p {margin-left: 20px;}
body {background-image: url("images/back40.gif");}
h1,h2,h2,h3,h5,h6 {color: green;}
--></mce:style><style type="text/css" mce_bogus="1"> hr {color: sienna;}
p {margin-left: 20px;}
body {background-image: url("images/back40.gif");}
h1,h2,h2,h3,h5,h6 {color: green;}</style>
</head>
内联样式:<p style="color: sienna; margin-left: 20px" mce_style="color: sienna; margin-left: 20px">This is a paragraph</p>
---------------------------------------------
样式可以被继承:
例如,外部样式表拥有针对 h3 选择器的三个属性:
h3 {
color: red;
text-align: left;
font-size: 8pt;
}
而内部样式表拥有针对 h3 选择器的两个属性:
h3 {
text-align: right;
font-size: 20pt;
}
假如拥有内部样式表的这个页面同时与外部样式表链接,那么 h3 得到的样式是:
color: red;
text-align: right;
font-size: 20pt;
---------------------------------------------
提示:如果值为若干单词,则要给值加引号:p {font-family: "sans serif";}。只有当一个字体名中有一个或多个空格(比如 New York),或者如果字体名包括 # 或 $ 之类的符号,才需要在 font-family 声明中加引号。
派生选择器:
strong {
color: red;
}
h2 {
color: red;
}
h2 strong {
color: blue;
}
<h2>The strongly emphasized word in this subhead is<strong>blue</strong>.</h2>
---------------------------------------------
id 选择器:
id 选择器可以为标有特定 id 的 HTML 元素指定特定的样式。id 选择器以 "#" 来定义。
#red {color:red;}
#green {color:green;}
下面的 HTML 代码中,id 属
相关文档:
<!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 ......
这篇文章是在如下地址看到的:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_23302976.html
首先是HTML部分:
<
body>
<
div id="loading">
<div><img src="../images/loading.gif" /><span>Please Wait</span></div> ......
今天做一个功能,根据select元素选择的不同selectedIndex项,显示一个表格里指定的tr项。
首先:$("#table tr:gt(0)").css("display","none"); 这个没问题,当要显示的时候.css("display","block"),在FF中布局一下就乱掉了。试了几次都是如此,想了一下,是不是在 ......
转载自:div+css优点
http://blog.sina.com.cn/s/blog_4fe1e5e90100bdtk.html
最近面试了多家公司...有个关于div+css布局好处的问题,问了好多次..我回答了一些,但是不太全面..
今天从网上系统的搜索到了一些,参考
DIV本身就是容器性质的,你不但可以内嵌table还可以内嵌文本和其它的HTML代码;CSS是CascADIng style Sh ......
转自:http://www.boy110.com/csslimitedwidth/ CSS限制图片最大宽度,兼容IE6/IE7/IE8/FF,用做管理后台应该没问题! 我们在制作一个网页的时候,经常要对一个区域里可能出现的图片的宽度进行限制,不然它可能会把页面撑得很烂很烂。
如果你采用固定宽度,长度来设置的话,比如在 200 ? "200px" : this.wid ......