我有一个奇怪的问题。我有一些图标是基于 JSP 中的一些包含构建的,没有深入了解我有三个图标,并且两个完美地排列在一起。最底层的是问题。你能根据源代码看出是什么原因造成的吗?
这就是它的样子
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>