div css中的clearfloat
[
2008/11/24 11:37 | by Else ]
2008/11/24 11:37 | by Else ]
如果经常用div +css 难免会用到
clear:both;
我们会写一个.class 然后放链接到div上去,
今天还是要建个.class
下面怎么用呢!
这样不是是省了代码,而又不会因为少另一边出了问题?!
clear:both;
我们会写一个.class 然后放链接到div上去,
今天还是要建个.class
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
下面怎么用呢!
这样不是是省了代码,而又不会因为少另一边出了问题?!
ie下的3px bug两种方法
[
2008/09/30 22:18 | by Else ]
2008/09/30 22:18 | by Else ]
这个是官方推荐的方法,通过dw的验证
这里的代码
ie下会多3px;
加head上面加这个,加zoom
ps.........................................................
昨天的排版,今天挖错,我的排版中是用4px和8px,在fw下对比,左右两边正常!无逢链接!
这里的代码
ie下会多3px;
.cls6_1,.cls5_1{margin-left:8px;}
加head上面加这个,加zoom
<!--[if IE]>
<style type="text/css">
.cls6_1,.cls5_1{margin-left:5px;zoom:1;}
.cls5_2{margin-left:298px;margin-right:254px;zomm:1;}
.cls6_2,.cls5_3{margin-right:5px;zoom:1;}
</style>
<![endif]-->
<style type="text/css">
.cls6_1,.cls5_1{margin-left:5px;zoom:1;}
.cls5_2{margin-left:298px;margin-right:254px;zomm:1;}
.cls6_2,.cls5_3{margin-right:5px;zoom:1;}
</style>
<![endif]-->
ps.........................................................
昨天的排版,今天挖错,我的排版中是用4px和8px,在fw下对比,左右两边正常!无逢链接!
div左邊固定,右邊自適應的排法
[
2008/09/03 13:15 | by Else ]
2008/09/03 13:15 | by Else ]
其實這樣的例子很多,在dw cs3裡就就有很多我也是看那例子的
顯示地址
顯示地址
<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
* {
margin:0;
padding:0;
}
body {
height:100%;
}
.top {
height: 100px;
background-color:#FFC
}
.left {
height: 600px;
width: 150px;
float: left;
background-color:#CCCccc;
}
.main {
height: 600px;
margin-left: 160px;
background-color:#F2F2F2;
}
.bottom {
height: 100px;
/*clear: both;可以不用吧*/
background-color:#FFC
}
body {
margin: 0px;
}
div {
border: 1px solid #C0C0C0;
}
</style>
</head>
<body>
<div class="top">
</div>
<div>
<div class="left">
</div>
<div class="main">aaa
</div>
</div>
<div class="bottom">
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
* {
margin:0;
padding:0;
}
body {
height:100%;
}
.top {
height: 100px;
background-color:#FFC
}
.left {
height: 600px;
width: 150px;
float: left;
background-color:#CCCccc;
}
.main {
height: 600px;
margin-left: 160px;
background-color:#F2F2F2;
}
.bottom {
height: 100px;
/*clear: both;可以不用吧*/
background-color:#FFC
}
body {
margin: 0px;
}
div {
border: 1px solid #C0C0C0;
}
</style>
</head>
<body>
<div class="top">
</div>
<div>
<div class="left">
</div>
<div class="main">aaa
</div>
</div>
<div class="bottom">
</div>
</body>
</html>
acbd的排版 原创
[
2007/06/05 09:10 | by Else ]
2007/06/05 09:10 | by Else ]
下面的是css文件images/css.css 两个代码要合起来!
@charset "utf-8";
/* CSS Document */
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
text-align: center;
margin:0;
padding:0;
background: #CCCCCC;
}
/* CSS Document */
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
text-align: center;
margin:0;
padding:0;
background: #CCCCCC;
}
对IE6、IE7、FF兼容性的详细CSS HACK介绍
[
2007/05/21 03:24 | by Else ]
2007/05/21 03:24 | by Else ]
这个问题把我鳖了好久了,最近终于找到了解决的方法,经过我测试是完全OK的,和大家共享。
以下为引用:
现在我大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7对!important可以正确解释,会导致页面没按要求显示!搜索了一下,找到一个针对IE7不错的hack方式就是使用“*+html”,现在用IE7浏览一下,应该没有问题了。
现在写一个CSS可以这样:
#example { color: #333; } /* Moz */
* html #example { color: #666; } /* IE6 */
*+html #example { color: #999; } /* IE7 */
以下为引用:
现在我大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7对!important可以正确解释,会导致页面没按要求显示!搜索了一下,找到一个针对IE7不错的hack方式就是使用“*+html”,现在用IE7浏览一下,应该没有问题了。
现在写一个CSS可以这样:
#example { color: #333; } /* Moz */
* html #example { color: #666; } /* IE6 */
*+html #example { color: #999; } /* IE7 */
CSS+DIV重构与SEO
[
2007/04/11 10:50 | by Else ]
2007/04/11 10:50 | by Else ]
采用CSS+DIV对网站重构日趋被大家重视起来了,尤其是大型站点,就在今天下午,IT168首页改版就选择了这种做法。其实,早些时候像阿里巴巴、163等大型门户站点就已经完成了重构工作。 Robin 早在去年就已经有了使用CSS+DIV来编写网页源码的习惯了,个人感觉这种方法确实比传统的TABLE形式的源码架构强多了。
用ease Template 模板 link.php
[
2006/12/23 20:19 | by Else ]
2006/12/23 20:19 | by Else ]
上一周在chinaz那里发现Ease Template之后,对网站做修改
第一页是link.php的源码
第二页是link.html的源码
这个是第一次使用模板!在首页测试的时候,有一个设想,但是没去试出结果怎么样!
最新版本出来一次测试,总是没成功出现错误!今天将在测试一下,下面的是能通过测试的代码
第一页是link.php的源码
第二页是link.html的源码
这个是第一次使用模板!在首页测试的时候,有一个设想,但是没去试出结果怎么样!
最新版本出来一次测试,总是没成功出现错误!今天将在测试一下,下面的是能通过测试的代码
一个企业网站首页的代码(实现三排三例)
[
2006/05/03 12:34 | by admin ]
2006/05/03 12:34 | by admin ]
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="description" content="<%= keywords %> " />
<meta name="keywords" content="<%= keywords %> " />
<meta name="copyright" content="<%= SiteUrl %>,<%= SiteName %>" />
<meta name="author" content="闽东企业信息网" />
<meta name="robots" content="all" />
<title><%= SiteTitle %></title>
<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="head.asp"-->
<div id="body">
<div id="left"><img src="images/sy_05.jpg" width="199" height="37" alt="" /></div>
<div id="right"><img src="images/sy_06.jpg" width="579" height="37" alt="" /></div>
</div>
<div id="body">
<div id="list">
<%
exec="select * from procat order by value asc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs.eof then
response.write"<img src=img/a.gif width=10 height=10>现在还没有产品分类"
else
for i=1 to 8%>
<div id="cat">
<img src="images/a.gif" width="10" height="10" /> <a href='product.asp?action=lei&id=<%= rs("id") %>' ><%=rs("catname")%></a> </div>
<%rs.movenext
if rs.eof then
exit for
end if
next
end if%>
<%rs.close
set rs=nothing
%>
<div align="center"><img src="images/mycon.jpg" width="190" height="42" alt="" /></div>
<div id="contact">
电话:<%= tel %><br>
传真:<%= fax %><br>
手机:<%= sj %><br>
E-mail:<%= email %>
</div>
</div>
<div id="right">
<!--#include file="admin/inc/aboutbody.asp"-->
</div>
<div id="right"><div id="list6"><img src="images/showpro.jpg" width="190" height="42"></div>
</div>
<div id="right">
<%
exec="select * from list order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs.eof then
response.write"没有记录"
else
if not rs.EOF and m<rs.PageSize then
colzs=3
rowzs=3
for i=1 to rowzs
if not rs.EOF then
%>
<div id="list5" >
<%for j=1 to colzs
if not rs.EOF and m<rs.PageSize then %>
<div id="list4" align="center"><a href="view.asp?action=pro&id=<%=rs("id")%>"><img src="<%= rs("spic") %>" alt="" width="100" height="100" border="0" /></a><br />
<a href="view.asp?action=pro&id=<%=rs("id")%>"><%= leftString(rs("name"),18) %></a></div>
<%rs.MoveNext
m=m+1
else%>
<%end if
next%>
</div>
<%end if
next
end if%>
<%end if%>
</div>
</div>
</div>
<!--#include file="copyright.asp"-->
</body>
</html>
我的代码是成功的!只不过,还是要为你哭泣!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="description" content="<%= keywords %> " />
<meta name="keywords" content="<%= keywords %> " />
<meta name="copyright" content="<%= SiteUrl %>,<%= SiteName %>" />
<meta name="author" content="闽东企业信息网" />
<meta name="robots" content="all" />
<title><%= SiteTitle %></title>
<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="head.asp"-->
<div id="body">
<div id="left"><img src="images/sy_05.jpg" width="199" height="37" alt="" /></div>
<div id="right"><img src="images/sy_06.jpg" width="579" height="37" alt="" /></div>
</div>
<div id="body">
<div id="list">
<%
exec="select * from procat order by value asc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs.eof then
response.write"<img src=img/a.gif width=10 height=10>现在还没有产品分类"
else
for i=1 to 8%>
<div id="cat">
<img src="images/a.gif" width="10" height="10" /> <a href='product.asp?action=lei&id=<%= rs("id") %>' ><%=rs("catname")%></a> </div>
<%rs.movenext
if rs.eof then
exit for
end if
next
end if%>
<%rs.close
set rs=nothing
%>
<div align="center"><img src="images/mycon.jpg" width="190" height="42" alt="" /></div>
<div id="contact">
电话:<%= tel %><br>
传真:<%= fax %><br>
手机:<%= sj %><br>
E-mail:<%= email %>
</div>
</div>
<div id="right">
<!--#include file="admin/inc/aboutbody.asp"-->
</div>
<div id="right"><div id="list6"><img src="images/showpro.jpg" width="190" height="42"></div>
</div>
<div id="right">
<%
exec="select * from list order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs.eof then
response.write"没有记录"
else
if not rs.EOF and m<rs.PageSize then
colzs=3
rowzs=3
for i=1 to rowzs
if not rs.EOF then
%>
<div id="list5" >
<%for j=1 to colzs
if not rs.EOF and m<rs.PageSize then %>
<div id="list4" align="center"><a href="view.asp?action=pro&id=<%=rs("id")%>"><img src="<%= rs("spic") %>" alt="" width="100" height="100" border="0" /></a><br />
<a href="view.asp?action=pro&id=<%=rs("id")%>"><%= leftString(rs("name"),18) %></a></div>
<%rs.MoveNext
m=m+1
else%>
<%end if
next%>
</div>
<%end if
next
end if%>
<%end if%>
</div>
</div>
</div>
<!--#include file="copyright.asp"-->
</body>
</html>
我的代码是成功的!只不过,还是要为你哭泣!
我的网站首页顶部的排法效果在这里此站不能显示!
[
2006/05/03 01:53 | by admin ]
2006/05/03 01:53 | by admin ]
#all #body #head_top #top_line1 {
height: 27px;
}
#all #body #head_top #top_line2 {
height: 60px;
text-align: left;
}
#all #body #head_top #top_line2 #top_left {
float: left;
width: 180px;
height: 60px;
text-align: center;
clear: right;
}
#all #body #head_top #top_line2 #top_mid {
text-align: center;
height: 60px;
width: 480px;
clear: none;
float: left;
}
#all #body #head_top #top_line2 #top_right {
width: 118px;
height: 60px;
float: left;
clear: right;
}
div的代码如下
<div id="top_line1">这里不知道放什么,按原计划应该有一个登入的入口</div>
<div id="top_line2">
<div id="top_left">这里的设计是放160*60的网站标志</div>
<div id="top_mid">放一个468*60的广告</div>
<div id="top_right">原来怎么放,现在也怎么放</div>
</div>
height: 27px;
}
#all #body #head_top #top_line2 {
height: 60px;
text-align: left;
}
#all #body #head_top #top_line2 #top_left {
float: left;
width: 180px;
height: 60px;
text-align: center;
clear: right;
}
#all #body #head_top #top_line2 #top_mid {
text-align: center;
height: 60px;
width: 480px;
clear: none;
float: left;
}
#all #body #head_top #top_line2 #top_right {
width: 118px;
height: 60px;
float: left;
clear: right;
}
div的代码如下
<div id="top_line1">这里不知道放什么,按原计划应该有一个登入的入口</div>
<div id="top_line2">
<div id="top_left">这里的设计是放160*60的网站标志</div>
<div id="top_mid">放一个468*60的广告</div>
<div id="top_right">原来怎么放,现在也怎么放</div>
</div>
一个件事情很高兴,那就是现在可以把网站的下载给分出来,不用在去做那些给程序开关的一个语句了,
也想清楚了,把一个网站做好就行了,因为学习是一回事,工作又是一回事
而做一个自己的东西,就可以把两个连起来了!
学习是为了自己的,工作也是为了自己!
今天看了一下代码,div 只是想一个砖头一样的!
每天到了这个时候,都很想睡!
先排了在说了!
也想清楚了,把一个网站做好就行了,因为学习是一回事,工作又是一回事
而做一个自己的东西,就可以把两个连起来了!
学习是为了自己的,工作也是为了自己!
今天看了一下代码,div 只是想一个砖头一样的!
每天到了这个时候,都很想睡!
先排了在说了!





