Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Thursday, September 9, 2010

精选15个国外CSS框架

什么是css框架


实际上还是让我们从框架说起吧。
框架就是一个你可以用于你的网站项目的基本的概念上的结构体。


css框架通常只是一些css文件的集合,这些文件包括基本布局、表单样式、网格或简单结构、以及样式重置。比如:

  • typography.css 基本排版规则
  • grid.css 基于网格的布局
  • layout.css 通常的布局
  • form.css for 表单样式
  • general.css 更多通用规则

您还可以参考以下前端开发/CSS相关资源:


《推荐12款可用于前端开发的免费文本编辑器》
《Web前端开发必备手册下载》
《推荐20个让你学习并精通CSS的网站》
《300+Jquery, CSS, MooTools 和 JS的导航菜单资源》


下面一起来了解一下各种不同的CSS框架吧:

1.960 Grid System


CSS-框架-960


960网格系统是一个通过提供通常使用的尺寸简化网站开发流程的努力的结果,基于960像素的页面宽度。它有两种类型,12和16列,他们可以独立使用或是协同使用。


2.WYMstyle CSS Framework


CSS-框架-WYMstyle


这个项目的目的是提供一组经过良好测试的模块化的CSS文件,能够用于网站的快速设计。WYMstyle是一组CSS文件,你可以很容易的组合这些文件来快速的创建你的网站的布局。通过提供可靠的、经过良好测试的CSS模块,WYMstyle 力求让每个网站防止枯燥的跨浏览器兼容性测试。

3.YAML CSS Framework


CSS-框架-YAML


Dirk Jesse的强大的(X)HTML/CSS框架为许多的简单或更复杂的网站项目提供完整的默认模板包。YAML基于网页标准并支持所有现代浏览器。所有的 Internet Explorer的主要渲染漏洞都被解决。YAML 完全支持从5.x到7.0的所有的IE版本。

4.YUI Grids CSS


CSS-框架-YUI


基本的YUI网格CSS提供4种预设的页宽、6种预设模板和再分为2、3、4卷的区块的功能。 这个4KB的文件可提供超过1000中页面布局组合。


有国外作者曾指出YUI Grids CSS中最值得学习的网格布局CSS写法:

  • 负Margin技术
  • 使用度量单位em
  • 清除布局的浮动

5.Logicss Framework


CSS-框架-logicss


Logic CSS 框架是用来减少开发符合web标准的xHTML布局的时间的一个由CSS文件和PHP程序组成的集合。通常跨浏览器表现行为(不是Meyer的reset 文件或是用“*”),排版支持文本字体大小调整(使用EMs) 和垂直居中,符合可定义的灵活的布局网格利用css代码生成工具。

6.CleverCSS


国外-CSS-框架


CleverCSS是一个用于css的受Python启发的小型的标记语言,它可用于以整洁的和结构化的方式创建一个样式表。在很多方面它都比 CSS2整洁和强大。与CSS最明显的区别是句法:它基于缩进而且不单调。虽然这显然违反了Python的规则,它依然是组织样式的很好的主意。

7.Elements CSS Frameworks


CSS-框架-elements


Elements 是一个实用的CSS框架。它是为了帮助设计师更快更高效的来写CSS而建立。Elements 已经超越了仅仅作为一个框架,它有自己的项目工作流。它拥有你完成项目所需的所有东西,这也让你和你的浏览者感到愉悦。阅读 概述 了解更多。

8.Blueprint CSS


CSS-框架-blueprint


Blueprint 是一个 CSS 框架,它的目的是减少你的css开发时间。它提供一个可靠的css基础去创建你的项目,BP由一个易用的网格、合理的布局和一个打印样式。

9.Schema Web Design Framework


CSS-框架-schema


Schema 是一个为了提供在重复的设计任务中必须的CSS和HTML标签而设计的表现层的网页框架设计。 与为每一个新的网站项目从零开始创建HTMl/CSS不同,Schema提供必要的基础来开始并立马让你的设计跑起来。

10.Emastic CSS Framework


CSS-框架-emastic


