CSS Mastery and Web Tricks
CSS Hack的原理是什么?
由于不同的浏览器对CSS的支持及解析结果不一样,还由于CSS中的优先级的关系。我们就可以根据这个来针对不同的浏览器来写不同的CSS。
比如 IE6能识别"_"(下划线)"*",IE7能识别" * "(星号)不能识别下划线"_",而firefox两个都不能识别。
怎么写CSS Hack?
示例1,比如要区别IE6和firefox两种浏览器,可以这样写:
<style>
div{
background:green; /* for firefox */
*background:red; /* for IE6 */
}
</style>
在IE6中看到是红色的,在firefox中看到是绿色的。
注释:在firefox中,它认不出后面的带星符号,于是将这条css规则过滤掉,不予理睬,以上解析得到的结果是:div{background:green},于是这个div的背景是绿色的。在IE6中呢,它两个background都能识别出来,它解析得到的结果是:div{background:green;background:red;},于是根据优先级别,处在后面的red的优先级高,于是这个div的背景颜色就是红色的了。
示例2, hack来区分IE6,IE7,firefox:
区别IE6与FF(代表firefox): background:orange;*background:blue;
区别IE6与IE7:background:green !important;background:blue;
区别IE7与FF:background:orange; *background:green;
区别FF、IE7、IE6:background:orange;*background:green;_background:blue;
background:orange;*background:green !important;*background:blue;
提示:书写顺序一般是将识别能力强的浏览器的CSS写在后面。
小结
1.IE都能识别*;标准浏览器(例如FF)不能识别*;
2.IE6能识别*,但不能识别 !important,
3.IE7能识别*,也能识别!important;
4.FF不能识别*,但能识别!important;
提示:浏览器优先级别:FF< SPAN>所以hack的书写顺序一般为FF IE7 IE6 。
你可以使用IE6专用符号 "_"
<style type="text/css" >
.tabcontent {
DISPLAY: none; PADDING: 0px;
margin:-5px 0 0 0;
border:1px solid red;
_margin:-15px 0 0 0;
_border:1px solid orange;
}
</style>
在Dreamweaver中实现flash的透明背景
方法一:在Dreamweaver中的flash代码里<object>中插入<param name="wmode" value="transparent" />,然后再<embed>中插入wmode="transparent"保存即可。
方法二:直接在Dreamweaver中的设计界面,选中要处理的flash点击下面的属性,在参数里添加wmode,在值里插入transparent,然后确定保存即可。
为什么web标准中IE无法设置滚动条颜色?
解决办法是将body换成html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
html {
scrollbar-face-color:#f6f6f6;
scrollbar-highlight-color:#fff;
scrollbar-shadow-color:#eeeeee;
scrollbar-3dlight-color:#eeeeee;
scrollbar-arrow-color:#000;
scrollbar-track-color:#fff;
scrollbar-darkshadow-color:#fff;
}
-->
</style>
What can i design?
- Logo Design and Brand Development: Whether you need to create a new brand or revitalize an existing one, I can help. I can design Logo Design, Identity Development, Brand Style Guides, Custom Illustration, Artwork Vectorization and much more!
- Print Design, Business Collateral Production: I can design Business Systems, Photography, Production Work, business cards, letterhead, brochures, catalogs, mailers and much more!
- Websites Design and Maintenance: I design killer websites for companies of almost every size and shape. I can design WebSite and WebSite Maintenance, E-Commerce, Content Managment and much more!
- Creative Marketing and Logo Promotion: I can do Search Engines optimization, Email Marketing, Printed T-shirts, Logo Apparel, Promotion Gifts and much more!
I am a designer who is easygoing, useful, well-organized, independent, skillful, confidence, and calm under pressure.


