【发布时间】:2013-06-02 03:54:21
【问题描述】:
我有一张尺寸为 2350*180 的图片。
我正在研究电话差距。所以,我需要以通用格式提供代码,以便它适用于任何设备。
现在,我有一张大图的背景图。
style="background:url("img/bg.png") no-repeat fixed center top; width:100%; height:100%; "
此代码仅适用于少数人。我的代码有错误吗?
另一个问题,当我滚动时,滚动条可见。所以我添加了
style="overflow:hidden;"
<img src=""/> tag.
我是正确的还是应该添加任何其他代码?
编辑:
HTML
<body style="style="background:url("img/bg.png") no-repeat fixed center top; width:100%; height:100%;" class="body">
<div id="image" class="noSelect">
<table class="table">
<tr>
<td class="main">
<img src="http://www.rhpstudio.com/images/google_icon.png" alt="map" usemap="#map" style="overflow:hidden;" />
</td>
</tr>
</table>
</body>
我在代码中考虑了这个背景 background:url("img/bg.png"),而 中给出的这张图片是一个示例但是它的尺寸是2350*180。
EDIT:2-->整个代码
HTML 代码:
<body style="background-image:url(img/bg.png);" class="body">
<div id="image" class="noSelect" style="height:100%;">
<table class="table">
<tr>
<td class="main">
<img src="img/list.png" alt="bloodtestmap" usemap="#bloodtestmap" class="noSelect" style="overflow:hidden;" />
</td>
</tr>
</table>
CSS 代码:
.body, .main_html
{
height: 100%;
margin: 0;
}
.body
{
overflow: hidden;
background-size: 100% 100%;
}
.table
{
width: 100%;
height: 100%;
text-align: center;
}
.main
{
max-width: 100%;
vertical-align: middle;
}
【问题讨论】:
标签: html css cordova media-queries cordova-2.0.0