随笔分类 -  HTML/CSS

摘要:一栏固定一栏跟随 这里开始左栏固定左栏固定左栏固定左栏固定左栏固定左栏固定 sdfsd 移动层 _针对IE6帮助相对于窗口固定位置的元素实现无抖动效果background-attachment:fixed 随着页面的滚动轴背景图片不会移动 阅读全文
posted @ 2014-02-26 23:19 tinyphp 阅读(379) 评论(0) 推荐(0)
摘要:选项框居中复选框居中 阅读全文
posted @ 2014-02-26 11:09 tinyphp 阅读(20742) 评论(0) 推荐(0)
摘要:以前描表格边都是用table加上左边,然后td加右下边组合,border-collapse:collapse;有的这个属性方便很多。注释:如果没有规定 !DOCTYPE,border-collapse 属性可能会引起意想不到的错误。FirstnameLastnameBillGatesStevenJobs 阅读全文
posted @ 2014-02-04 23:18 tinyphp 阅读(305) 评论(0) 推荐(0)
摘要:重点:不要浮动不确定内容宽度 文本很长很长文本长很长 阅读全文
posted @ 2013-11-13 10:57 tinyphp 阅读(234) 评论(0) 推荐(0)
摘要:/* 针对ie的hack */ selector { property: value; /* 所有浏览器 */ property: value\9; /* 所有IE浏览器 */ property: value\0; /* IE8 */ +property: value; /* IE7 */ _property: value; /* IE6 */ *property: value; /* IE6-7 */ } 阅读全文
posted @ 2013-08-12 09:11 tinyphp 阅读(263) 评论(0) 推荐(0)
摘要:当你用CSS来定义链接的多个状态样式时,要注意它们书写的顺序,正确的顺序是:a:link {color: #FF0000} /* 未访问的链接 */a:visited {color: #00FF00} /* 访问过的链接 */a:hover {color: #FF00FF} /* 当有鼠标悬停在链接上 */a:active {color: #0000FF} /* 被选择的链接 */ 阅读全文
posted @ 2013-07-02 18:15 tinyphp 阅读(268) 评论(0) 推荐(0)
摘要:CSS:body{ margin:0; padding:0;background-image:url(text.txt);/*for IE6 防抖,也可以用一张图片URL*/ background-attachment:fixed;} /*是否存在这文件无所谓,要fixed,不能用scroll */ .main{ height:1800px;}.footer{ color:red; left:0;background:#ccc; height:30px; position:fixed; bottom:0; z-index:999; overflow:visible;/* for IE6 *.. 阅读全文
posted @ 2013-07-02 17:31 tinyphp 阅读(6428) 评论(0) 推荐(0)
摘要:有时候,我们需要做一个类似表格的布局,外边有框,每个元素右边和下边也有边框,一个200px的分成2个元素一行如果纯静态可以设个样式,让右边的元素无右边框,但是这样不够灵活,一般采取以下方式。一种布局方式:大层左边和上边加边框,内层元素为下边和右边加边框如:另一种布局方式:让内层有足够的空间,外层加隐藏overflow:hidden 阅读全文
posted @ 2013-06-05 16:06 tinyphp 阅读(290) 评论(0) 推荐(0)
摘要:word-wrap是控制换行的。使用break-word时,是将强制换行。中文没有任何问题,英文语句也没问题。但是对于长串的英文,就不起作用。word-break是控制是否断词的。break-all,是断开单词。在单词到边界时,下个字母自动到下一行。主要解决了长串英文的问题。相关:word-break同word-wrap区别 阅读全文
posted @ 2013-06-05 10:26 tinyphp 阅读(5161) 评论(0) 推荐(1)
摘要:为了更加的规范和减少命名的时间,归纳一些常见的命名:icon 图标nav 导航item 一个东西如,一件商品层wrapper 包裹层logo logohead 头部footer 底部sele 选择缩写ctn 内容缩写info 内容text 文本pic图片btm尾部 阅读全文
posted @ 2013-06-04 16:13 tinyphp 阅读(274) 评论(0) 推荐(0)
摘要:<!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- 阅读全文
posted @ 2013-06-04 15:52 tinyphp 阅读(221) 评论(0) 推荐(0)
摘要:在样式文件中加入:html { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);} 使用方法:这段代码可以变网页为黑白。建议全国站长动起来。为在雅安地震中遇难的同胞哀悼及捐款。公益捐赠地址:https://love.alipay.com/donate/itemDetail.htm 阅读全文
posted @ 2013-04-22 11:14 tinyphp 阅读(292) 评论(0) 推荐(0)
摘要:在IE下缺省值为0;同级关系,大的在上;非同级关系或非父子关系元素,须比较其为兄弟关系的两个祖先元素的z-index,原则是:值大的元素所有的后代元素,均超过值小的元素及其后代元素。例子:<!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"> 阅读全文
posted @ 2013-01-26 18:20 tinyphp 阅读(381) 评论(0) 推荐(0)
摘要:在ie6使用 border:none;是无效的,应该使用border:0;不要聚焦后显示的边框,使用outline:none 阅读全文
posted @ 2013-01-26 15:46 tinyphp 阅读(2629) 评论(0) 推荐(0)
摘要:代码1:.box{ height:15px; line-height:15px; width:468px;border:3px solid #BC1D1D;padding:8px 0 8px 3px;}代码2:.box{ height:31px; line-height:31px; width:468px;border:3px solid #BC1D1D;padding-left:3px;}以上两个代码在ie6实现的效果是一样的,但是代码2在谷歌,光标就会显得很长,并且露在文本框外,所以推荐使用第一种代码,部分高度用padding上下高度取代 阅读全文
posted @ 2013-01-25 18:01 tinyphp 阅读(2366) 评论(0) 推荐(0)
摘要:<div class="alert_fullbg"></div>样式:html,htmlbody { _background:url(/css/about:blank) #F4F5EF; _background-attachment:fixed}body { height:100%}.alert_fullbg {height:100%; width:100%; top:0; left:0; position:fixed; _position:absolute; z-index:100000; filter:alpha(opacity=... 阅读全文
posted @ 2013-01-24 17:29 tinyphp 阅读(173) 评论(0) 推荐(0)
摘要:预览效果:重点:把图片合成一张 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content=&q 阅读全文
posted @ 2012-12-29 17:55 tinyphp 阅读(725) 评论(0) 推荐(0)
摘要:表格图片预览:<div class="buss"><table> <tbody> <tr> <th class="fir">活动类型</th><th>9.9包邮(秒杀)</th><th>20元封顶</th><th>暗号团</th><th>独家折扣</th> </tr> <tr> <td class="fir">活动价格</td& 阅读全文
posted @ 2012-11-07 16:12 tinyphp 阅读(1667) 评论(0) 推荐(0)
摘要:很多时候我们不得不为一个DIV容器设定最低高度IE7 FF下都可以用 min-height 样式来定义但是IE6不支持(虽然IE6下内容可以自动撑开固定的高度)解决方案:如果你想设最低高度为600px;height:auto!important; min-height:600px;height:600px; 阅读全文
posted @ 2012-10-13 09:14 tinyphp 阅读(271) 评论(0) 推荐(0)