我有一个奇怪的问题。我有一些图标是根据JSP中的某些内容构建的,没有深入讨论,我有三个图标,两个图标完美对齐。底部的是问题。你能看到基于源代码是什么导致了这个?DIV中的HTML图标不连续
这是什么样子
2下面的图标是<ul id="hp-dd-menu"
呈现的HTML:
<div id="iconDiv">
<a id="scroll" href="show.hotpartslist?scroll=true&topcursortorder=DESC&topcursortprop=auditable.createdDate">
<img class="icon" alt="Enable Scrolling" src="../images/scroll_enable.gif"/>
</a>
<a href='show.hotpartslist?excel=true'>
<img class="icon" alt="Download to Microsoft Excel" src="../images/excel.gif"/>
</a>
<ul id="hp-dd-menu" style="display:none;"><li><img alt="Pick Date to Display" class="icon" src="../images/calendar/calendar.gif" /><ul><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=auditable.createdDate&topsortprop=auditable.createdDate&dateToDisplay=ADDED">→ ADDED</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastMCRemarkDate&topsortprop=lastMCRemarkDate&dateToDisplay=MC"> MC</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastSOSRemarkDate&topsortprop=lastSOSRemarkDate&dateToDisplay=SOS"> SOS</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastMDRemarkDate&topsortprop=lastMDRemarkDate&dateToDisplay=MMC"> MMC</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastOtherRemarkDate&topsortprop=lastOtherRemarkDate&dateToDisplay=OTHER"> OTHER</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=impactDate&topsortprop=impactDate&dateToDisplay=IMPACT"> IMPACT</a></li></ul></li></ul>
<script type="text/javascript">
$(function()
{
try
{
DynarchMenu.setup('hp-dd-menu', { });
}
catch(exception)
{
alert("Failed to render other menu: " + exception.description);
}
});
CSS:
* Used to add non-standard icons to the top right icon list. */
#iconDiv
{
float: right;
width:120px;
}
如果我是移动两个<a
标记出div
的话,我可以让他们在同一行,但在它们之间的差距:
渲染HTML:
<a id="scroll" href="show.hotpartslist?scroll=true&topcursortorder=DESC&topcursortprop=auditable.createdDate">
<img class="icon" alt="Enable Scrolling" src="../images/scroll_enable.gif"/>
</a>
<a href='show.hotpartslist?excel=true'>
<img class="icon" alt="Download to Microsoft Excel" src="../images/excel.gif"/>
</a>
<div id="iconDiv">
<ul id="hp-dd-menu" style="display:none;"><li><img alt="Pick Date to Display" class="icon" src="../images/calendar/calendar.gif" /><ul><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=auditable.createdDate&topsortprop=auditable.createdDate&dateToDisplay=ADDED">→ ADDED</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastMCRemarkDate&topsortprop=lastMCRemarkDate&dateToDisplay=MC"> MC</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastSOSRemarkDate&topsortprop=lastSOSRemarkDate&dateToDisplay=SOS"> SOS</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastMDRemarkDate&topsortprop=lastMDRemarkDate&dateToDisplay=MMC"> MMC</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastOtherRemarkDate&topsortprop=lastOtherRemarkDate&dateToDisplay=OTHER"> OTHER</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=impactDate&topsortprop=impactDate&dateToDisplay=IMPACT"> IMPACT</a></li></ul></li></ul>
<script type="text/javascript">
$(function()
{
try
{
DynarchMenu.setup('hp-dd-menu', { });
}
catch(exception)
{
alert("Failed to render other menu: " + exception.description);
}
});
</script>
我只是试图让所有三个在同一行中彼此相邻。
编辑:
<div style="float:right">
<a id="scroll" href="show.hotpartslist?scroll=true&topcursortorder=DESC&topcursortprop=auditable.createdDate">
<img class="icon" alt="Enable Scrolling" src="../images/scroll_enable.gif"/>
</a>
</div>
<a href='show.hotpartslist?excel=true'>
<img class="icon" alt="Download to Microsoft Excel" src="../images/excel.gif"/>
</a>
<div style="float:right">
<ul id="hp-dd-menu" style="display:none;"><li><img alt="Pick Date to Display" class="icon" src="../images/calendar/calendar.gif" /><ul><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=auditable.createdDate&topsortprop=auditable.createdDate&dateToDisplay=ADDED">→ ADDED</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastMCRemarkDate&topsortprop=lastMCRemarkDate&dateToDisplay=MC"> MC</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastSOSRemarkDate&topsortprop=lastSOSRemarkDate&dateToDisplay=SOS"> SOS</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastMDRemarkDate&topsortprop=lastMDRemarkDate&dateToDisplay=MMC"> MMC</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=lastOtherRemarkDate&topsortprop=lastOtherRemarkDate&dateToDisplay=OTHER"> OTHER</a></li><li><a href="show.hotpartslist?sorttype=top&topcursortorder=ASC&defaultSort=true&defaultOrder=ASC&topcursortprop=impactDate&topsortprop=impactDate&dateToDisplay=IMPACT"> IMPACT</a></li></ul></li></ul>
<!-- close the icon div since we specified 'other' -->
</div>
</div>
图标本身是否有透明区域?尝试用他们周围的边框绘制它们。 – 2012-04-06 14:18:31