摘要: 在网上转悠的时候,看到了一篇不错的效果,便转载过来,以免以后用的时候难得找。 主要是运用"position:fixed;"属性。 直接上代码:<!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>& 阅读全文
posted @ 2012-01-04 17:51 子非魚87 阅读(1500) 评论(0) 推荐(0) 编辑
摘要: SelectorSpecificity行内样式style=""1,0,0,0id选择器#content {}0,1,0,0class选择器.content{}0,0,1,0标签选择器div{}0,0,0,12个id选择器#div #content{}0,2,0,011个class选择器.a1 .a2 .a3.....a11{}0,0,11,01个id和1个class选择器#div .nav{}0,1,1,0 如表格所示,行内样式拥有最高优先级,其次是id选择器,再其次是class类选择器,最后是标签选择器。 当选择器叠加的时候,并不是简单的相加。如果将id选择器的优先级看成 阅读全文
posted @ 2012-01-04 17:08 子非魚87 阅读(282) 评论(0) 推荐(0) 编辑
摘要: JavaScript解决方法:window.onload=function(){ var otable=document.getElementById("oTable"); for(var i=0;i<oTable.rows.length;i++) { if(i%2==0) { oTable.rows[i].className="altrow"; /*.altrow指定背景颜色*/ } }}jQuery解决办法:$( function() { $("table#oTable tr:nth-child(odd)").addClas 阅读全文
posted @ 2012-01-04 16:29 子非魚87 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1. pre自动换行(符合w3c标准并支持多浏览器)pre{ white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap;}* html pre { word-wrap: break-word; white-space : normal ; }2. 禁止换行.nowrap{ word-break:keep-all; white-space:nowrap;}3. 段落文字*{ text-transform:capitalize;/*所有单词首字母... 阅读全文
posted @ 2012-01-04 11:45 子非魚87 阅读(253) 评论(0) 推荐(0) 编辑