Emastic 是一个CSS框架,它有连续的任务:探索陌生的新世界,寻找新生活和新的网站空间,大胆的去CSS框架尚未到达的领域。它是轻量的、在页面宽度上比较人性化,在网格中使用固定和不固定的列宽。 Elastic 用“em”布局。

11.That Standards Guy CSS Framework


CSS-框架


* 只能调用单个样式文件
* 主样式需要取得CSS认证(WCAG 1.0);
* 跨浏览器兼容性—包括Internet Explorer (IE) 5.x for Mac;
* IE Hacks使用独立文件;
* 快速创建模板;
* 少量注释/实例演示,可以节省时间来理解。

12.Content with Style Framework


CSS-框架-content


下一个逻辑步骤就是将这个扩展为CSS框架,允许使用写好并通过测试的组件来快速开发网站。实际上所需的是搞定一套命名习惯和一个灵活的基本模板…

13.Boilerplate CSS Framework


CSS-框架-boilerplate

14.ESWAT Web Project Framework


CSS-框架-eswat


ESWAT正在重新整理。如果你是冲着我的网站框架来的,那么你就可以在这里下载。也许你也想看看我的其他项目gmachina、AppleSeed。

15.Tripoli CSS Framework


CSS-框架-tripoli


Tripoli是一个用于HTML表现的通用css规范。通过重设和重建浏览器标准,Tripoli 为你的网站项目提供了一个标准的、跨浏览器表现的基础。


彬Go会经常更新前端开发/网页设计等相关技术及教程文章,欢迎订阅本博客来及时浏览本博客的最新教程及资源。

如何固定表格宽度


<TABLE style="table-layout: auto | fixed">
auto: 默认值
fixed: 宽度固定,截断超出的内容

<TABLE style="word-break: normal | break-all | keep-all">
normal: 默认值,按字词截断换行
break-all: 强行截断并换行
keep-all: 不截断不换行

使用:style="table-layout:fixed;"
表示输出停止,停留在设定的长度内.

使用:style="word-break : break-all;"
表示对超长部分,换行再继续显示.

对于在英文中使用,请使用style="table-layout:fixed; word-wrap:break-word"
推荐使用word-wrap:break-word;word-break:break-all;table-layout:fixed;

==============================================================================

word-wrap同word-break的区别

word-wrap:
normal      Default. Content exceeds the boundaries of its container.
break-word Content wraps to next line, and a word-break occurs when necessary. 必要时会触发word-break。

word-break:
normal      Default. Allows line breaking within words. 好像是只对Asian text起作用。
break-all Behaves the same as normal for Asian text, yet allows the line to break arbitrarily for non-Asian text. This value is suited to Asian text that contains some excerpts of non-Asian text.
keep-all Does not allow word breaking for Chinese, Japanese, and Korean. Functions the same way as normal for all non-Asian languages. This value is optimized for text that includes small amounts of Chinese, Japanese, or Korean.

总结如下:
word-wrap是控制换行的。
使用break-word时,是将强制换行。中文没有任何问题,英文语句也没问题。但是对于长串的英文,就不起作用。


break-word是控制是否断词的。
normal是默认情况,英文单词不被拆开。
break-all,是断开单词。在单词到边界时,下个字母自动到下一行。主要解决了长串英文的问题。
keep-all,是指Chinese, Japanese, and Korean不断词。即只用此时,不用word-wrap,中文就不会换行了。(英文语句正常。)



ie下:
使用word-wrap:break-word;所有的都正常。

ff下:
如这2个都不用的话,中文不会出任何问题。英文语句也不会出问题。但是,长串英文会出问题。
为了解决长串英文,一般用word-wrap:break-word;word-break:break-all;。但是,此方式会导致,普通的英文语句中的单词会被断开(ie下也是)。

目前主要的问题存在于 长串英文 和 英文单词被断开。其实长串英文就是一个比较长的单词而已。
即英文单词应不应该被断开那?那问题很明显了,显然不应该被断开了。
对于长串英文,就是恶意的东西,自然不用去管了。但是,也要想些办法,不让它把容器撑大。
用:overflow:auto; ie下,长串会自动折行。ff下,长串会被遮盖。


所以,综上,最好的方式是word-wrap:break-word;overflow:hidden;而不是word-wrap:break-word;word-break:break-all;。
word-wrap:break-word;overflow:auto;在ie下没有任何问题。在ff下,长串会被遮住部分内容。

另,测试代码如下:

1.htm===================================================================

<style>
.c1{ width:300px;      border:1px solid red}
.c2{ width:300px;word-wrap:break-word;      border:1px solid yellow}
.c3{ width:300px;word-wrap:break-word;word-break:break-all;      border:1px solid green}
.c4{ width:300px;word-wrap:break-word;word-break:keep-all; border:1px solid blue}
.c5{ width:300px;word-break:break-all;      border:1px solid black}
.c6{ width:300px;word-break:keep-all;      border:1px solid red}
.c7{ width:300px;word-wrap:break-word;overflow:auto;      border:1px solid yellow}
</style>

.c1{ width:300px;      border:1px solid red}
<div class="c1">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c1>
This is all English. This is all English. This is all English.
</div>
<div class=c1>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c1>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

<br>
.c2{ width:300px;word-wrap:break-word; border:1px solid yellow}
<div class="c2">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c2>
This is all English. This is all English. This is all English.
</div>
<div class=c2>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c2>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

<br>
.c3{ width:300px;word-wrap:break-word;word-break:break-all;      border:1px solid green}
<div class="c3">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c3>
This is all English. This is all English. This is all English.
</div>
<div class=c3>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c3>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

<br>
.c4{ width:300px;word-wrap:break-word;word-break:keep-all; border:1px solid blue}
<div class="c4">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c4>
This is all English. This is all English. This is all English.
</div>
<div class=c4>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c4>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

<br>
.c5{ width:300px;word-break:break-all;      border:1px solid black}
<div class="c5">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c5>
This is all English. This is all English. This is all English.
</div>
<div class=c5>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c5>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

<br>
.c6{ width:300px;word-break:keep-all;      border:1px solid red}
<div class="c6">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c6>
This is all English. This is all English. This is all English.
</div>
<div class=c6>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c6>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

<br>
.c7{ width:300px;word-wrap:break-word;overflow:auto;      border:1px solid yellow}
<div class="c7">
safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
</div>
<div class=c7>
This is all English. This is all English. This is all English.
</div>
<div class=c7>
全是中文的情况。全是中文的情况。全是中文的情况。
</div>
<div class=c7>
中英文混排的情况。Chinese and English. 中英文混排的情况。Chinese and English.
</div>

转自:http://blog.csdn.net/cjh47349038/archive/2009/04/09/4058680.aspx

Wednesday, September 8, 2010

CSS实现将div固定在页面指定地方

用一个div作为提示信息或者与用户交互的层控件,需要让它随着页面的滚动而固定在屏幕的某个地方。js可以实现这个功能,当页面滑动的时候,计算位置,然后改变div的top属性即可。但是这样作出来的效果,恐怕没人会满意,因为抖的太厉害了,不能很及时的改变位置。
      要是能做到平滑的,一点都看不出来的技术来达到这种效果,恐怕只有css了。



<html> 
<head> 
    <title></title> 
    <style type="text/css">  
       html,body { 
            overflow:hidden; 
            margin:0px; 
            width:100%; 
            height:100%; 
        } 
 
        .virtual_body { 
            width:100%; 
            height:100%; 
            overflow-y:scroll; 
            overflow-x:auto; 
        } 
 
        .fixed_div { 
            position:absolute; 
            z-index:2008; 
            bottom:20px; 
            left:40px; 
            width:800px; 
            height:40px; 
            border:1px solid red; 
            background:#e5e5e5; 
        } 
    </style> 
</head> 
 
<body> 
<div class="fixed_div">I am still here!</div> 
<div class="virtual_body"> 
    <div style="height:1800px;"> 
        I am content ! 
    </div> 
</div> 
</body> 
</html>  

效果非常好,呵呵。




转自:http://blog.csdn.net/xieyaa/archive/2009/07/20/4363981.aspx

Wednesday, August 4, 2010

css select

效果图:
css select
结构分析图:
css select

下载地址:div css模拟美化的Select样式

div css模拟美化的Select样式演示地址




完整代码:
这是index.html文件代码

