我創建選項卡式部分與標籤標題爲H2如下:配售圖像是在WebContent文件夾中的H2標籤在HTML
<div class="mainTab">
<div class="myTab">
<h2>Tab1</h2>
Tab1 content here
</div>
<div class="mtTab">
<h2>Tab2</h2>
Tab2 content here
</div>
<div>
我想要的標籤標題,前放置一個圖像。像電子郵件標籤標題之前的電子郵件圖
這可以通過類似方式實現:
.h2one {
font-size: 36px;
font-weight: bold;
background: url ('http://images.findicons.com/files/icons/1676/primo/128/email_open.png') center left no-repeat;
padding-left: 120px;
}
.h2two {
font-size: 36px;
font-weight: bold;
background: url('http://images.findicons.com/files/icons/1676/primo/128/email_close.png') center left no-repeat;
padding-left: 120px;
}
如果什麼圖像都在我的服務器的WebContent文件夾。在這種情況下,url將如何顯示。將< =%request.getContextPath>在這裏工作????
這裏有一個小的jsfiddle做什麼,我想你正在嘗試做的:http://jsfiddle.net/NqXhB/1/ –