这是 8 个内容相同但存在一些问题的浮动块:
- 如果我使用padding:10px为sideblock .inner创建“边框”它不起作用(填充底部看起来像消失了)
- 如果我将光标放在块上 - 它不能出现在顶部,并且不要移动其他块
如何使块工作良好?HTML:
<div class="sideblock"><div class="style-menu"><div class="inner">
Everything around you that you call life was made up by people that were no smarter than you, and you can change it, you can influence it, you can build your own things that other people can use.</div></div></div>
CSS:
.sideblock {
width: 220px;
height: 80px;
overflow: hidden;
margin: 10px;
float: left;
}
.sideblock .inner {
background: #ffffff;
padding: 10px;}
.sideblock .style-menu {
padding: 3px;
background: #157ba1;
background: linear-gradient(to right, #157ba1 0%,#5fa31c 100%);}
.sideblock:hover {
box-shadow: 0px 0px 5px #000;
overflow: visible;
height: auto;}
这是我的代码 - http://jsfiddle.net/2HqZV/1/
谢谢支持