<!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-8" />
<title>Select Demo</title>
<style type="text/css">
<!--
@import url(select2css.css);
-->
</style>
<script type="text/javascript" src="select2css.js"></script>
</head>
<body>
<form id="form" name="form" method="post" action="">

演示来源:http://mawendong.cn/
<br /><br />
<div id="uboxstyle">
<h3 style="color:#6D93AB;font-size:14px;">U-Box Style</h3>
<select name="language" id="language">
<option value="English" selected="selected">English</option>
<option value="简体中文" >简体中文</option>
<option value="日本語" >日本語</option>
<option value="Deutsch" >Deutsch</option>
<option value="Espa?ol" >Espa?ol</option>
<option value="Fran?ais" >Fran?ais</option>
<option value="Italiano" >Italiano</option>
<option value="Polski" >Polski</option>
<option value="Português" >Português</option>
<option value="Svenska" >Svenska</option>
<option value="Türk?e" >Türk?e</option>
<option value="Руccкий" >Руccкий</option>
</select>
</div>
<br /><br />
<h3 style="color:#6D93AB;font-size:14px;">Mac Style</h3>
<div id="macstyle">
<select name="language_mac" id="language_mac">
<option value="English" selected="selected">English</option>
<option value="简体中文" >简体中文</option>
<option value="日本語" >日本語</option>
<option value="Deutsch" >Deutsch</option>
<option value="Espa?ol" >Espa?ol</option>
<option value="Fran?ais" >Fran?ais</option>
<option value="Italiano" >Italiano</option>
<option value="Polski" >Polski</option>
<option value="Português" >Português</option>
<option value="Svenska" >Svenska</option>
<option value="Türk?e" >Türk?e</option>
<option value="Руccкий" >Руccкий</option>
</select>
</div>
<br /><br />
<h3 style="color:#6D93AB;font-size:14px;">TM2008 Style</h3>
<div id="tm2008style">
<select name="language_tm2008" id="language_tm2008">
<option value="English">English</option>
<option value="简体中文" >简体中文</option>
<option value="日本語" >日本語</option>
<option value="Deutsch" >Deutsch</option>
<option value="Espa?ol" >Espa?ol</option>
<option value="Fran?ais" >Fran?ais</option>
<option value="Italiano" >Italiano</option>
<option value="Polski" >Polski</option>
<option value="Português" >Português</option>
<option value="Svenska" >Svenska</option>
<option value="Türk?e" >Türk?e</option>
<option value="Руccкий" >Руccкий</option>
</select>
</div>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

</form>
</body>
</html>

这是select2css.css样式文件:
body{background:#CFDFEF;font:12px/150% "Lucida Grande", Arial, Verdana, Helvetica, sans-serif;}

#uboxstyle .select_box{width:100px;height:24px;}

#macstyle .select_box{width:91px;height:24px;}

#tm2008style .select_box{width:102px;height:24px;}

#uboxstyle div.tag_select{display:block;color:#79A2BD;width:80px;height:24px;background:transparent url("ubox-select.gif") no-repeat 0 0;padding:0 10px;line-height:24px;}
#uboxstyle div.tag_select_hover{display:block;color:#79A2BD;width:80px;height:24px;background:transparent url("ubox-select.gif") no-repeat 0 -24px;padding:0 10px;line-height:24px;}
#uboxstyle div.tag_select_open{display:block;color:#79A2BD;width:80px;height:24px;background:transparent url("ubox-select.gif") no-repeat 0 -48px;padding:0 10px;line-height:24px;}

#uboxstyle ul.tag_options{position:absolute;padding:0;margin:0;list-style:none;background:transparent url("ubox-select.gif") no-repeat right bottom;width:100px;padding:0 0 5px;margin:0;}
#uboxstyle ul.tag_options li{background:transparent url("ubox-select.gif") repeat-y -100px 0;display:block;width:80px;padding:0 10px;height:24px;text-decoration:none;line-height:24px;color:#79A2BD;}

#uboxstyle ul.tag_options li.open_hover{background:transparent url("ubox-select.gif") no-repeat 0 -72px;color:#fff}
#uboxstyle ul.tag_options li.open_selected{background:transparent url("ubox-select.gif") no-repeat 0 -96px;color:#fff}

#macstyle div.tag_select{display:block;color:#000;width:71px;height:24px;background:transparent url("mac-select.gif") no-repeat 0 -24px;padding:0 10px;line-height:24px;}
#macstyle div.tag_select_hover{display:block;color:#000;width:71px;height:24px;background:transparent url("mac-select.gif") no-repeat 0 0;padding:0 10px;line-height:24px;}
#macstyle div.tag_select_open{display:block;color:#000;width:71px;height:24px;background:transparent url("mac-select.gif") no-repeat 0 -48px;padding:0 10px;line-height:24px;}

#macstyle ul.tag_options{position:absolute;margin:-4px 0 0;list-style:none;background:transparent url("mac-select.gif") no-repeat left bottom;width:100px;padding:0 0 5px;margin:0;width:71px;}
#macstyle ul.tag_options li{background:transparent url("mac-select.gif") repeat-y -91px 0;display:block;width:61px;padding:0 0 0 10px;height:24px;text-decoration:none;line-height:24px;color:#000;}

#macstyle ul.tag_options li.open_hover{background:transparent url("mac-select.gif") no-repeat -162px 0;color:#000}
#macstyle ul.tag_options li.open_selected{background:transparent url("mac-select.gif") no-repeat -162px -24px;color:#fff}

#tm2008style div.tag_select{display:block;color:#000;width:82px;height:22px;background:transparent url("tm2008-select.gif") no-repeat 0 0;padding:0 10px;line-height:22px;}
#tm2008style div.tag_select_hover{display:block;color:#000;width:82px;height:22px;background:transparent url("tm2008-select.gif") no-repeat 0 -22px;padding:0 10px;line-height:22px;}
#tm2008style div.tag_select_open{display:block;color:#000;width:82px;height:22px;background:transparent url("tm2008-select.gif") no-repeat 0 -44px;padding:0 10px;line-height:22px;}

#tm2008style ul.tag_options{position:absolute;margin:0;list-style:none;background:transparent url("tm2008-select.gif") no-repeat left bottom;width:100px;padding:0 0 1px;margin:0;width:80px;}
#tm2008style ul.tag_options li{background:transparent url("tm2008-select.gif") repeat-y -102px 0;display:block;width:61px;padding:0 10px;height:22px;text-decoration:none;line-height:22px;color:#000;}

#tm2008style ul.tag_options li.open_hover{background:transparent url("tm2008-select.gif") no-repeat 0 -88px;color:#000}
#tm2008style ul.tag_options li.open_selected{background:transparent url("tm2008-select.gif") no-repeat 0 -66px;color:#19555F}

这是select2css.js文件:

var selects = document.getElementsByTagName_r('select');

var isIE = (document.all && window.ActiveXObject && !window.opera) ? true : false;

function $(id) {
return document.getElementByIdx_x(id);
}

function stopBubbling (ev) {
ev.stopPropagation();
}

function rSelects() {
for (i=0;i<selects.length;i++){
selects[i].style.display = 'none';
select_tag = document.createElement_x('div');
select_tag.id = 'select_' + selects[i].name;
select_tag.className = 'select_box';
selects[i].parentNode.insertBefore(select_tag,selects[i]);

   select_info = document.createElement_x('div');
select_info.id = 'select_info_' + selects[i].name;
select_info.className='tag_select';
select_info.style.cursor='pointer';
select_tag.appendChild(select_info);

   select_ul = document.createElement_x('ul');
select_ul.id = 'options_' + selects[i].name;
select_ul.className = 'tag_options';
select_ul.style.position='absolute';
select_ul.style.display='none';
select_ul.style.zIndex='999';
select_tag.appendChild(select_ul);

   rOptions(i,selects[i].name);

mouseSelects(selects[i].name);

   if (isIE){
selects[i].onclick = new Function("clickLabels3('"+selects[i].name+"');window.event.cancelBubble = true;");
}
else if(!isIE){
selects[i].onclick = new Function("clickLabels3('"+selects[i].name+"')");
selects[i].addEventListener("click", stopBubbling, false);
} 
}
}


function rOptions(i, name) {
var options = selects[i].getElementsByTagName_r('option');
var options_ul = 'options_' + name;
for (n=0;n<selects[i].options.length;n++){
option_li = document.createElement_x('li');
option_li.style.cursor='pointer';
option_li.className='open';
$(options_ul).appendChild(option_li);

   option_text = document.createTextNode(selects[i].options[n].text);
option_li.appendChild(option_text);

   option_selected = selects[i].options[n].selected;

   if(option_selected){
option_li.className='open_selected';
option_li.id='selected_' + name;
$('select_info_' + name).appendChild(document.createTextNode(option_li.innerHTML));
}

option_li.onmouseover = function(){ this.className='open_hover';}
option_li.onmouseout = function(){
if(this.id=='selected_' + name){
this.className='open_selected';
}
else {
this.className='open';
}
}

option_li.onclick = new Function("clickOptions("+i+","+n+",'"+selects[i].name+"')");
}
}

function mouseSelects(name){
var sincn = 'select_info_' + name;

$(sincn).onmouseover = function(){ if(this.className=='tag_select') this.className='tag_select_hover'; }
$(sincn).onmouseout = function(){ if(this.className=='tag_select_hover') this.className='tag_select'; }

if (isIE){
$(sincn).onclick = new Function("clickSelects('"+name+"');window.event.cancelBubble = true;");
}
else if(!isIE){
$(sincn).onclick = new Function("clickSelects('"+name+"');");
$('select_info_' +name).addEventListener("click", stopBubbling, false);
}

}

function clickSelects(name){
var sincn = 'select_info_' + name;
var sinul = 'options_' + name;

for (i=0;i<selects.length;i++){
if(selects[i].name == name){   
if( $(sincn).className =='tag_select_hover'){
$(sincn).className ='tag_select_open';
$(sinul).style.display = '';
}
else if( $(sincn).className =='tag_select_open'){
$(sincn).className = 'tag_select_hover';
$(sinul).style.display = 'none';
}
}
else{
$('select_info_' + selects[i].name).className = 'tag_select';
$('options_' + selects[i].name).style.display = 'none';
}
}

}

function clickOptions(i, n, name){ 
var li = $('options_' + name).getElementsByTagName_r('li');

$('selected_' + name).className='open';
$('selected_' + name).id='';
li[n].id='selected_' + name;
li[n].className='open_hover';
$('select_' + name).removeChild($('select_info_' + name));

select_info = document.createElement_x('div');
select_info.id = 'select_info_' + name;
select_info.className='tag_select';
select_info.style.cursor='pointer';
$('options_' + name).parentNode.insertBefore(select_info,$('options_' + name));

mouseSelects(name);

$('select_info_' + name).appendChild(document.createTextNode(li[n].innerHTML));
$( 'options_' + name ).style.display = 'none' ;
$( 'select_info_' + name ).className = 'tag_select';
selects[i].options[n].selected = 'selected';

}

window.onload = function(e) {
bodyclick = document.getElementsByTagName_r('body').item(0);
rSelects();
bodyclick.onclick = function(){
for (i=0;i<selects.length;i++){
$('select_info_' + selects[i].name).className = 'tag_select';
$('options_' + selects[i].name).style.display = 'none';
}
}
}

这是用到的文件截图:

css select

图片分别为:

css select
css select
css select

Tuesday, August 3, 2010

div + css 实现在网页最上层加东西


转自:http://hi.baidu.com/bzhyong/blog/item/887d623c83c8bde23d6d9791.html

最近在盗别人的网页,一点点修改,麻烦至极。突然发现用div+css就能直接用我的图片把原来网页的东西给盖住,原来网页的东西不动就能实现我要的效果。高兴呀



<div   align="center"   id="b"   style="filter:alpha(opacity=100);position:absolute;z-index:1001;top:300px;left:300px;width:300px;height:200px;background-color:#ffffff;"></div>
filter:alpha(opacity=100);是设置透明度的
position:absolute 设置层位置,absolute是绝对位置
z-index:1001 是层的排序,值越大越靠上
top:300px 距顶端300像素
left:300px 距左边300像素
width:300px 层宽度是300像素
height:200px 层高度是200像素
background-color:#ffffff 背景色是白色