ruby-on-rails – 好的CSS闪存(也称为Rails中的信息消息,在OSX中
我很难得到CSS的工作,像我想要它的闪光(当您登录或做某事或什么不能确认您的行动,例如在Rails中显示的那些小信息).
我想要: >生活在任意任意div 我为此看到的大部分CSS并没有做到这一点.大多数指定一个固定的宽度,这意味着它被包装不好或者填充太多了. 我该怎么做? (或者,为什么不能?) 这是我现在的CSS: <div class="flash info"> <span class="close"><a href="AJAX callback">X</a></span> Some informational text here that can be closed w/ the X </div> <div class="flash error"> Some other simultaneous error </div> .flash { text-align: center; padding: .3em .4em; margin: 0 auto .5em; clear: both; max-width: 46.923em; /* 610/13 */ *max-width: 45.750em; /* 610/13.3333 - for IE */ } .flash.error { border: thin solid #8b0000; background: #ffc0cb; } .flash.notice,.flash.info { border: thin solid #ff0; background: #ffe; } .flash.warning { border: thin solid #b8860b; background: #ff0; } .flash .close { float: right; } .flash .close a { color: #f00; text-decoration: none; } 奖金积分:我通过下面的工具提示代码实现了我只想要的部分;即不能包装. 由于某种原因,除非指定了nowrap或width,否则默认值的宽度非常小.我不知道为什么,或者如何使它只是包装在一个特定的,更宽的宽度(如我想要发生在闪光). Some text with <span class="tooltip">info <span>i can has info?</span></span> about a word .tooltip { position: relative; /*this is the key*/ background-color: #ffa; } .tooltip:hover{ background-color: #ff6; } .tooltip span { display: none } .tooltip:hover span { /*the span will display just on :hover state*/ z-index: 1; display: block; position: absolute; top: 1.6em; left: 0; border: thin solid #ff0; background: #ffe; padding: .3em .6em; text-align: left; white-space: nowrap; } 谢谢! > Sai 解决方法
这些是Javascript中通知的有趣尝试,第一个有一个中心的通知,也许你可以从中获得灵感.
Growl like (mootools) ROAR (this one is really good) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |