【发布时间】:2018-10-10 17:37:37
【问题描述】:
我在 sencha extjs 应用程序中有一个容器,里面有一个 img div,位于容器的左侧。我希望它居中,这样旋转就可以了(因为我已经将图像拟合到最长的尺寸)。
<div class="x-component ih-image-container x-box-item x-component-default"
style="width: 516px; overflow: auto !important; right: auto; left: 0px; margin: 0px; top: 30px; height: 429px;"
id="component-1990">
<img class="ih-image"
style="max-width: 100%; max-height: 100%; border-left: 1px solid rgba(0, 0, 0, 0.1); border-right: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1); transition: all 0.25s ease-in-out 0s; transform: rotate(0deg) scale(1); width: auto;"
src="/viewer/image/urlabridged" data-rotate="0" data-scale="1">
</div>
我已经尝试添加这些都没有效果,来自类似问题的 SO
垂直对齐:中间;
文本对齐:居中;
显示:块
可能包含这些的其他 extjs 容器正在发生变化。
【问题讨论】:
-
添加浮动:左;文本对齐:居中;到 div
标签: javascript html extjs