19
2009
4

CSS实现文本框发光,类似chrome和safari

像 Chrome, Safari 一样当前输入框发光,将下面的样式添加到 CSS 中就可以了。

input:focus, select:focus, textarea:focus {
outline: 2px solid #ebc476;
-moz-outline-radius: 5px; !important
}

另一个,这段取自Gmail的:

input:focus, select:focus, textarea:focus {
border:2px solid #BBDAFD !important;
margin:0 !important;
outline-color:-moz-use-text-color !important;
outline-style:none !important;
outline-width:0 !important;
}

Written by Nffish in: CSS |

13
2009
2

CSS控制滚动条滚动时页面背景不动

以前在阿里巴巴上看到这个效果,一直好奇是怎么实现的.今天又偶然看到,Google了一下

CSS有个 background-attachment 属性 设置背景图像是否固定或者随着页面的其余部分滚动。
例子:

body
  {
  background-image: url(stars.gif);
  background-attachment: fixed
  }

还可以用javascript动态改变
Object.style.backgroundAttachment=scroll|fixed//固定
参考:http://www.w3school.com.cn/css/pr_background-attachment.asp

Written by Nffish in: CSS | 标签:, , ,

Powered By Wordpress Theme AEROTRONIC |
除非另有声明,本网站采用知识共享“署名 2.5 中国大陆”许可协议授权。