这是我的代码:
<div id ="game">
<div id = "prodClick">
Prod/Click:
<div id="test">
</div>
</div>
<div id = "image">
<image src="assets/ressources.png" usemap="#upgrade" class = "mainImage"></image>
<map name="upgrade">
<area shape="circle" style="display:block;" coords="98,46,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="390,38,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="98,436,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="395,436,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="208,185,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="322,183,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="208,305,22" href="/login/game/upgrade/boisClick.php">
<area shape="circle" style="display:block;" coords="322,303,22" href="/login/game/upgrade/boisClick.php">
</map>
</div>
<div id = "info">
Prod/Heure
</div>
</div>
<div id="end">
</div>
因此game
div的宽度为1000px
,高度为500px
。
ProdClick
div的宽度为250px
,高度为500px
。
image
div的宽度为500px
,高度为500px
。
...
问题是prodClick
被正确放置但是它用一种边距填充了宽度的其余部分
然后我有image
div而不是prodClick
div的右边,因为它被边缘填充
任何解决方案对不起我的英语我是法国人
答案 0 :(得分:1)
在 CSS :
中#prodClick, #image{
display: inline-block; // get rid off unnecessary margin
}
顺便说一句,你的英语是 parfait !的: - )强>