摘要: 一开始在做加载数据的时候总是想着:浏览器怎么知道数据是否加载完呢?是不是需要给它一个定时器呢,但是怎么这个怎么判断这个时间呢?原来load前面的选择器是加载的内容,加载成功后的内容可以写在function函数里面。但是load加载成功后,如果使用id选择器尝试把div隐藏的话,是不行的,但是改为用class选择器把div隐藏就可以(其实我也不知道为什么,如果知道的,请留言一下):jq:<script type="text/javascript"> $(function () { $(".closeBtn").click(function () 阅读全文
posted @ 2013-02-27 08:24 MoenyChen 阅读(325) 评论(0) 推荐(0)
摘要: height:auto !important;height:200px; /*假定最低高度是200px*/min-height:200px; 这个在IE6下不起作用的,在IE6下需要把height:200px; /*假定最低高度是200px*/去掉就可以了......(做的时候是这样,不过还不太清楚这个自适应,先记下来吧~!) 阅读全文
posted @ 2013-02-24 23:31 MoenyChen 阅读(141) 评论(0) 推荐(0)
摘要: 设置了两个div,两个div都设置了position:fixted,这时按钮会被第二个div覆盖掉,一开始的解决方法是在按钮里面加上z-index的属性,这时在IE8正常,但是在IE6、7就不正常,后来在网上查了一下,原来是要在其父元素上面加z-index这个属性才有效果的。<div class="toolBar"> <div class="closeButton"> <input type="button" value="关闭" class="close" /&g 阅读全文
posted @ 2013-02-24 23:29 MoenyChen 阅读(241) 评论(0) 推荐(0)
摘要: 如果在IE6下设置了浮动和margin的话,那么在IE6下距离就会加倍,代码如下: <div class="showHeadIcon"></div>.showHeadIcon /*文字前面的小图标*/{ width: 16px; height: 12px; float: left; margin-left: 14px; display: inline;/*解决方法一:直接加这句*/ /*_margin-left:7px;解决方法二:独立给IE6加样式*/ margin-top: 11px; background: url(../images/tool 阅读全文
posted @ 2013-02-22 09:27 MoenyChen 阅读(181) 评论(0) 推荐(0)
摘要: 当我们在一个div里面包含头、中(ul和li)、尾i的话,如果设置每一个li的margin属性的话,那么虽然每个li都有距离了,但是整体的间距是不和谐的,这里需要设置ul的margin属性,代码如下:<div class="contain"> <div class="head"></div> <div class="main"> <ul> <li>1</li> <li>2</li> <li>3</li> 阅读全文
posted @ 2013-02-22 09:18 MoenyChen 阅读(2304) 评论(0) 推荐(0)
摘要: 由于背景图的背景是圆圈的,所以在其上面写文字的话,需要把文字居中对齐,设置的样式如下: <span class="number">1</span>.number /*信息条数*/{ width: 16px; height: 16px; font-size: 10px; padding-top: 3px; text-align: center; background: url(../images/toolbar.png);} 阅读全文
posted @ 2013-02-22 08:30 MoenyChen 阅读(534) 评论(0) 推荐(0)
摘要: (1)按钮是否都加了cursor: pointer属性;(2)页面在各浏览器中是否已测试;(3)如果某一个样式是需要jq替换的话,那么这个样式就不能用继承,只能单独写出来 阅读全文
posted @ 2013-02-22 08:25 MoenyChen 阅读(139) 评论(0) 推荐(0)
摘要: 以前一直搞不清楚这两个究竟是怎么样的一回事,总觉得很难理解的,但是最近接触多了,也有点了解了。 相对定位(relative):不会让出自己占用的位置 绝对定位(absolute):会让出自己的占用位置 <div class="contain"> <div class="main"></div> </div>css样式:.contain{width:200px;height:200px;position:relative;}.main{width:100px;height:100px;position:abs 阅读全文
posted @ 2013-02-21 21:42 MoenyChen 阅读(284) 评论(0) 推荐(0)
摘要: 在IE8下如果父div没有设置border,而在子div里面设置了border的话,如果这时在子div里设置margin-top的话,是不起作用的,代码如下:<div class="contain"> <div style="subMain"></div></div>css样式:.contain{width:200px; height:200px;margin-top:100px; background-color:gray;overflow:hidden;//解决方法一:在父div加这句就可以了/*bor 阅读全文
posted @ 2013-02-21 21:26 MoenyChen 阅读(304) 评论(0) 推荐(0)
摘要: 在做专题页的时候,需要把背景图在各种分辨率下都居中,就是说在低分辨率下,好像自动把背景图的两边去掉,留下中间的,在高分辨率下,把两边也保留。 这时需要把背景图放在body里面,而且需要设置背景图居中就可以了,如下所示: background: url("../images/yxsjBg.jpg") no-repeat center 0; 阅读全文
posted @ 2013-02-21 18:51 MoenyChen 阅读(149) 评论(0) 推荐(0)