用CSS设置Table的细边框的几种方法
设置Table的细边框通常有这么几种方式:
1、设置边框的BORDER=0 、cellspacing=1,设置Table的背景色为所要的边框色,再设置所有的td背景色为白色,这样细边框就显露出来了。这个方法有些邪气,看似不太正宗,但是也能达到效果,条条大路通罗马嘛!
以前经常为DIV居中而烦恼,以致于长用绝对定位来解决居中的问题,这样的居中只能保持在同一分辨率和同样大小的窗口中,如果换了分辨率就会出现长长的滚动条,很是影响美观。而且在IE和FF下也容易出现不同的效果。
正好在蓝色看到可一个方法,很是简单,但很实用,最主要的是在FF和IE都可以显示的一样,在也不用为兼容而头疼了!
具体方法:
1.给body添加text-align:center
2.给header添加margin:0 auto;
例如:
*{margin:0px;padding:0px;}
body {text-align:center;}
#header {margin:0 auto;text-align:left; width:600px;background:#0CF;}
《精通CSS+DIV网页样式与设计》,这套视频教程一共20讲,分别针对书中的每一章,视频教程有的地方由于时间限制讲得不是很详细,书中都详细讲解了,书的光盘中还包括了视频讲解中所有的实例的源代码。
前沿视频教室 温谦
CSS基本概念
CSS初探 - CSS基本知识 - 第1课http://learning.artech.cn/uploads/2007/05/30/20070530.html
CSS基本语法与核心概念 - CSS基本知识 - 第2课http://learning.artech.cn/uploads/2007/05/31/20070531.html
设置丰富的文字效果 - CSS基本知识 - 第3课http://learning.artech.cn/uploads/2007/06/01/20070601.html
CSS/DIV布局专题讲解
设置图片效果 - CSS/DIV专题讲解 - 第1课http://learning.artech.cn/uploads/2007/06/04/20070604.html
设置网页背景 - CSS/DIV布局专题讲解 - 第2课http://learning.artech.cn/uploads/2007/06/05/20070605.html
设置表格与表单的样式 - CSS/DIV布局专题讲解 - 第3课http://learning.artech.cn/uploads/2007/06/06/20070606.html
设置页面和浏览器的元素 - CSS/DIV布局专题 - 第4课http://learning.artech.cn/uploads/2007/06/07/20070607.html
用CSS制作漂亮的菜单- CSS/DIV布局专题讲解 - 第5课 http://learning.artech.cn/uploads/2007/06/08/20070608.html
CSS滤镜的应用 - CSS/DIV布局专题讲解 - 第6课http://learning.artech.cn/uploads/2007/06/11/20070611.html
理解CSS定位与div布局 - CSS/DIV布局专题讲解 - 第7课http://learning.artech.cn/uploads/2007/06/12/20070612.html
CSS排版 - CSS/DIV布局专题讲解 - 第8课http://learning.artech.cn/uploads/2007/06/13/20070613.html
网页变幻 - CSS/DIV布局专题讲解 - 第9课http://learning.artech.cn/uploads/2007/06/14/20070614.html
CSS与其他技术
CSS与Javascript的综合应用 - CSS与其他技术 - 第1课http://learning.artech.cn/uploads/2007/06/15/20070615.html
CSS与XML的综合运用 - CSS与其他技术 - 第2课http://learning.artech.cn/uploads/2007/06/18/20070618.html
CSS与AJAX的综合应用 - CSS与其他技术 - 第3课http://learning.artech.cn/uploads/2007/06/19/20070619.html
CSS/DIV综合实践
博客设计DIY - CSS/DIV综合实践 - 第1课 http://learning.artech.cn/uploads/2007/06/20/20070620.html
小型工作室 - CSS/DIV综合实践 - 第2课 http://learning.artech.cn/uploads/2007/06/21/20070621.html
公司网站 - CSS/DIV综合实践 - 第3课http://learning.artech.cn/uploads/2007/06/22/20070622.html
<html>
<head>
<title></title>
<style type="text/css">
*{
font-size:9pt;
margin:0px;padding:0px;
}
#tips{
position:absolute;display:none;
background:#FF6633;width:250px;
border:1px solid #000;color:#fff
}
#title{
background:#333;padding:0px 3px;
height:20px;line-height:20px;
text-align:right;font-weight:bold;
}
#content{
height: 20px;
padding:2px;
}
</style>
<script type="text/javascript">
function addEvent(elm, evType, fn, useCapture){
if (elm.addEventListener){
elm.addEventListener(evType, fn, useCapture);
return true;
} else if (elm.attachEvent){
var r = elm.attachEvent("on"+evType, fn);
return r;
} else {
alert("Handler could not be removed");
}
}
function linkTitle(){
if(!document.getElementsByTagName) return ;
var anchors=document.getElementsByTagName("a");
for(var i=0;i<anchors.length;i++){
anchor=anchors[i];
if(anchor.getAttribute("tip")){
addEvent(anchor,"mouseover",linkMouseOver);
addEvent(anchor,"mouseout",linkMouseOut);
}
}
}
<style>
.test{position:relative;color:#0000cc;text-decoration:none;font-size:12px;}
.test:hover{background:none;}
.test span {display: none;}