在将 doctype 声明为 Html 代码时,任何浏览器都不会计算“#help”的顶部和右侧样式:
<div id="events">
<img src="media/Event icon.png" alt="events" id="events_img">
</div>
<div id="colors" >
<img src="media/CULTURAL.png" alt="Colours" id="Colors_img">
</div>
<div id="hospitality">
<img src="media/117016-matte-blue-and-white-square-icon-business-notepad.png" alt="hospitality" id="hospitality_img">
</div>
<div id="help">
<img id="help_img" src="media/Help.png" alt="help">
</div>
<img src="media/cadbell.fw.png" alt="cadbell" id="cadbell">
<img src="media/cadbell2.fw.png" alt="cadbell" id="cadbell2">
<img src="media/Bird-blue-icon.png" alt="angry bird" id="angry_bird">
<div id='bottom-div'></div>
<img src="media/stick.fw.png" alt="stick" id="stick">
<span id="dev"><b>Developed by:  </b><a href='#'>D Akhil Reddy</a></span>
</div>
</div>
我只为 #help 及其子元素 #help_img 提供了 css 样式,顶部和右侧不起作用,#help 的 css 样式:
#help{
position: absolute;
right: 320;
top: 390;
cursor: pointer;
width: 137px;
}
#help_img{
position:absolute;
left:10px;
}