我正在寻找关于如何实现这样的一些帮助:奇怪的CSS股利 - 帮助需要
img http://img1.firenex.net/ssFan8c00f9Ul1QnQzGt.png
困难的是,带状图像是这个DIV的头,而我想根据我在其中写入多少文本,整个包装的高度是自动的。
我无法从中找到出路。任何帮助?
这是我现在的代码。
<div id="sidebar">
<div class="sidebarElementWrapper"><div class="sidebarElement"></div></div>
</div>
的CSS(认为这是一个侧边栏):
#sidebar {
width: 225px;
height: auto;
margin-top: 10px;
margin-left: 20px;
min-height: 100px;
float: left;
}
.sidebarElement {
width: 244px;
min-height: 100px;
margin-top: 10px;
background: url(img/ribbon.png) no-repeat top center;
}
.sidebarElementWrapper {
width: 244px;
height: auto;
min-height: 20px;
background: url(img/SidebarElementWrapper.png) repeat-y;
}
它的工作原理,但是当我在它的内部输入一些文字,并设置一些填充,它只是打破了..
发布代码将有很大帮助.. – lifetimes
完成!刚刚发布 – wiredmark