易截截图软件、单文件、免安装、纯绿色、仅160KB

怎么让input里的text和button使用不同的css样式


当你看到<input>这个html标签的时候,你会想到什么?一个文本框?一个按钮?一个单选框?一个复选框?……对,对,对,它们都对。也许你可能想不到,这个小小的input竟然可以创造出10个不同的东西,下面是个列表,看看,哪些是你没有想到的:
<input type="text" /> 文本框
<input type="password" /> 密码框
<input type="submit" /> 提交按钮
<input type="reset" /> 重置按钮
<input type="radio" /> 单选框
<input type="checkbox" /> 复选框
<input type="button" /> 普通按钮
<input type="file" /> 文件选择控件
<input type="hidden" /> 隐藏框
<input type="image" /> 图片按钮
 所以你可能会说,input真是一个伟大的东西,竟然这么有“搞头”,但是当你真正在项目中试图给不同的控件设置不同的样式时,你就会发现,input真的可以把“你的头搞大”。我不知道为什么当初要给input赋予那么多身份,但是,他的“N重身份”给网站设计者的确带来了不少的麻烦。好在,劳动人民是伟大的,解决问题的办法还是有滴~,虽然它们都有各自致命的缺点 Orz… 解放方法大致归纳一下,列表如下(小弟才疏,错误遗漏难免,还请各位高人指点):
1.用css的expression判断表达式
2.用css中的type选择器
3.用javascript脚本实现
4.如果你用Microsoft Visual Studio 2005 或者后续版本开发项目,恭喜,你还可以使用skin。
下面就来讲解一下各个办法的详细实现和它们的优缺点。
1:用css的expression判断表达式
实现代码参考:
<!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>
    <title> diffInput2 </title>
    <meta name="Author" content="JustinYoung"/>
    <meta name="Keywords" content=""/>
    <meta name="Description" content=""/>
    <meta http-equiv="Content-Type" conte


相关文档:

目前最全的浏览器/CSS选择器兼容性总结

2009年2月24日
,Safari 4.0
beta版正式发布,Safari从它的3.2版本开始就已经支持所有的CSS选择器(包括最新的CSS3)。不过为了方便大家的工作,下面提供了最新版
本的CSS选择器浏览器支持情况,其中包括最新的CSS3和Safari 4.0 Beta的支持情况。感谢Estelle Weyl
的总结。
2009年6月30日
,FireFox 3.5发布,类似Safar ......

Alert 中的字体通过css设置


Alert{
backgroundColor: #2791DB;
headerColors:#2791DB,#2791DB;
borderThicknessLeft:0;
borderThicknessRight:0;
borderThicknessTop:0;
            font-size:14;
            buttonStyleName: myCustomButtonStyleName;
}
.myCus ......

CSS基础练习

-----------------------------------------------
链接外面文件css
<link href="layout.css" rel="stylesheet" type="text/css" />
-----------------------------------------------
写文本 :  <div id="mainContent">
    <p>1列固定宽度居中+头部+导航+尾部—&mdash ......

IE7 CSS trouble

When you meet trouble with css style in IE7, try this. You can set different css for IE7 and the other browsers.
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/home_c_ie7.css" mce_href="home_c_ie7.css" />
<![endif]-->
......

CSS默认重设

body{ background:#FFFFFF; font-size:12px; font-family:‘宋体’, Arial, Helvetica, sans-serif;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,table,th,td,
img{margin:0;padding:0;}
.partA,.partB,.partC,.partD,.partE,.partF,.partG,.partH,.partI,. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号