js 修改CSS文件中的样式
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style id="">
.class1{
margin-left:135px;
margin-top:1px;
}
.b{
margin-left:135px;
margin-top:1px;
}
</style>
<script>
function hidden(){
if(typeof document.styleSheets != "undefined")
{
var printStyleSheet = document.styleSheets[0];
var printRules = null;
if (typeof printStyleSheet.rules != "undefined")
{
printRules = printStyleSheet.rules;
}else{
printRules = printStyleSheet.cssRules;
}
for(var i=0; i <printRules.length; i++)
{
//alert(printRules[i]["selectorText"]);
if(printRules[i]["selectorText"]==".class1")
{
printRules[i].style.display = "none";
}
}
}
}
</script>
</HEAD>
<BODY>
<div class="class1">123446</div>
<br />
<a href="#" onclick="hidden();">CLICK ME</a>
</BODY>
</HTML>
相关文档:
盒子标签和属性对照
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 ......
* {
margin:0;
padding:0;
font-size:13px;
*font-size:11px;
font-family:Verdana, Arial, 宋体,Helvetica, sans-serif;
/*scrollbar-face-color:#dff9fe;
scrollbar-highlight-color:#FFFFFF;
scrollbar-3dlight-color:#9adae7;
scrollbar-darkshadow-co ......
<div id="imgbox" style="height:110px;width:600px;overflow:hidden;">
<div id="imgbox1" style="float:left;width:1000%">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www ......
可以在博客的配置页面的自定义css栏中填入css样式代码来自定也blog的风格
csdn blog的页面架构基本是由div实现的,整个页面主要由三个div组成,它们的id分别是:
csdnblog_header, csdnblog_sidebar, csdnblog_content。
所以,定义它们的主体样式可以这样:
#csdnblog_header
{
//头部的风格
}
# ......