【发布时间】:2014-12-20 19:47:58
【问题描述】:
我正在使用引导程序在 div 中显示一些缩略图。缩略图实际上是画布,因为我需要在客户端创建更轻的缩略图。
它实际上并不是完美的设计(我更像是一名开发人员而不是设计师)但它工作得很好。
但是我想知道以下几点:当我用手机以纵向模式查看应用程序时,我得到 col-xs-6 类,并且屏幕看起来很好。但是当我旋转屏幕时,我似乎仍然得到 col-xs-6 及其相关的像素大小 - 看起来很丑 - 截图:
旋转屏幕: http://imgur.com/cNTGWy0
正常屏幕: http://imgur.com/ZHlwq42
这是手机或手机浏览器(使用 Galaxy S3)上的错误 - 还是我的代码错误?旋转浏览器不应该给出不同的分辨率吗?我是否应该忽略这个问题,因为也许没有优雅的解决方案? 这是 HTML:
<div id="upload-list">
<!-- for each image -->
<div class="col-xs-6 col-sm-3 col-md-3">
<div class="thumbnail">
<div class="caption">IMG_0004.JPG<i><br>6.14 MB</i></div>
<div style="display: none;" class="abort_upload working">
<span class="alert-warning glyphicon glyphicon-remove-circle"></span>
</div>
<!-- This is for upload progress display -->
<div class="knob-outer">
<div class="knob-progress">
<div style="display:inline;width:64px;height:64px;">
<canvas height="64" width="64"></canvas>
<input style="width: 36px; height: 21px; position: absolute; vertical-align: middle; margin-top: 21px; margin-left: -50px; border: 0px none; background: none repeat scroll 0% 0% transparent; font: bold 12px Arial; text-align: center; color: rgb(7, 136, 165); padding: 0px;" readonly="readonly" value="0" data-width="64" data-height="64" data-fgcolor="#0788a5" data-readonly="1" data-bgcolor="#3e4043" type="text">
</div>
</div>
</div>
<!-- the actual canvas with the image, is being generated client-side after file selection -->
<canvas class="canvas-thumbnail" height="518" width="691"></canvas>
</div>
</div>
</div>
相关CSS:
@media (min-width: $screen-xs-min) {
.thumbnail canvas.canvas-thumbnail { height:72px !important; width: 96px !important}
.knob-progress {width: 64px; height: 64px}
}
$screen-xs: 420px !default;
$screen-xs-min: $screen-xs !default;
编辑:其他屏幕尺寸 css
$screen-sm: 768px !default;
$screen-sm-min: $screen-sm !default;
$screen-md: 992px !default;
$screen-md-min: $screen-md !default;
@media (min-width: $screen-sm-min) {
.thumbnail canvas.canvas-thumbnail { height:64px !important; width: 86px !important}
}
@media (min-width: $screen-md-min) {
.thumbnail canvas.canvas-thumbnail { height:95px !important; width: 126px !important}
}
【问题讨论】:
标签: android html css twitter-bootstrap responsive-design