我正在处理这个页面: http://tinyurl.com/ok9wzro
主图像(建筑物)向左侧移动。我希望它与下面的内容很好地对齐(居中)。 我希望它在所有屏幕尺寸上看起来都相似。
如有任何帮助,我们将不胜感激。
谢谢..
抱歉链接,它只在我们的内部网上运行。这是我的代码:
<header style="background-image:none; background-size: none;background-color:#fff; height:410px;border-bottom:none" >
<div style="width: 76%; margin: auto;">
<div style="float: left; width: 8.5%;"></div>
<div style="float: left; width: 83%; display: table;margin: 0 auto;">
<img src="http://abcde.com/images/image.jpg" style="display: block; margin-left: auto;margin-right: auto" width="" />
<div class="outer-wrapper" style="padding:6% 1% 1% 18%; position:absolute">
<div class="title" style="min-height: 0px; width: 66.15254%; position:absolute;margin-left:0px">
<hgroup>
% if homepage_overlay_html:
${homepage_overlay_html}
% else:
% if self.stanford_theme_enabled():
<h1>${_("Free courses from <strong>{university_name}</strong>").format(university_name="VU")}</h1>
% else:
<h2>${_("Some text here")}</h2>
% endif
<h2>${_("For anyone, anywhere, anytime")}</h2>
% endif
</hgroup>
</div>
</div>
</div>
<div style="float: left; width: 8.5%;"></div>
<br style="clear: left;" />
</div>
</header>
最佳答案
不知道你的脚本是什么.. 我在下面假设和解决方案。希望对您有所帮助...
#imgeId
{
background:url(imagePath) no-repeat center center;
height:200px;
width:200px;
}
img{
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
关于html - 主图像出现在中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26924207/