JS+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=utf-8" />
<title>JS+CSS相册展示</title>
<style>
*{ margin:0; padding:0; list-style:none}
body{ font-family:Arial, Helvetica, sans-serif; font-size:12px; line-height:1.8;}
img{ display:block; border:0;}
h1,h2{ background:#85B829; line-height:2.5; font-size:14px; padding-left:10px; color:#fff;}
#pics{ border-left:3px solid #468C50; border-right:3px solid #99CC99; background:#B5DF63; float:left; width:750px;}
li{ float:left;}
a{ display:block; background:#fff; border:1px solid #A4D742; text-align:center; color:#598628; text-decoration:none; padding:5px; margin:10px;}
a:hover,a:active{ background:#99CC33; border:1px solid #85B829; border-left:1px solid #fff; border-top:1px solid #fff; color:#fff}
#showpic{ border:1px solid #85B829; padding:5px; display:none; clear:left; background:#FFF; text-align: center}
ul,#showpic{ margin:10px;}
h2{ color:#598628; background:none; text-align:left}
#showpic img{ margin:auto}
</style>
</head>
<body>
<div id="pics">
<h1>我的图集</h1>
<ul>
<li><a href="/jscss/demoimg/wall1.jpg" title="来天来了"><img src="/jscss/demoimg/wall_s1.jpg" />春天</a></li>
<li><a href="/jscss/demoimg/wall2.jpg" title="黄昏风景"><img src="/jscss/demoimg/wall_s2.jpg" />黄昏</a></li>
<li><a href="/jscss/demoimg/wall3.jpg" title="树林风光"><img src="/jscss/demoimg/wall_s3.jpg" />树林</a></li>
<li><a href="/jscss/demoimg/wall4.jpg" title="漂亮城市"><img src="/jscss/demoimg/wall_s4.jpg" />漂亮</a></li>
</ul>
</div>
<script language="javascript">
function setDiv(){
var pics
相关文档:
在asp.net中,有的时候要动态变换CSS,比如有的时候做个性化页面,可以这样做
<head>
<link id="MyStyleSheet" rel="stylesheet" type="text/css" runat="server" />
</head>
之后,在要更换CSS的页面中,使用如下代码
Sub Page_Load(Sender As Object, E As EventArgs)
If Not (IsPostBack) ......
盒子标签和属性对照
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 ......
JavaScript代码
<mce:script type="text/javascript"><!--
function imageOver(e) {
e.style.border="1px solid red";
}
function imageOut(e) {
e.style.borderWidth=0;
}
// --></mce:script>
<img src="phplamp.gif" onmouseover="imageOver(this)" onmo ......
几个css元素的简单解释 div ul dl dt oldiv,这个很常见,块级元素,div尽量少用,和table一样,嵌套越少越好
ol 有序列表。
<ol>
<li>……</li>
<li>……</li>
<li>……</li>
</ol>
表现为:
1……
2…& ......
图片自动适应大小的问题在平时制作的时候是比较常见的问题,下面提供一个比较简单的解决方法:
div img {
max-width:600px;
//IE7、FF等其他非IE浏览器下最大宽度为600px;
width:600px;
//所有浏览器中图片的大小为600px;
width:expression(document.body.clientWidth>600?"600px":"auto");
//当图片大小大于6 ......